cs.LGFeb 20, 2026

Leakage and Second-Order Dynamics Improve Hippocampal RNN Replay

Authors: Josue Casco-Rodriguez, Nanda H. Krishna, Richard G. Baraniuk

Organizations: Department of Electrical and Computer Engineering, Rice University, USA · Mila - Quebec AI Institute & Université de Montréal, Canada

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.

Figures & tables

Appendix figures & tables8 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

Apr 17, 2026

Impact of leaky dynamics on predictive path integration accuracy in recurrent neural networks

Experimental evidence indicates that intrinsic temporal dynamics operating across multiple time scales are closely associated with the emergence of periodic spatial activity of increasing complexity. However, how information encoded in grid-like firing patterns for path integration is processed across these intrinsic time scales remains unclear. To address this question, we introduce adaptive time scales through a leak term in recurrent neural networks (RNNs), forming leaky RNNs discretized from the continuous attractors of firing rate models. Our results demonstrate that leaky RNNs substantially enhance the emergence of well-defined and highly regular hexagonal firing patterns. Compared with vanilla RNNs lacking a leak term, the trained leaky RNNs produce more accurate position estimates while generating reliable grid-cell-like representations. Furthermore, under identical noise conditions, leaky RNNs consistently exhibit more stable dynamics and better-defined grid structures. The learned dynamics also give rise to stable torus attractors with a clear central hole, supporting robust and regular grid-like activity. Overall, the dynamic leak acts as a low-pass filtering mechanism that protects recurrent neural circuitry from noise, stabilizes network dynamics, and improves path-integration accuracy in recurrent neural networks.
Sep 16, 2026

Neural noise enables accurate internal simulation of rare events

The brain needs an accurate internal model of the world to generate predictions and guide behavior. However, it must estimate the statistical structure of the environment from limited experience. This is particularly difficult for rare events, whose observed frequencies in a limited sample may substantially under- or overestimate their true frequencies. How the brain constructs an accurate internal model despite this sampling problem remains unclear. We address this problem using a Bayesian Confidence Propagation Neural Network (BCPNN) trained on event sequences from a Markov-chain random walk with controlled event frequencies. Treating the underlying Markov structure as the ground truth, we train the network on limited sample of event sequences and then allow it to generate autonomous replay based on the learned structure. We evaluate replay fidelity at the levels of both marginal event frequencies and conditional transition structure. We find that moderate neural noise, modeled as temporally correlated random fluctuations in unit activity during replay, is critical for faithful internal simulation. Without this variability, deterministic replay systematically under- or overrepresents rare events, whereas moderate noise restores both their marginal and conditional occurrence. Moderate noise also broadens the range of parameter values that produce accurate replay, making the model more robust to parameter variation. Together, these results support noise-assisted internal simulation as a potential mechanism for compensating for sampling errors arising from limited experience. Our model also provides a testable framework for investigating how altered neural variability may impair internal-model fidelity in disorders such as Parkinson's disease.
Jun 8, 2026

Backward Coherence and Hidden-State Stability in Recurrent Neural Networks: A Quasi-Reverse-Martingale Theory

Recurrent neural networks maintain a hidden state hth_t, but its probabilistic meaning is often unclear. We study hidden-state stability through backward coherence: the extent to which hth_t can be reconstructed from ht+1h_{t+1} by a learned backward projector gφg_φ. Under contraction and summable backward drift, the hidden-state sequence forms a quasi-reverse-martingale. This yields almost-sure convergence, rates under mixing, an interpretable limiting representation, finite pathwise stopping times, and a theoretical framework for time-uniform confidence sequences. Simulations support the theory. Backward-coherence regularisation reduces the empirical quasi-martingale total Q^\hat Q by 4343--5858%, reaches stability 2828--4444% earlier than an unregularised RNN, and gives tracking-error recovery consistent with geometric bounds. Additional tests confirm echo-state forgetting rates bounded by ρρ and verify the increment-sum tube RtR_t with 100100% simultaneous coverage, although RtR_t is conservative; in practice, the defect-tail proxy Q^t\hat Q_t is the more useful monitor. The backward-coherence loss is also equivalent to minimising a Kullback--Leibler divergence in a Gaussian backward model, linking the method to variational inference. Extensions cover φφ-mixing inputs, change-point tracking, and finite-sample concentration. Three real-data studies further validate the approach. On PhysioNet 2012 ICU data, the Reverse Martingale RNN (RMRNN) matches RNN mortality-prediction AUC while reaching stable representations 13 hours earlier. On FRED-MD, it reduces one-month-ahead forecast error by about fourfold under concept drift. On UCI Human Activity Recognition, it maintains lower post-transition tracking error with geometric decay. The guarantees apply under the stated assumptions; universality is not claimed.