The inherent capacity of neurons to learn order relations and support abstract reasoning.
The 4 matches
- [1] § Methods › Theoretical analysis of the shape of 2D projections of the firing activity of soft rank selective neurons for items in an order, discussed in section “Explaining curved 2D projections of neu ↔ Figure S10 S11 S12.ipynb, lines 49–129 · score 0.64 · Gaussian tuning curves, rank selective neuron, fires, matrix
- [2] § Results › Explaining curved 2D projections of neural representations of linear orders in the human brain ↔ Figure S10 S11 S12.ipynb, lines 49–129 · score 0.61 · Gaussian tuning, rank selective neurons, S10, S12, firing, encode
- [3] § Results › Rapid reconfiguration of the internal model when separately learned orders are combined on the basis of new information ↔ Figure S7.ipynb, lines 639–725 · score 0.56 · boundary pair, train short, train long, lowest, seeds, phase
- [4] § Methods › Details to combining separately learned orders into one order, discussed in section “Rapid reconfiguration of the internal model when separately learned orders are combined on the basis of n ↔ Figure2+S2+S3.ipynb, lines 1–129 · score 0.53 · 0.2–1 %, neurons fire, sparsity, dimension
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Jupyter notebook · 329 lines · 10 KB · MIT · 2 matches
- # %%
- import numpy as np
- import pandas as pd
- from sklearn.decomposition import PCA
- import matplotlib.pyplot as plt
- def generate_data_adjusted(num_objects, num_dimensions, num_encoded_per_dim):
- data = np.zeros((num_objects, num_dimensions))
- for dim in range(num_dimensions):
- for rank in range(num_encoded_per_dim):
- obj = dim + 1 - rank
- if 1 <= obj <= num_objects:
- data[obj - 1, dim] = obj - 3.5
- return data
- # Example usage
- num_objects = 6
- num_encoded_per_dim = 6 # Adjust the number of objects to encode per dimension
- num_dimensions = num_objects+num_encoded_per_dim-1
- # Generate the data
- data = generate_data_adjusted(num_objects, num_dimensions, num_encoded_per_dim)
- # data = data[:,1:-1]
- # Perform PCA to reduce dimensions from 10 to 2
- pca = PCA(n_components=2)
- data_pca = pca.fit_transform(data)
- # Plot the PCA results in 2D
- plt.figure(figsize=(4,4))
- plot_data = np.zeros((2,len(data_pca)))
- for i, (x, y) in enumerate(data_pca):
- plt.scatter(x, y, s=300, color='white', edgecolor='tab:blue', linewidths=2,zorder=1) # Large white circles
- plt.text(x, y, f'{i + 1}', ha='center', va='center', fontsize=12, fontweight='bold', color='tab:blue', zorder=2) # Bold object index
- plot_data[0,i]=x
- plot_data[1,i]=y
- plt.plot(plot_data[0],plot_data[1],zorder=0,color='tab:blue', lw=2)
- # Set titles and labels with consistent font size
- # plt.title("2D Visualization of 12 Objects Using PCA", fontsize=12)
- plt.xlabel("PC 1", fontsize=12)
- plt.ylabel("PC 2", fontsize=12)
- plt.axis('equal')
- # plt.title()
- plt.show()
- # %%
- import numpy as np
- from sklearn.decomposition import PCA
- import matplotlib.pyplot as plt
- def generate_data_gaussian(num_objects, num_dimensions, sigma=1.0, amplitude=1.0, center_mode="shifted"):
- """
- Build an (num_objects x num_dimensions) response matrix where each "dimension"
- corresponds to a rank-selective neuron with a Gaussian tuning curve over object rank.
- - num_objects: number of items/ranks (1..num_objects)
- - num_dimensions: number of neurons/dimensions
- - sigma: fixed std dev for all Gaussians (same variance)
- - amplitude: peak firing rate scaling
- - center_mode:
- * "shifted": centers sweep over a slightly wider range than [1, num_objects]
- (useful if you previously had extra dims for edge effects)
- * "within": centers evenly spaced strictly within [1, num_objects]
- """
- ranks = np.arange(1, num_objects + 1)[:, None] # shape (N, 1)
- if center_mode == "within":
- centers = np.linspace(1, num_objects, num_dimensions)
- elif center_mode == "shifted":
- # Spread centers across the wider range that arises when using extra dimensions
- # similar spirit to your previous construction with num_dimensions = N + K - 1.
- extra = (num_dimensions - num_objects) / 2.0
- centers = np.linspace(1 - extra, num_objects + extra, num_dimensions)
- else:
- raise ValueError("center_mode must be 'shifted' or 'within'")
- centers = centers[None, :] # shape (1, M)
- # Gaussian tuning: exp(-(r - mu)^2 / (2*sigma^2))
- data = amplitude * np.exp(-0.5 * ((ranks - centers) / sigma) ** 2)
- # Optional: mean-center each neuron's activity across objects (often helps PCA look like manifolds)
- # data = data - data.mean(axis=0, keepdims=True)
- return data
- # ----------------------------
- # Example usage (your settings)
- # ----------------------------
- num_objects = 6
- num_encoded_per_dim = 6
- num_dimensions = num_objects + num_encoded_per_dim - 1
- # Generate Gaussian-tuned data
- sigma = 1.0 # fixed variance across neurons (variance = sigma^2)
- amplitude = 1.0
- data = generate_data_gaussian(
- num_objects=num_objects,
- num_dimensions=num_dimensions,
- sigma=sigma,
- amplitude=amplitude,
- center_mode="shifted" # try "within" if you don't want extra edge centers
- )
- # PCA to 2D
- pca = PCA(n_components=2)
- data_pca = pca.fit_transform(data)
- # Plot
- plt.figure(figsize=(4, 4))
- plot_data = np.zeros((2, len(data_pca)))
- for i, (x, y) in enumerate(data_pca):
- plt.scatter(x, y, s=300, color='white', edgecolor='tab:blue', linewidths=2, zorder=1)
- plt.text(x, y, f'{i + 1}', ha='center', va='center',
- fontsize=12, fontweight='bold', color='tab:blue', zorder=2)
- plot_data[0, i] = x
- plot_data[1, i] = y
- plt.plot(plot_data[0], plot_data[1], zorder=0, color='tab:blue', lw=2)
- plt.xlabel("PC 1", fontsize=12)
- plt.ylabel("PC 2", fontsize=12)
- plt.axis('equal')
- plt.show()
- # %%
- import numpy as np
- import matplotlib.pyplot as plt
- def generate_data_gaussian(num_objects, num_dimensions, sigma=1.0, amplitude=1.0, center_mode="shifted"):
- ranks = np.arange(1, num_objects + 1)[:, None] # (N,1)
- if center_mode == "within":
- centers = np.linspace(1, num_objects, num_dimensions)
- elif center_mode == "shifted":
- extra = (num_dimensions - num_objects) / 2.0
- centers = np.linspace(1 - extra, num_objects + extra, num_dimensions)
- else:
- raise ValueError("center_mode must be 'shifted' or 'within'")
- centers = centers[None, :] # (1,M)
- data = amplitude * np.exp(-0.5 * ((ranks - centers) / sigma) ** 2)
- return data, centers.flatten()
- # Settings (match your previous example)
- num_objects = 6
- num_encoded_per_dim = 6
- num_dimensions = num_objects + num_encoded_per_dim - 1
- sigma = 1.0
- amplitude = 1.0
- center_mode = "shifted"
- # For a continuous-looking plot, sample ranks densely
- ranks_dense = np.linspace(1, num_objects, 500)[:, None] # (R,1)
- # Create centers
- if center_mode == "within":
- centers = np.linspace(1, num_objects, num_dimensions)
- else:
- extra = (num_dimensions - num_objects) / 2.0
- centers = np.linspace(1 - extra, num_objects + extra, num_dimensions)
- # Compute dense tuning curves
- tuning_dense = amplitude * np.exp(-0.5 * ((ranks_dense - centers[None, :]) / sigma) ** 2)
- # Plot all tuning curves
- plt.figure(figsize=(6, 4))
- for j in range(num_dimensions):
- plt.plot(ranks_dense[:, 0], tuning_dense[:, j])
- plt.xlabel("Rank")
- plt.ylabel("Response")
- plt.title(f"Gaussian tuning curves (sigma={sigma}, M={num_dimensions}, mode={center_mode})")
- plt.xticks(range(1, num_objects + 1))
- plt.ylim(-0.05, 1.05)
- plt.show()
- # %%
- import numpy as np
- import matplotlib.pyplot as plt
- from sklearn.decomposition import PCA
- def make_centers_fixed_neurons(num_objects, num_neurons, spacing_scale=1.0):
- """
- spacing_scale > 1 : sparser
- spacing_scale < 1 : denser
- """
- base = np.linspace(1, num_objects, num_neurons)
- center = base.mean()
- return center + spacing_scale * (base - center)
- def gaussian_tuning(ranks, centers, sigma=1.0, amplitude=1.0):
- """
- ranks: (R,)
- centers: (M,)
- returns: (R, M)
- """
- ranks = ranks[:, None]
- centers = centers[None, :]
- return amplitude * np.exp(-0.5 * ((ranks - centers) / sigma) ** 2)
- def add_noise(tuning, noise_scale=0.0, rng=None):
- """
- Add i.i.d. Gaussian noise to tuning curves.
- """
- if noise_scale <= 0:
- return tuning
- if rng is None:
- rng = np.random.default_rng(1)
- noisy = tuning + rng.normal(0.0, noise_scale, size=tuning.shape)
- return np.clip(noisy, 0.0, None) # firing rates ≥ 0
- def plot_tuning_and_pca(
- num_objects=6,
- num_neurons=11,
- sigma=1.0,
- amplitude=1.0,
- noise_scale=0.0,
- center_mode="shifted",
- dense_points=600,
- seed=0,
- connect_points=True,
- mean_center_neurons=False,
- ):
- rng = np.random.default_rng(seed)
- # neuron preferred ranks
- centers = make_centers_fixed_neurons(num_objects, num_neurons, spacing_scale=1.0)
- # ---------- Left: continuous tuning curves ----------
- ranks_dense = np.linspace(1, num_objects, dense_points)
- tuning_dense = gaussian_tuning(ranks_dense, centers, sigma, amplitude)
- tuning_dense = add_noise(tuning_dense, noise_scale, rng)
- # ---------- Right: PCA on object representations ----------
- ranks_discrete = np.arange(1, num_objects + 1)
- data = gaussian_tuning(ranks_discrete, centers, sigma, amplitude)
- data = add_noise(data, noise_scale, rng)
- if mean_center_neurons:
- data = data - data.mean(axis=0, keepdims=True)
- pca = PCA(n_components=2)
- data_pca = pca.fit_transform(data)
- # ---------- Plot ----------
- fig, axes = plt.subplots(1, 2, figsize=(6, 2.8))
- # Left panel
- ax = axes[0]
- for j in range(num_neurons):
- ax.plot(ranks_dense, tuning_dense[:, j], lw=1)
- ax.set_title(f"Tuning curves (σ={sigma_norm}, n={noise_scale})")
- ax.set_xlabel("Rank")
- ax.set_ylabel("Response")
- ax.set_xticks(range(1, num_objects + 1))
- ax.set_ylim(-0.05 * amplitude, 1.3 * amplitude)
- # Right panel
- ax = axes[1]
- xs, ys = data_pca[:, 0], data_pca[:, 1]
- for i in range(num_objects):
- ax.scatter(xs[i], ys[i], s=300, facecolor="white",
- edgecolor="tab:blue", linewidth=2, zorder=2)
- ax.text(xs[i], ys[i], f"{i+1}",
- ha="center", va="center",
- fontsize=12, fontweight="bold",
- color="tab:blue", zorder=3)
- if connect_points:
- ax.plot(xs, ys, color="tab:blue", lw=2, zorder=1)
- ax.set_title("PCA of object representations")
- ax.set_xlabel("PC 1")
- ax.set_ylabel("PC 2")
- ax.axis("equal")
- # Get current limits
- x_min, x_max = ax.get_xlim()
- y_min, y_max = ax.get_ylim()
- # Enlarge by a fraction (e.g. 10%)
- pad = 0.1
- ax.set_xlim(x_min - pad * (x_max - x_min),
- x_max + pad * (x_max - x_min))
- ax.set_ylim(y_min - pad * (y_max - y_min),
- y_max + pad * (y_max - y_min))
- plt.tight_layout()
- plt.show()
- # --------------------
- # Example run
- # --------------------
- def sigma_from_norm(num_objects, sigma_norm, eps=1e-6):
- rank_range = max(num_objects - 1, 1) # N-1 (avoid 0 when N=1)
- return max(sigma_norm * rank_range, eps)
- num_objects= 6
- sigma_norm = 0.3 # in (0,1], fraction of full rank range
- sigma = sigma_from_norm(num_objects, sigma_norm)
- plot_tuning_and_pca(
- num_objects=num_objects,
- num_neurons=6, # <-- explicit, meaningful parameter
- sigma=sigma,
- noise_scale=0.0,
- center_mode="shifted",
- mean_center_neurons=False,
- seed=0
- )
- # %%
- 1/6*0.33
- # %%
Figure S10 S11 S12.ipynb at commit 6eef732, under MIT · at the source
Overview
Abstract
Brains extract relations between objects and concepts and integrate them into cognitive maps for decision-making. But it remains unclear how they achieve that. Here we present a rigorous theory showing that single neurons can already learn to extract ranks of items in a linear order with a simple local rule for synaptic plasticity. The resulting model explains human brain data on the emergence of cognitive maps from linear orders, accounts for the terminal item effect in transitive inference, and enables rapid reconfiguration of internal representations when new evidence appears. We also present a theoretical explanation for the surprising fact that 2D projections of neural representations of linear orders in the brain are curved rather than linear. Since the model requires only local synaptic plasticity in shallow networks, it is suited for relational learning and fast inference on low-energy edge devices. We demonstrate this on the neuromorphic chip Loihi 2.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 4 matches between paragraphs and lines of code.
superrrpotato/Relationship-learning
6eef732c9ea219209c78ed3f4dadd176afe7cda3, 16 June 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
15 files
- Figure 2E(newly added during revision) and Figure S4.ipynb, Jupyter, 435 lines
- Figure S1.ipynb, Jupyter, 348 lines
- Figure S10 S11 S12.ipynb, Jupyter, 329 lines, 2 matches
- Figure S5.ipynb, Jupyter, 450 lines
- Figure S6.ipynb, Jupyter, 470 lines
- Figure S7.ipynb, Jupyter, 877 lines, 1 match
- Figure S8.ipynb, Jupyter, 1,099 lines
- Figure2+S2+S3.ipynb, Jupyter, 835 lines, 1 match
- Figure3.ipynb, Jupyter, 130 lines
- Figure4.ipynb, Jupyter, 107 lines
- Figure5.ipynb, Jupyter, 911 lines
- Figure6.ipynb, Jupyter, 169 lines
- rank_item.py, Python, 86 lines
- LICENSE, License, 21 lines
- README.md, Text, 101 lines
Zenodo 20729243
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
15 files
- Figure 2E(newly added during revision) and Figure S4.ipynb, Jupyter, 435 lines
- Figure S1.ipynb, Jupyter, 348 lines
- Figure S10 S11 S12.ipynb, Jupyter, 329 lines
- Figure S5.ipynb, Jupyter, 450 lines
- Figure S6.ipynb, Jupyter, 470 lines
- Figure S7.ipynb, Jupyter, 877 lines
- Figure S8.ipynb, Jupyter, 1,099 lines
- Figure2+S2+S3.ipynb, Jupyter, 835 lines
- Figure3.ipynb, Jupyter, 130 lines
- Figure4.ipynb, Jupyter, 107 lines
- Figure5.ipynb, Jupyter, 911 lines
- Figure6.ipynb, Jupyter, 169 lines
- rank_item.py, Python, 86 lines
- LICENSE, License, 21 lines
- README.md, Text, 101 lines
Code availability
Example code implementing the proposed learning rule, together with the code used to generate all figures, is publicly available on GitHub at (https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 26 scripts, each with its path and the digest of its content;
- 4 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability Statement
All data used in the experiments were synthetically generated. The code used to generate these data is publicly available on GitHub at (https://
Example code implementing the proposed learning rule, together with the code used to generate all figures, is publicly available on GitHub at (https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 4 keywords, 9 MeSH terms, 2 funders, 42 references.
Cite
This paper
Yang, Y., & Maass, W. (2026). The inherent capacity of neurons to learn order relations and support abstract reasoning. Nature communications, 17(1), 9436. https://
BibTeX
@article{yang2026inheren
author = {Yang, Yukun and Maass, Wolfgang},
title = {{The inherent capacity of neurons to learn order relations and support abstract reasoning}},
journal = {Nature communications},
year = {2026},
month = aug,
volume = {17},
number = {1},
pages = {9436},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {42686686},
pmcid = {PMC13538631}
}
RIS
TY - JOUR
AU - Yang, Yukun
AU - Maass, Wolfgang
TI - The inherent capacity of neurons to learn order relations and support abstract reasoning
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 9436
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "The inherent capacity of neurons to learn order relations and support abstract reasoning",
"container-title": "Nature communications",
"author": [
{
"family": "Yang",
"given": "Yukun"
},
{
"family": "Maass",
"given": "Wolfgang"
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "9436",
"DOI": "10.1038/
"PMID": "42686686",
"PMCID": "PMC13538631",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
5
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1038/s42256-026-01254-4 [code]
- Neural sampling from cognitive maps enables goal-directed imagination and planning.Journal: Nature machine intelligenceIn common: PyTorch, scikit-learn, Matplotlib, 1 other tool, computational modeling (no new data), cognitive, 6 references, 2 authors
- [2] doi:10.1371/journal.pbio.3003756
- Human brains construct individualized global rankings from identical few-shot learning input.Journal: PLoS biologyIn common: cognitive, 8 references
- [3] doi:10.1371/journal.pbio.3003755 [code]
- Action information is integrated into entorhinal representations of conceptual space and is reflected in eye movements.Journal: PLoS biologyIn common: pandas, SciPy, Matplotlib, 1 other tool, cognitive, 3 references
- [4] doi:10.1038/s41467-026-74357-6 [code]
- Hippocampo-neocortical interaction as compressive retrieval-augmented generation.Journal: Nature communicationsIn common: PyTorch, scikit-learn, pandas, 3 other tools, computational modeling (no new data), 1 reference
- [5] doi:10.1038/s41467-026-74460-8 [code]
- Spike-based alignment learning solves the weight transport problem.Journal: Nature communicationsIn common: PyTorch, scikit-learn, pandas, 3 other tools, computational modeling (no new data), 1 reference
- [6] doi:10.1038/s41467-026-71724-1 [code]
- Dynamics of oscillatory power support the integration of perceptual and mnemonic information within the premotor cortex.Journal: Nature communicationsIn common: cognitive, 4 references
- [7] doi:10.1016/j.isci.2026.117492 [code]
- Neural subspace reorganization reflects value-based decision-making.Journal: iScienceIn common: scikit-learn, pandas, SciPy, 2 other tools, cognitive, 2 references
- [8] doi:10.1371/journal.pcbi.1014438 [code]
- GATE: Adaptive learning with working memory by information gating in multi-lamellar hippocampal formation.Journal: PLoS computational biologyIn common: PyTorch, scikit-learn, pandas, 3 other tools, cognitive, 1 reference
- [9] doi:10.1371/journal.pcbi.1014162 [code]
- Exploring neural manifolds across a wide range of intrinsic dimensions.Journal: PLoS computational biologyIn common: scikit-learn, pandas, SciPy, 2 other tools, 2 references
- [10] doi:10.1038/s41593-026-02333-w [code]
- Learning shapes neural geometry in the primate prefrontal cortex.Journal: Nature neuroscienceIn common: scikit-learn, pandas, SciPy, 2 other tools, 2 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 2 repositories of the authors' code, each at its verified commit and with its license, 26 scripts, and 4 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:7291b90402c2cd4d…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
