Brain-Like Replay Naturally Emerges in Reinforcement Learning Agents

Jiyi Wang, Likai Tang, Huimiao Chen, Marcelo G Mattar, Sen Song · Submission to ICLR 2025 · Rejected

TL;DR

By coupling a prefrontal cortex (PFC) policy network with a hippocampal (HF) world model through a communication channel that only opens during rest, biologically realistic replay sequences naturally emerge under standard reinforcement learning optimization. Rather than relying on hard-coded replay buffers or manual priority formulas, the agent discovers multi-step sequential replay on its own, utilizing it to rapidly reorganize its internal cognitive map and adapt to changing environments without weight updates.

What Problem Does This Paper Address?

In neuroscience, hippocampal "replay"—the rapid, sequential reactivation of place cells during rest or reward consumption—is crucial for memory consolidation and path planning. In artificial intelligence, "experience replay" buffers are widely used, but they are typically hard-coded, uniform, or engineered with rigid priority heuristics (such as Temporal Difference error or Expected Value of Backup).

Conversely, biophysical neuroscience models often build replay from hand-tuned synaptic connectivity or passive predictive objectives without demonstrating how replay directly aids task execution. The authors address a fundamental question: What minimal, natural conditions cause an agent to spontaneously generate replay sequences that serve functional, reward-maximizing goals?

Methods

The authors introduce an end-to-end modular reinforcement learning architecture inspired by mammalian brain networks:

  • Hippocampal Formation (HF) Module: Modeled as a Gated Recurrent Unit (GRU) acting as a world model. It performs path integration (predicting future spatial locations) and maintains episodic memory (predicting recent reward history).
  • Prefrontal Cortex (PFC) Module: Modeled as an RNN actor-critic policy network trained via Proximal Policy Optimization (PPO) to select actions and estimate state values.
  • Sensory Encoder: A convolutional neural network (CNN) that feeds visual observations into the PFC.
  • Gated Inter-Module Passage: The HF and PFC remain completely segregated during active navigation. When the agent receives a reward and stops moving, an information channel opens ($I_{\text{replay}} = 1$) for several steps, allowing the two modules to interact recurrently.

Crucially, no replay trajectory is hard-coded. The agent is trained purely to maximize expected reward. The HF and Encoder weights are pre-trained on random environment dynamics and frozen, while the PFC and inter-module weights are optimized end-to-end with PPO.

Datasets

The authors replicated the behavioral paradigm of the rodent experiment by Igata et al. (2021):

  • Flexible Navigation Grid-World: A $5 \times 5$ open arena where the agent must navigate from a start location ($S$) to an intermediate checkpoint ($C$) for a small reward ($0.5$), then proceed to a goal ($G$) for a large reward ($1.0$).
  • Reward Relocation Benchmark: After initial mastery of checkpoint $C1$, the reward is shifted to a new location, $C2$. The agent must discover the new optimal trajectory ($S \rightarrow C2 \rightarrow G$) without fine-tuning its network weights, relying entirely on hidden-state updates.

Key Insights and Ideas

  • Replay Emerges from Two Minimal Constraints: Replay requires only that (1) dynamics serve reward maximization and (2) communication between the world model and policy network occurs during periods of immobility.
  • Directional Asymmetry: Ablating the HF-to-PFC signal collapses agent performance, whereas zeroing or randomizing the PFC-to-HF signal has negligible effect. This matches neurobiology, where hippocampal ripple activity leads prefrontal firing during awake memory consolidation.
  • Sequence Continuity Over Single-Step Summaries: The emergent replay steps form spatially continuous trajectories rather than random jumps. Ablating multi-step communication into a single-step vector significantly degraded exploration efficiency.
  • Manifold Bridging & "Stop-and-Scan": Dimensionality reduction (PCA) of PFC states shows that navigation under context $C1$ and context $C2$ forms two distinct 2D cyclic orbits. Replay acts as a transient, 3D bridge between these context manifolds, updating the agent's internal value map to immediately favor the new shortcut.

Key Results

  • Biomimetic Shift in Trajectories: The spatial replay distribution matched animal data from Igata et al. (2021): replay of the old path ($S \rightarrow C1 \rightarrow G$) decayed rapidly, while replay of the unchosen shortcut ($S \rightarrow C2$) rose before the agent systematically took the new path.
  • Exploration Efficiency: In the reward relocation task, the full replay model located the new reward significantly faster than ablation variants (reducing required exploration steps from over $20$ down to $\sim 8\text{–}15$ across multiple seeds).
  • Graceful Degradation: Masking out replay steps one by one resulted in a monotonic drop in overall accumulated reward (decreasing from $>40$ to near $0$ when all $4$ steps were masked). Shuffling the replay step sequence only mildly degraded performance, implying modular, packaged information transfer.
  • Linear Readout Accuracy: Hidden-state decoders (Gaussian Naïve Bayes and Ridge Regression) demonstrated that reward identity and future action trajectories could be decoded with high accuracy immediately following the replay event.

Limitations and Future Work

  • Strict In-Motion Segregation: Artificially cutting off HF–PFC communication during movement oversimplifies biological reality, where coordinated theta waves mediate real-time sensory and navigational coordination.
  • Scope of Replay: The paper specifically models HF place-cell reactivation; autonomous replay initiated purely within the PFC (as seen during abstract rule-switching) was not explored.
  • Task Complexity: The benchmark is confined to a $5 \times 5$ discrete grid arena. Future work must establish whether this mechanism scales naturally to high-dimensional continuous control, complex mazes, or lifelong multi-task settings.

Summary updated

BibTeX
@misc{wang2024brain,
  author = {Jiyi Wang and Likai Tang and Huimiao Chen and Marcelo G Mattar and Sen Song},
  title = {{Brain-Like Replay Naturally Emerges in Reinforcement Learning Agents}},
  year = {2024},
  eprint = {2402.01467},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.01467},
}
Figure