Leakage and Second-Order Dynamics Improve Hippocampal RNN Replay

Josue Casco-Rodriguez, Nanda H. Krishna, Richard G. Baraniuk · DOI

Abstract: Biological neural networks (like the hippocampus) can internally generate "replay" resembling stimulus-driven activity. Recent computational models of replay use noisy recurrent neural networks (RNNs) trained to path-integrate. Replay in these networks has been described as Langevin sampling, but new modifiers of noisy RNN replay have surpassed this description. We re-examine noisy RNN replay as sampling to understand or improve it in three ways: (1) Under simple assumptions, we prove that the gradients replay activity should follow are time-varying and difficult to estimate, but readily motivate the use of hidden state leakage in RNNs for replay. (2) We confirm that hidden state adaptation (negative feedback) encourages exploration in replay, but show that it incurs non-Markov sampling that also slows replay. (3) We propose the first model of temporally compressed replay in noisy path-integrating RNNs through hidden state momentum, connect it to underdamped Langevin sampling, and show that, together with adaptation, it counters slowness while maintaining exploration. We verify our findings via path-integration of 2D triangular and T-maze paths and of high-dimensional paths of synthetic rat place cell activity.

Introduction

Hippocampal replay—the spontaneous reactivation of neural sequences representing past experiences—is a cornerstone of memory consolidation and spatial planning. These sequences are characterized by two key features: temporal compression (occurring much faster than the original experience) and exploration (traversing paths never physically taken by the animal). While noisy recurrent neural networks (RNNs) trained for path-integration naturally generate replay via Langevin sampling, standard models fail to explain the biological mechanisms driving these specific dynamics. This paper investigates how hidden state leakage, adaptation, and momentum (underdamped dynamics) refine RNN-based replay to better match biological observations.

Theoretical Framework: Leakage and Adaptation

The authors first analyze the "score function"—the gradient that guides replay activity toward high-probability states. They demonstrate that for even simple stochastic processes, this gradient is non-stationary and time-varying. Hidden state leakage, a ubiquitous feature in biological neurons where activity decays over time, acts as a crucial inductive bias. It allows the RNN to track these non-stationary statistics more effectively than standard architectures.

To enhance exploration, the researchers implement neural adaptation (negative feedback). By preventing neurons from remaining active indefinitely, adaptation forces the network to transition between different attractor basins. However, mathematical analysis reveals a trade-off: while adaptation increases the diversity of replayed paths, it acts as a "brake," slowing down the sampling process and hindering the temporal compression observed in vivo.

Underdamped Dynamics: The Role of Momentum

To resolve the slowness induced by adaptation, the authors introduce a second-order dynamical system by adding a momentum term to the hidden state updates. This transforms the system from overdamped to underdamped Langevin sampling.

This modification allows the network to maintain high exploration while significantly increasing the speed of trajectory generation. The authors argue that while "momentum" is a physical concept, it serves as a functional proxy for biological mechanisms like short-term synaptic facilitation or NMDA receptor dynamics, which create similar persistent activity effects in neural circuits.

Key Results

The model was validated using 2D navigation tasks (T-maze and Triangle) and high-dimensional synthetic place cell data generated via the RatInABox toolkit.

  • Temporal Compression: Underdamped dynamics achieved up to 60% faster reach times compared to baseline models, successfully replicating the "fast-forward" nature of biological replay.
  • Exploration vs. Fidelity: Adaptation alone can degrade the similarity of replay to real paths (fidelity). However, the addition of momentum restores this fidelity while preserving the network's ability to visit novel regions.
  • Inductive Bias of Leakage: RNNs with leakage showed significantly lower Mean Squared Error (MSE) during path-integration training, particularly when input data was sparse or masked, proving its value as a functional necessity.
Comparison of mean and standard deviation for awake paths s(t) and various replay path models r(t). Underdamped dynamics show faster convergence to the steady state, illustrating temporal compression.

Discussion and Future Work

This work provides a rigorous link between biological neural features and the mathematical requirements of efficient sampling. By framing replay as underdamped Langevin sampling, the authors provide a theoretical foundation for how the brain achieves fast, exploratory memory reactivation.

Limitations remain, as the current models are rate-based rather than spike-based. Future research will focus on extending this theory to spiking neural networks and investigating the specific hippocampal circuit implementations—such as those in sub-region CA3—that might naturally give rise to these second-order dynamics.

Summary updated

BibTeX
@misc{cascorodriguez2026leakage,
  author = {Josue Casco-Rodriguez and Nanda H. Krishna and Richard G. Baraniuk},
  title = {{Leakage and Second-Order Dynamics Improve Hippocampal RNN Replay}},
  year = {2026},
  eprint = {2602.18401},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.18401},
}
Figure