Abstract
Hippocampus is critical for memory, imagination and constructive reasoning. However, recent models have suggested that its neuronal responses can be well explained by graphs, or state-spaces, that model the transitions between experiences. Here we use simulations and hippocampal recordings to reconcile these views. We show that if state-spaces are constructed compositionally from existing building blocks, or primitives, hippocampal responses can be interpreted as compositional memories, binding these primitives together. Critically, this enables agents to behave optimally in novel environments with no new learning, inferring behaviour directly from the composition. We predict a role for hippocampal replay in building and consolidating these compositional memories. Importantly, due to their compositional nature, replay can construct states the agent has never experienced - effectively building memories of the future. We test these predictions in two datasets by showing that replay events from newly discovered landmarks induce and strengthen new remote firing fields. These memories, built in replay, are compositional. When the landmark is moved, replay builds a new firing field at the same vector to the new location. Together, these findings provide a framework for reasoning about compositional memories, and demonstrate that such memories are formed in hippocampal replay.
Introduction
The hippocampal formation has long been a focal point for two distinct theories of brain function. One perspective emphasizes its role in episodic memory and scene construction—the ability to imagine and mentally simulate environments. The other views it as a "cognitive map" or state-space, providing the structural foundation for reinforcement learning (RL) and navigation. However, traditional RL models often struggle with the flexibility seen in biological organisms, which can navigate novel shortcuts or adapt to environmental changes with minimal experience.
This research proposes a reconciliation: the hippocampus acts as a "construction site" that builds state-spaces compositionally. By utilizing reusable building blocks provided by the cortex, the hippocampus can rapidly assemble maps of new environments, enabling "zero-shot" behavioral planning and the creation of "memories of the future" through neural replay.
The Compositional Framework
The core of the proposed model is the idea that the brain does not learn every new environment from scratch. Instead, it leverages reusable "primitives" or building blocks represented in the cortex. These include grid cells, which provide a global spatial coordinate system, and object-vector cells (OVCs), which represent the distance and direction to specific landmarks, walls, or rewards.
In this framework, hippocampal place cells are formed through conjunctive coding—essentially an "outer product" of these cortical inputs. This process binds a specific spatial location (defined by grid cell phases) to a specific relational feature (defined by OVCs). For example, a place cell might represent "the location three meters east of the cake." Because these building blocks are universal, the hippocampus can immediately construct a meaningful map as soon as a landmark is perceived in a new space.
Constructive Replay and Memories of the Future
A pivotal aspect of this research is the reinterpretation of hippocampal replay. While traditionally seen as a mechanism for consolidating past experiences, the authors argue it is also a tool for construction. Through constructive replay, the model performs offline path integration. By "imagining" a trajectory from a known reward to a distant, unvisited location, the hippocampus can bind the reward-vector to that remote spot.
This allows the agent to build "memories of the future"—representations of paths and goals it has never physically traversed. The study validates this by showing that replay events from newly discovered landmarks can induce and strengthen new remote firing fields in hippocampal recordings.
Zero-Shot Behavioral Inference
The ultimate benefit of a compositional map is its immediate utility for behavior. In standard RL, an agent must visit a state to assign it a "value." In the compositional model, states come "pre-assigned" with relational meaning.
By training a policy to map these compositional representations (e.g., "reward is to the east") directly to actions, the agent achieves zero-shot generalization. If the agent knows where a reward is relative to its current position, it already knows the optimal action to take, even in a brand-new environment. This bypasses the "brittleness" of traditional models and explains the remarkable navigational flexibility of animals.
Key Results and Implications
The simulations demonstrated that compositional agents could achieve near-perfect navigation accuracy in novel environments on their first attempt, whereas traditional RL agents failed until extensive retraining occurred. Furthermore, the model successfully handled hierarchical tasks, using "between-room" vectors to guide behavior across complex, nested environments.
This framework also provides a novel explanation for non-random remapping. When an environment changes, place cells change their firing locations. In this model, this remapping is a predictable consequence of how grid and vector phases realign, rather than a random reshuffling.
Conclusion
By viewing the hippocampus as a compositional engine, this research bridges the gap between memory and reinforcement learning. It suggests that the brain's ability to imagine the future is not just a byproduct of memory, but a fundamental mechanism for efficient, flexible behavior. The hippocampus doesn't just remember where we've been; it constructs the maps that tell us where to go next.
Summary updated