TL;DR
How does your brain know where you are in the dark? By training a four-layer hierarchical recurrent neural network (HRNN) to track both heading and position from raw motion cues, researchers watched a virtual mirror of the mammalian navigation system emerge from scratch. Not only did the network spontaneously evolve every major spatial cell type and wiring motif found in living brains, it also serves as an in silico "digital twin" for testing how neural circuits compute space.
What Problem Does This Paper Address?
Imagine walking through a pitch-black room. Even without visual landmarks, you have a rough sense of which way you are facing and how far you’ve walked. Neuroscientists call this path integration—integrating self-motion cues over time to track orientation and position.
Recently, researchers discovered that if you train standard recurrent neural networks (RNNs) to perform path integration, their artificial neurons start behaving remarkably like biological head-direction cells (internal compasses) and grid cells (internal hexagonal coordinate systems).
However, existing RNN models take two major biological shortcuts:
- Unrealistic inputs: They typically feed the network pre-packaged, external $x$ and $y$ velocity coordinates ($v_x, v_y$). Real brains don't have access to room-aligned Cartesian velocities; instead, sensory organs measure angular velocity (turning speed) and linear speed separately.
- Flat architectures: Most models cram everything into a single, homogeneous RNN layer. Yet the brain’s limbic navigation system is a multi-region hierarchy—flowing from deep brain nuclei that process turning, up through subicular areas that track heading, and into specific layers of the medial entorhinal cortex (mEC) that map 2D space. Single-layer models cannot explain why diverse cell types exist across distinct brain regions or how information flows between them.
Methods
To bridge this gap, the authors built a Hierarchical RNN (HRNN) composed of four stacked, standard ReLU ("vanilla") RNN layers, mirroring the anatomical hierarchy of the rodent navigation circuit:
- Layer 1 receives only scalar angular velocity ($\omega_t$).
- Layer 2 receives input from Layer 1 and is trained to output current orientation (reconstructing target direction-cell activity).
- Layer 3 receives Layer 2’s directional state plus scalar linear speed ($s_t$).
- Layer 4 receives input from Layer 3 and is trained to output 2D spatial location (reconstructing target place-cell activity).
What is standard here is the basic RNN math and gradient descent optimization (minimizing cross-entropy loss over short 20-step trajectories). What is novel is the modular input-output routing and strictly feedforward inter-layer hierarchy, forcing the network to first solve angular integration before combining heading with speed to solve 2D positional integration. The authors also trained flat, unstructured, and fully connected control networks to isolate the exact roles of modularity versus hierarchy.
Datasets
The network was trained and evaluated entirely on simulated self-motion trajectories (sequences of angular velocity and linear speed paired with ground-truth 2D orientations and positions) over $T = 20$ time steps, and tested on longer 200-step rollouts. To validate emergent phenomena against real biology, the authors qualitatively compared their simulated population dynamics against published empirical rodent recordings (such as parasubiculum and mEC data from Vollan et al., 2025). No new external benchmarks were introduced.
Key Insights and Ideas
- Normative rediscovery of the brain's parts list: Without hard-coded biophysical rules, task demands alone forced each HRNN layer to specialize into exact biological counterparts: angular velocity (AV) cells in Layer 1, sharper head-direction cells in Layer 2, speed and "conjunctive" (direction + grid) cells in Layer 3, and pure, direction-independent grid cells in Layer 4—matching the real transition from mEC Layer III to Layer II.
- Wiring motifs emerge naturally: For decades, theorists hand-crafted "ring attractor" models with asymmetric synapses to explain how turning shifts an internal compass bump. The HRNN learned this exact ring manifold and asymmetric wiring naturally: clockwise-preferring (AV-) and counter-clockwise-preferring (AV+) cells wired up to push Layer 2's heading representation in opposite directions.
- Explaining "theta sweeps": In foraging rodents, spatial representations rhythmically sweep left and right ahead of the animal's actual path (~8 Hz theta rhythm). By simply adding alternating, theta-paced mutual inhibition between the learned AV+ and AV- groups in Layer 1 (plus brief sensory pinning), the entire downstream grid network reproduced alternating left-right spatial sweeps.
- Modularity vs. Hierarchy: Control experiments revealed a neat division of labor: separating where inputs enter and outputs exit (modularity) creates the specialized cell types per layer, while restricting connections to flow sequentially forward (hierarchy) sharpens ring-attractor dynamics and clean synaptic asymmetry.
Key Results
- 10x Temporal Generalization: Trained on sequences of just $T = 20$ steps, the HRNN accurately tracked orientation and 2D position over 200+ time steps.
- Cell-Type Proportions Match Anatomy: AV tuning dropped significantly down the hierarchy from Layer 1 (218/256 units) to Layer 2 (158/256 units; $p = 2.3 \times 10^{-9}$), while directional tuning sharpened from a median mean vector length of 0.60 in Layer 1 to 0.74 in Layer 2 ($p = 1.2 \times 10^{-53}$). Conjunctive grid cells concentrated in Layer 3 (33/512) before becoming pure grid cells in Layer 4 (only 3/512 conjunctive).
- Functional Connectivity: Across 256 Layer-2 and 105 Layer-3 direction cells, 7,337 functionally coupled pairs showed tightly aligned directional preferences, shifting Layer 4 spatial fields forward along the movement axis.
- Virtual Lesions Mirror In Vivo Studies: Progressively pruning 0% to 80% of synapses from Layer 2 to Layer 3 degraded Layer 4 hexagonal grid scores and spiked path-integration errors—replicating classic rat experiments where inactivating upstream head-direction nuclei scrambles downstream grid cells.
Limitations and Future Work
- Conflating head and movement direction: Real brains maintain parallel circuits for which way the head is pointing versus which way the body is moving; this model assumes they are always aligned.
- Sensitivity to supervision: As in prior normative RNN studies, grid-cell emergence depends on specific hyperparameters and the mathematical shape of the supervised place-cell targets.
- Hand-imposed oscillations: The theta-paced inhibition generating left-right sweeps was externally imposed rather than learned. Future biological experiments are needed to test the model's core predictions—such as whether knocking out lateralized AV subpopulations causes continuous compass drift, and whether cross-hemisphere inhibition drives real theta sweeps.
Summary updated