Composing egocentric and allocentric maps for flexible navigation

Daniel Shani, Peter Dayan

TL;DR

Researchers have developed a reinforcement learning agent that navigates complex environments by combining two distinct types of "cognitive maps": one centered on the world (allocentric) and one centered on the self (egocentric). By using Successor Representations (SR) for both, the agent achieves "passive generalization," allowing it to adapt to new maze layouts instantly by applying local rules of thumb learned in previous environments.

What Problem Does This Paper Address?

In spatial navigation, there is a classic dichotomy between allocentric representations (a "God’s eye view" or GPS-like map) and egocentric representations (a "point-of-view" perspective).

Historically, neuroscientists and AI researchers have favored allocentric maps for complex planning, relegating egocentric data to simple "stimulus-response" habits (e.g., "see a light, turn left"). However, allocentric maps are brittle; if you move the goal or change the walls, the entire map often needs to be relearned from scratch.

The authors argue that egocentric representations are actually powerful tools for generalization. A rule like "don't walk into the wall directly in front of me" is true regardless of where you are in a city. The challenge is: how do we mathematically compose these two different perspectives into a single, flexible navigational policy?

Methods

The authors build a Reinforcement Learning (RL) agent equipped with a "geometric module" that maintains two parallel Successor Representations (SR):

  1. Allocentric SR: Tracks the expected future occupancy of global $(x, y)$ coordinates.
  2. Egocentric SR: Tracks the expected future occupancy of local, self-centered views (e.g., what the agent sees in a small window around itself).

The SR is a predictive representation—it doesn't just store where the agent is, but where the agent is likely to be in the near future given its current policy.

The agent learns a state-action value function ($Q$-function) by linearly combining the features from both maps. Crucially, the authors use the ADAM optimizer to handle the fact that these two maps operate at different scales and densities. When the agent decides on an action, it translates its allocentric "intent" (e.g., "go North") into an egocentric "motor command" (e.g., "turn 90° and move forward") based on its current heading.

Datasets

The study uses a custom-designed 2D Gridworld environment:

  • The Maze: A 20x20 grid with colored walls and opaque, randomly oriented barriers.
  • The Task: The agent must find a reward (green box).
  • The Twist: Every 1,000 episodes, the entire environment—the barriers and the reward location—is completely reorganized.

This setup forces the agent to "learn to learn." While the global layout changes, the local "physics" (how barriers look and behave) remains consistent, making it the perfect testbed for egocentric generalization.

Key Insights and Ideas

  • Passive Generalization: This is the "aha" moment. Because the egocentric SR learns the relationship between local views and obstacles, the agent doesn't have to "relearn" that barriers are solid every time the world changes. It carries that knowledge over automatically.
  • Additive Composition: Surprisingly, the authors found that simply adding the values from the two maps together (a linear combination) was sufficient to produce sophisticated behavior. The allocentric map provides the "global gradient" toward the goal, while the egocentric map provides the "local corrections" to avoid obstacles.
  • Biological Mapping: The authors link these two systems to the brain's hippocampal formation. They suggest the Medial Entorhinal Cortex (MEC) handles the allocentric, grid-like mapping, while the Lateral Entorhinal Cortex (LEC) handles the egocentric, associative structure.

Key Results

  • Faster Adaptation: The "full" agent (Egocentric + Allocentric) significantly outperformed "lesioned" agents (Allocentric only). After an environment switch, the full agent relearned the path to the goal much faster.
  • Obstacle Avoidance: The egocentric component acted as a persistent "safety layer." Even in brand-new environments, the full agent spent far less time "trapped" or bumping into barriers compared to the allocentric-only agent, which had to rediscover the obstacles in their new locations.
  • Value Function Clarity: Visualizing the value functions showed that the allocentric component learned a smooth gradient toward the goal, while the egocentric component learned to "subtract" value from states that led into walls, effectively carving out a safe path through the maze.

Limitations and Future Work

The current model relies on a linear combination of features. While effective for this 2D grid, more complex, high-dimensional environments (like 3D photorealistic sims) would likely require non-linear integration via deep neural networks.

Additionally, the authors suggest that "egocentric" is just one type of alternative reference frame. Future work could explore object-centered maps (e.g., "relative to the blue pedestal") or even social reference frames, further modularizing how AI agents—and perhaps humans—factorize the complex world into simple, reusable maps.

Summary updated

BibTeX
@article{shani2026composing,
  author = {Daniel Shani and Peter Dayan},
  title = {{Composing egocentric and allocentric maps for flexible navigation}},
  journal = {PLOS Computational Biology},
  year = {2026},
  doi = {10.1371/journal.pcbi.1013905},
}
Figure