123
We reveal that deep neural networks process information in two distinct phases: an initial phase of dimensionality expansion and a subsequent phase of dimensionality compression.
We show how local connectivity motifs in recurrent networks influence the dimensionality of activity manifolds. Dimensionality can be systematically regulated by local connectivity structures.
This work shows how predictive learning enables the extraction of representational maps of explored world models. We trained a recurrent neural network to predict observation sequences, resulting in low-dimensional, nonlinearly transformed representations of sensory inputs.
We demonstrate that the actions of animals can be predicted by decoding transitions between specific neural states in the secondary motor cortex of rats.
@article {Pang2022.02.28.482342,
author = {Pang, Rich and Recanatesi, Stefano},
title = {Path vectors: a neural code for sequential memory},
elocation-id = {2022.02.28.482342},
year = {2022},
doi = {10.1101/2022.02.28.482342},
publisher = {Cold Spring Harbor Laboratory},
URL = {https://www.biorxiv.org/content/early/2022/03/01/2022.02.28.482342},
eprint = {https://www.biorxiv.org/content/early/2022/03/01/2022.02.28.482342.full.pdf},
journal = {bioRxiv}
}copy to clipboardWhile recalling lists of unrelated items is highly challenging we can recall much longer sequences structured as an episode or story. It is unknown why these patterns have such a striking influence on memory. We introduce a model where the experience of an episode or story is represented as a path through a pre-existing network of cognitive states. We demonstrate that by summing the neural representations of the visited states, this path can be transformed into a simple neural code: a path vector. We show how, by leveraging sparse connectivity and high dimensionality, path vectors provide robust codes for a large set of sequences and can be decoded mechanistically for memory retrieval. Fitting our model to data reveals how human free and serial recall may emerge from adapting coding mechanisms tuned for sequences aligned with existing network paths. We thus posit that sequences such as episodes or stories map more directly to existing cognitive network paths than arbitrary lists, with the latter eliciting paths that tend to interfere and impair recall. Our model suggests that mnemonic strategies like imposing narrative structure on a list act to improve recall by reducing such path interference. This work illuminates a simple bioplausible means for flexibly recruiting existing cognitive structures to encode new memories.
@article{Schoonover2022GradientLearning,
author = {Schoonover, Casey E. and Ohashi, Stuart N. and Axel, Richard and Fink, Alex J. P.},
title = {Gradient-based learning drives robust representations in recurrent neural networks by balancing compression and expansion},
journal = {Nature Machine Intelligence},
volume = {4},
number = {8},
pages = {725--737},
year = {2022},
doi = {10.1038/s42256-022-00498-0},
url = {https://doi.org/10.1038/s42256-022-00498-0},
publisher = {Springer Nature}
}copy to clipboardNeural networks need the right representations of input data to learn. Here we ask how gradient-based learning shapes a fundamental property of representations in recurrent neural networks (RNNs)—their dimensionality. Through simulations and mathematical analysis, we show how gradient descent can lead RNNs to compress the dimensionality of their representations in a way that matches task demands during training while supporting generalization to unseen examples. This can require an expansion of dimensionality in early timesteps and compression in later ones, and strongly chaotic RNNs appear particularly adept at learning this balance. Beyond helping to elucidate the power of appropriately initialized artificial RNNs, this fact has implications for neurobiology as well. Neural circuits in the brain reveal both high variability associated with chaos and low-dimensional dynamical structures. Taken together, our findings show how simple gradient-based learning rules lead neural networks to solve tasks with robust representations that generalize to new cases.
@article{RECANATESI2022100555,
title = {A scale-dependent measure of system dimensionality},
journal = {Patterns},
volume = {3},
number = {8},
pages = {100555},
year = {2022},
issn = {2666-3899},
doi = {https://doi.org/10.1016/j.patter.2022.100555},
url = {https://www.sciencedirect.com/science/article/pii/S266638992200160X},
author = {Stefano Recanatesi and Serena Bradde and Vijay Balasubramanian and Nicholas A. Steinmetz and Eric Shea-Brown},
keywords = {dimensionality, dynamics, multiscale geometry, complex data, data mining, neural activity},
}copy to clipboardA fundamental problem in science is uncovering the effective number of degrees of freedom in a complex system: its dimensionality. A system’s dimensionality depends on its spatiotemporal scale. Here, we introduce a scale-dependent generalization of a classic enumeration of latent variables, the participation ratio. We demonstrate how the scale-dependent participation ratio identifies the appropriate dimension at local, intermediate, and global scales in several systems such as the Lorenz attractor, hidden Markov models, and switching linear dynamical systems. We show analytically how, at different limiting scales, the scale-dependent participation ratio relates to well-established measures of dimensionality. This measure applied in neural population recordings across multiple brain areas and brain states shows fundamental trends in the dimensionality of neural activity—for example, in behaviorally engaged versus spontaneous states. Our novel method unifies widely used measures of dimensionality and applies broadly to multivariate data across several fields of science.
@article{
author={Recanatesi,Stefano},
year={2022},
month={08},
title={Untangling network information flow},
journal={Nature Computational Science},
volume={2},
number={8},
pages={475-476},
note={Copyright - Copyright Nature Publishing Group Aug 2022; Last updated - 2025-07-02},
keywords={Computers--Information Science And Information Theory; Communication; Information flow},
doi={https://doi.org/10.1038/s43588-022-00284-3},
url={https://www.proquest.com/scholarly-journals/untangling-network-information-flow/docview/3225996385/se-2},
}copy to clipboardDetermining how information flows throughout a network of interconnected components is a challenging task in many scientific domains. A framework is presented to deconstruct the flow of signals that are transmitted across any two areas (such as brain areas) and define how each area represents these signals.
@article{FARRELL2023102780,
title = {From lazy to rich to exclusive task representations in neural networks and neural codes},
journal = {Current Opinion in Neurobiology},
volume = {83},
pages = {102780},
year = {2023},
issn = {0959-4388},
doi = {https://doi.org/10.1016/j.conb.2023.102780},
url = {https://www.sciencedirect.com/science/article/pii/S0959438823001058},
author = {Matthew Farrell and Stefano Recanatesi and Eric Shea-Brown},
}copy to clipboardNeural circuits—both in the brain and in “artificial” neural network models—learn to solve a remarkable variety of tasks, and there is a great current opportunity to use neural networks as models for brain function. Key to this endeavor is the ability to characterize the representations formed by both artificial and biological brains. Here, we investigate this potential through the lens of recently developing theory that characterizes neural networks as “lazy” or “rich” depending on the approach they use to solve tasks: lazy networks solve tasks by making small changes in connectivity, while rich networks solve tasks by significantly modifying weights throughout the network (including “hidden layers”). We further elucidate rich networks through the lens of compression and “neural collapse”, ideas that have recently been of significant interest to neuroscience and machine learning. We then show how these ideas apply to a domain of increasing importance to both fields: extracting latent structures through self-supervised learning.
@misc{buzaglo2025uniformrandomweightsinduce,
title={How Uniform Random Weights Induce Non-uniform Bias: Typical Interpolating Neural Networks Generalize with Narrow Teachers},
author={Gon Buzaglo and Itamar Harel and Mor Shpigel Nacson and Alon Brutzkus and Nathan Srebro and Daniel Soudry},
year={2025},
eprint={2402.06323},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2402.06323},
}copy to clipboardA main theoretical puzzle is why over-parameterized Neural Networks (NNs) generalize well when trained to zero loss (i.e., so they interpolate the data). Usually, the NN is trained with Stochastic Gradient Descent (SGD) or one of its variants. However, recent empirical work examined the generalization of a random NN that interpolates the data: the NN was sampled from a seemingly uniform prior over the parameters, conditioned on that the NN perfectly classifies the training set. Interestingly, such a NN sample typically generalized as well as SGD-trained NNs. Contributions. We prove that such a random NN interpolator typically generalizes well if there exists an underlying narrow “teacher NN” that agrees with the labels. Specifically, we show that such a `flat’ prior over the NN parameterization induces a rich prior over the NN functions, due to the redundancy in the NN structure. In particular, this creates a bias towards simpler functions, which require less relevant parameters to represent — enabling learning with a sample complexity approximately proportional to the complexity of the teacher (roughly, the number of non-redundant parameters), rather than the student’s.
@misc{buzaglo2025uniformrandomweightsinduce,
title={How Uniform Random Weights Induce Non-uniform Bias: Typical Interpolating Neural Networks Generalize with Narrow Teachers},
author={Gon Buzaglo and Itamar Harel and Mor Shpigel Nacson and Alon Brutzkus and Nathan Srebro and Daniel Soudry},
year={2025},
eprint={2402.06323},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2402.06323},
}copy to clipboardA main theoretical puzzle is why over-parameterized Neural Networks (NNs) generalize well when trained to zero loss (i.e., so they interpolate the data). Usually, the NN is trained with Stochastic Gradient Descent (SGD) or one of its variants. However, recent empirical work examined the generalization of a random NN that interpolates the data: the NN was sampled from a seemingly uniform prior over the parameters, conditioned on that the NN perfectly classifies the training set. Interestingly, such a NN sample typically generalized as well as SGD-trained NNs. Contributions. We prove that such a random NN interpolator typically generalizes well if there exists an underlying narrow “teacher NN” that agrees with the labels. Specifically, we show that such a `flat’ prior over the NN parameterization induces a rich prior over the NN functions, due to the redundancy in the NN structure. In particular, this creates a bias towards simpler functions, which require less relevant parameters to represent — enabling learning with a sample complexity approximately proportional to the complexity of the teacher (roughly, the number of non-redundant parameters), rather than the student’s.
@misc{
chen2025a,
title={A simple connection from loss flatness to compressed representations in neural networks},
author={Shirui Chen and Stefano Recanatesi and Eric Todd SheaBrown},
year={2025},
url={https://openreview.net/forum?id=j7yeq2sOj3}
}copy to clipboardThe generalization capacity of deep neural networks has been studied in a variety of ways, including at least two distinct categories of approaches: one based on the shape of the loss landscape in parameter space, and the other based on the structure of the representation manifold in feature space (that is, in the space of unit activities). Although these two approaches are related, they are rarely studied together explicitly. Here, we present an analysis that bridges this gap. We show that in the final phase of learning in deep neural networks, the compression of the manifold of neural representations correlates with the flatness of the loss around the minima explored by SGD. This correlation is predicted by a relatively simple mathematical relationship: a flatter loss corresponds to a lower upper bound on the compression metrics of neural representations. Our work builds upon the linear stability insight by Ma and Ying, deriving inequalities between various compression metrics and quantities involving sharpness. Empirically, our derived inequality predicts a consistently positive correlation between representation compression and loss sharpness in multiple experimental settings. Overall, we advance a dual perspective on generalization in neural networks in both parameter and feature space.
@inproceedings{NEURIPS2024_4ee22ead,
author = {Kachaiev, Oleksii and Recanatesi, Stefano},
booktitle = {Advances in Neural Information Processing Systems},
doi = {10.52202/079017-1420},
editor = {A. Globerson and L. Mackey and D. Belgrave and A. Fan and U. Paquet and J. Tomczak and C. Zhang},
pages = {44710--44734},
publisher = {Curran Associates, Inc.},
title = {Learning to Embed Distributions via Maximum Kernel Entropy},
url = {https://proceedings.neurips.cc/paper_files/paper/2024/file/4ee22ead36c9625396e353a6a9fca822-Paper-Conference.pdf},
volume = {37},
year = {2024}
}copy to clipboardEmpirical data can often be considered as samples from a set of probability distributions. Kernel methods have emerged as a natural approach for learning to classify these distributions. Although numerous kernels between distributions have been proposed, applying kernel methods to distribution regression tasks remains challenging, primarily because selecting a suitable kernel is not straightforward. Surprisingly, the question of learning a data-dependent distribution kernel has received little attention. In this paper, we propose a novel objective for the unsupervised learning of data-dependent distribution kernel, based on the principle of entropy maximization in the space of probability measure embeddings. We examine the theoretical properties of the latent embedding space induced by our objective, demonstrating that its geometric structure is well-suited for solving downstream discriminative tasks. Finally, we demonstrate the performance of the learned kernel across different modalities.
@article{pang2025nonhebbian,
title={A non-Hebbian code for episodic memory},
author={Pang, Rich and Recanatesi, Stefano},
journal={Science Advances},
volume={11},
pages={eado4112},
year={2025},
doi={10.1126/sciadv.ado4112},
url={https://doi.org/10.1126/sciadv.ado4112}
}copy to clipboardHebbian plasticity has long dominated neurobiological models of memory formation. Yet, plasticity rules operating on one-shot episodic memory timescales rarely depend on both pre- and postsynaptic spiking, challenging Hebbian theory in this crucial regime. Here, we present an episodic memory model governed by a simpler rule depending only on presynaptic activity. We show that this rule, capitalizing on high-dimensional neural activity with restricted transitions, naturally stores episodes as paths through complex state spaces like those underlying a world model. The resulting memory traces, which we term path vectors, are highly expressive and decodable with an odor-tracking algorithm. We show that path vectors are robust alternatives to Hebbian traces, support one-shot sequential and associative recall, along with policy learning, and shed light on specific hippocampal plasticity rules. Thus, non-Hebbian plasticity is sufficient for flexible memory and learning and well-suited to encode episodes and policies as paths through a world model.
@article{shao2025impact,
title={Impact of Local Connectivity Patterns on Excitatory-Inhibitory Network Dynamics},
author={Shao, Yuxiu and Dahmen, David and Recanatesi, Stefano and Shea-Brown, Eric and Ostojic, Srdjan},
journal={PRX Life},
volume={3},
number={2},
pages={023008},
year={2025},
publisher={American Physical Society},
doi={10.1103/PRXLife.3.023008},
url={https://doi.org/10.1103/PRXLife.3.023008}
}copy to clipboardNetworks of excitatory and inhibitory (EI) neurons form a canonical circuit in the brain. Seminal theoretical results on the dynamics of such networks are based on the assumption that synaptic strengths depend on the type of neurons they connect, but are otherwise statistically independent. Recent synaptic physiology datasets, however, highlight the prominence of specific connectivity patterns that go well beyond what is expected from independent connections. While decades of influential research have demonstrated the strong role of the basic EI cell type structure, the extent to which additional connectivity features influence dynamics remains to be fully determined. Here we examine the effects of pairwise connectivity motifs on the linear dynamics in excitatory-inhibitory networks using an analytical framework that approximates the connectivity in terms of low-rank structures. This low-rank approximation is based on a mathematical derivation of the dominant eigenvalues of the connectivity matrix, and it predicts the impact on responses to external inputs of connectivity motifs and their interactions with cell-type structure. Our results reveal that a particular pattern of connectivity, namely chain motifs, have a much stronger impact on dominant eigenmodes than other pairwise motifs. In particular, an over-representation of chain motifs induces a strong positive eigenvalue in inhibition-dominated networks, and it generates a potential instability that requires revisiting the classical excitation-inhibition balance criteria. Examining the effects of external inputs, we show that chain motifs can on their own induce paradoxical responses, where an increased input to inhibitory neurons leads to a decrease in their activity due to the recurrent feedback. These findings have direct implications for the interpretation of experiments in which responses to optogenetic perturbations are measured and used to infer the dynamical regime of cortical circuits.
@inproceedings{waizer2026tree,
title={Tree of Memory: A Mathematical Model of Hierarchical Episodic Recall},
author={Waizer, Tomer and Recanatesi, Stefano and Ben-Eliezer, Omri},
booktitle={Proceedings of the Annual Meeting of the Cognitive Science Society},
volume={48},
year={2026},
url={https://escholarship.org/uc/item/57s0z6vt}
}copy to clipboardUnderstanding free recall requires models that explain not only how many items are retrieved, but also how retrieval is organized—with clustered output, structured transitions, and strong dependence on temporal position. We introduce the Tree of Memory (TOM), in which recall unfolds as a probabilistic search over an explicitly hierarchical episodic representation, coupled with a minimal semantic association structure. The episodic component represents experience across temporal scales encoded in different hierarchical layers. Recall proceeds via probabilistic depth-first traversal of the episodic tree, interleaved with semantic exploration triggered upon item retrieval. The framework admits explicit mathematical characterizations of recall-capacity scaling regimes: depending on the scaling of attention-weighted episodic accessibility, the expected number of recalled items grows sublinearly with list length. In simulations, TOM reproduces canonical free-recall signatures, thereby providing a principled framework to study how hierarchical episodic organization, attention, and semantic associations jointly shape free recall.
@article{smith2026local,
title = {From Local Learning to Global Prediction Through Layered Surprise Cascades},
author = {Smith, Andrew L. and Jiang, Linxing Preston and Eshraghian, Jason K. and Bull, Matthew S. and Recanatesi, Stefano},
journal = {arXiv preprint arXiv:2608.05481},
year = {2026},
url = {https://arxiv.org/abs/2608.05481}
}copy to clipboardHierarchical predictive coding proposes a compelling hypothesis of brain computation, suggesting that the cortex builds layered predictions to minimize surprise. Yet most models rely on error-coding neurons or generative modeling of unclear biological plausibility. Here, we examine a biologically plausible framework in which the functional goals of predictive coding emerge from local contrastive learning and simple activity cancellation. Building on recent machine learning advances, we present a recurrent variant of the Forward-Forward (FF) algorithm with an inverted objective that increases activity for negative data. This setup yields predictive representations across layers, capturing hallmark features of cortical computation such as top-down modulation and surprise signaling. Our results suggest that key principles of predictive coding can emerge from simple, local learning rules, offering a new bridge between neuroscience and machine learning.
@article{dahmen2026strong,
title = {Strong and localized recurrence controls the dimensionality of neural activity across brain areas},
author = {Dahmen, David and Recanatesi, Stefano and Jia, Xiaoxuan and Ocker, Gabriel K. and Lahiji, Nilufar and Musall, Simon and Campagnola, Luke and Seeman, Stephanie and Jarsky, Tim and Helias, Moritz and Shea-Brown, Eric},
journal = {Nature Neuroscience},
volume = {29},
pages = {2578--2587},
year = {2026},
month = {8},
doi = {10.1038/s41593-026-02395-w},
url = {https://doi.org/10.1038/s41593-026-02395-w}
}copy to clipboardThe brain contains an astronomical number of neurons, but it is their collective activity that underlies brain function. The number of degrees of freedom that this activity explores (its dimensionality) is therefore a fundamental signature of neural dynamics. However, it is not known what controls dimensionality in the biological brain. Through analysis of high-density Neuropixels recordings, here, we argue that areas across the mouse cortex predominantly operate in a sensitive regime that gives recurrent synaptic networks a strong role in regulating dimensionality. This control is expressed across time, as cortical activity transitions among states with different dimensionalities. Moreover, this control is mediated through highly tractable features of synaptic networks (network motifs). Analyzing a massive synaptic physiology dataset, we find that motifs impacting dimensionality are prevalent in both mouse and human brains. Thus, local circuitry scales up systematically to help control the degrees of freedom that brain networks may explore and exploit.
@article {Amalberti2026.09.15.751810,
author = {Amalberti, Loris and Hauer, Maximilian and Bennett, Corbett and Olsen, Shawn R. and Dahmen, David and Recanatesi, Stefano},
title = {Task Engagement Gates Interareal Communication Geometry in the Mouse Thalamocortical{\textendash}Midbrain Visual Circuit},
elocation-id = {2026.09.15.751810},
year = {2026},
doi = {10.64898/2026.09.15.751810},
publisher = {Cold Spring Harbor Laboratory},
URL = {https://www.biorxiv.org/content/early/2026/09/21/2026.09.15.751810},
eprint = {https://www.biorxiv.org/content/early/2026/09/21/2026.09.15.751810.full.pdf},
journal = {bioRxiv}
}copy to clipboardVisual processing unfolds across hierarchically organized brain circuits. Existing theories largely explain changes in population geometry through local shifts in gain, firing-rate statistics, or recurrent dynamics, yet do not account for how interareal coordination interacts with local population geometry to constrain downstream population states. We used task engagement, compared to a passive condition, to probe this coordination in Neuropixels recordings spanning the mouse visual thalamocortical–midbrain circuit. Engagement reduced network activity, response participation, and dimensionality across the hierarchy. To account for this circuit-level organization, we developed a theoretical framework in which afferent population geometry interacts with local recurrent dynamics to constrain the accessible dynamics of downstream populations. Across the thalamocortical stages, population-wide afferent statistics predicted downstream activity and dimensionality. At the cortex– midbrain interface, engagement instead reorganized interareal communication geometry. Together, these results identify interareal input geometry as a key constraint on neural population dynamics and uncover a general principle by which behavioral engagement constrains neural state spaces across distributed visual circuits.
Using predictive recurrent network models of place cells, we show that reward changes both how predictive spatial maps are used and how they are structured, through distinct mechanisms.


