Second-Order Dynamics in Noisy RNNs Produce Exploration and Temporal Compression in Replay

Josue Casco-Rodriguez, Nanda H. Krishna, Richard G. BaraniukarXiv 2026

Imagine you’re settling into bed after a long day of hiking. As you drift off, your brain doesn't just sit idle; it starts "replaying" the trails you walked. But it doesn't play them back like a standard home movie. It’s more like a highlight reel on 2x speed that occasionally takes "what if" detours down paths you didn't actually take.

In neuroscience, we call this replay, and it’s crucial for memory and planning. While we’ve had mathematical models for this for a while, they’ve struggled to capture two key features of the real thing: why it’s so fast (temporal compression) and why it’s so creative (exploration). This paper introduces a elegant fix by borrowing a bit of classical physics: momentum.

TL;DR

By adding "second-order" dynamics—specifically adaptation and momentum—to noisy neural networks, researchers have finally simulated brain replay that is both faster than real life and capable of exploring new trajectories. They propose that the brain might achieve this high-speed "mental time travel" through a specific biological trick: neurons that calculate the derivative of their own inputs.

What Problem Does This Paper Address?

For years, the leading theory for replay has been Langevin sampling. Imagine a landscape where the "valleys" are your memories. Replay is like a marble rolling into those valleys, guided by noise.

However, standard "first-order" models are "overdamped"—it’s like trying to roll that marble through thick honey. The marble moves slowly (no temporal compression) and gets stuck in the first valley it finds (no exploration). Biological replay, however, is zippy and flexible. The authors set out to find the missing "engine" that allows recurrent neural networks (RNNs) to break free from these local ruts and speed through their mental maps.

Methods

The authors used Noisy RNNs trained on a task called path-integration—essentially, the network learns to keep track of its position based only on its velocity.

To fix the "honey" problem, they introduced two "second-order" modifiers:

  1. Spike-Frequency Adaptation (SFA): This acts as a form of negative feedback. If a neuron stays active too long, it "tires out." In our marble analogy, this is like the ground rising up beneath the marble if it sits still, forcing it to move on and explore new areas.
  2. Momentum: This implements "underdamped" dynamics. To make this biologically plausible, they propose dendritic input differentiation. Instead of just summing up signals, the "arms" of the neuron (dendrites) might subtract a slightly delayed version of the signal from the current one, effectively calculating its velocity.
This figure shows how momentum (blue) accelerates the network's path toward a goal compared to standard dynamics, while adaptation helps it push past steady states.

Datasets

The researchers tested their framework across several simulated environments:

  • 1D Ornstein-Uhlenbeck processes: A standard mathematical "random walk" used for baseline proofs.
  • 2D Navigation Tasks: A T-maze and a Triangle maze where the network had to "replay" specific routes.
  • Synthetic Rat Trajectories: Using the RatInABox toolkit, they simulated 512 "place cells" (neurons that fire in specific locations) to mimic real biological data from navigating rodents.

Key Insights and Ideas

  • The Speed-Exploration Trade-off: Adaptation is great for exploration (it stops the brain from getting stuck), but it creates "drag" that slows replay down. Momentum is the necessary counter-force that recovers that lost speed.
  • Replay as a Trajectory, Not a Point: Unlike many AI models that treat sampling as picking independent points from a distribution, this model treats replay as a continuous, directed time-series. It respects the "flow" of time.
  • Dendritic "Calculus": The paper provides a normative reason for why neurons might differentiate their inputs. It’s not just a biological quirk; it’s a mathematical requirement for high-speed mental simulation.
Figure 2: Noisy RNNs trained to path-integrate can internally generate replay trajectories resembling lived experiences. (a) A noisy RNN learns to path-integrate: it estimates a signal s(t) from (nonlinear) observations of velocity s′(t). Without input, this RNN’s noise-driven activity r(t) samples from the time-series distribution of awake activity, one timestep at a time (“replay”). (b) Each internally-driven replay trajectory is a single sample from a time-series distribution with strict temporal dependencies: awake trajectories start and stop at certain positions in specific orders, and replay trajectories reproduce these temporal structures. (c) Our definition of replay as sampling is distinct from other definitions of neural sampling in which stochastic input-driven trajectories are used to gather samples to perform Monte Carlo inference on a static distribution without temporal dependencies (see Section 2.3).

Key Results

  • Temporal Compression: The models with momentum were able to reach their "goal" up to 30% faster than the original "awake" speed of the trajectories they were trained on.
  • Enhanced Exploration: In the T-maze and Triangle tasks, the combination of adaptation and momentum allowed the networks to visit multiple "attractor basins" (different possible endpoints) in a single replay session, rather than just stalling at the first one.
  • Biologically Plausible: This is one of the first accounts of temporal compression in rate-based RNNs that doesn't rely on complex, hand-crafted "spiking" mechanisms, making it a more general theory for how various brain regions might handle memory.

Limitations and Future Work

The authors acknowledge a few abstractions. They assume "white noise" (perfectly random), whereas biological noise is likely "colored" or structured. Additionally, comparing these simulations to in vivo (live brain) recordings is notoriously difficult because real replay events are sparse and buried in background neural "chatter."

The next frontier? Testing if pharmacological tweaks—like changing levels of acetylcholine, which is known to modulate adaptation—actually change the "speed" of replay in living animals as this model predicts. They also suggest moving toward more complex "spiking" neural models to see if these second-order rules hold up at the level of individual electrical pulses.

Summary updated

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 is described as Langevin sampling, but this theory alone fails to capture the environmental exploration and temporal compression observed in real biological replay. To close this gap, we re-examine spontaneous noisy RNN activity ("replay") as Langevin sampling, one timestep at a time, from a time-series distribution resembling lived experiences (unlike previous works which defined sampling as Monte Carlo inference over a static distribution). We provide a normative second-order Langevin sampling framework wherein spike-frequency adaptation drives spatial exploration at the cost of speed, and momentum via dendritic input differentiation drives temporal compression. We numerically verify our framework via simulations of noisy RNNs trained on 2D triangular and T-maze navigation activity, and others trained on place cell activity of synthetic rats. Crucially, we observe that simultaneous adaptation and momentum increases both replay exploration and speed, and provide one of the first accounts for biologically plausible temporal compression in rate-based RNN replay. Our findings encourage experiments into whether dendritic input differentiation, or other mechanisms, may support temporal compression in memory circuits like the hippocampus.
BibTeX
@misc{cascorodriguez2026second,
  author = {Josue Casco-Rodriguez and Nanda H. Krishna and Richard G. Baraniuk},
  title = {{Second-Order Dynamics in Noisy RNNs Produce Exploration and Temporal Compression in Replay}},
  year = {2026},
  eprint = {2611.29888},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.29888},
}
Figure