[Paper Review] Towards mental time travel: a hierarchical memory for reinforcement learning agents
This paper introduces Hierarchical Chunk Attention Memory (HCAM), a novel memory architecture for reinforcement learning agents that enables detailed, sparse recall of past events through hierarchical attention over temporally chunked memory. HCAM allows agents to mentally time-travel by first attending to coarse summaries of memory chunks and then focusing in detail on only the most relevant ones, significantly improving long-term retention, sample efficiency, and generalization—especially in tasks requiring reasoning over extended sequences or zero-shot transfer across episodes.
Reinforcement learning agents often forget details of the past, especially after delays or distractor tasks. Agents with common memory architectures struggle to recall and integrate across multiple timesteps of a past event, or even to recall the details of a single timestep that is followed by distractor tasks. To address these limitations, we propose a Hierarchical Chunk Attention Memory (HCAM), which helps agents to remember the past in detail. HCAM stores memories by dividing the past into chunks, and recalls by first performing high-level attention over coarse summaries of the chunks, and then performing detailed attention within only the most relevant chunks. An agent with HCAM can therefore "mentally time-travel" -- remember past events in detail without attending to all intervening events. We show that agents with HCAM substantially outperform agents with other memory architectures at tasks requiring long-term recall, retention, or reasoning over memory. These include recalling where an object is hidden in a 3D environment, rapidly learning to navigate efficiently in a new neighborhood, and rapidly learning and retaining new object names. Agents with HCAM can extrapolate to task sequences much longer than they were trained on, and can even generalize zero-shot from a meta-learning setting to maintaining knowledge across episodes. HCAM improves agent sample efficiency, generalization, and generality (by solving tasks that previously required specialized architectures). Our work is a step towards agents that can learn, interact, and adapt in complex and temporally-extended environments.
Motivation & Objective
- To address the limitations of existing memory architectures in retaining detailed episodic memories over long delays or distractor tasks.
- To enable reinforcement learning agents to perform sparse, detailed recall of past events—akin to human mental time travel—without interference from irrelevant intervening events.
- To improve sample efficiency, generalization, and robustness to hyperparameter variation in memory-augmented RL agents.
- To enable agents to extrapolate to task sequences orders of magnitude longer than seen during training.
- To support zero-shot generalization from meta-learning settings to maintaining knowledge across multiple episodes.
Proposed method
- HCAM divides the agent's past into fixed-length temporal chunks, storing each as a memory unit.
- During recall, HCAM first applies coarse-grained attention over chunk summaries to identify relevant memory chunks.
- It then performs fine-grained attention within only the most relevant chunks to retrieve detailed information.
- The architecture uses a two-level attention mechanism: high-level attention over chunk summaries, followed by low-level attention within selected chunks.
- HCAM is integrated into a reinforcement learning agent's policy network, enabling memory-augmented decision-making.
- The method is designed to be robust to hyperparameter variation and does not require end-to-end training of chunk boundaries.
Experimental results
Research questions
- RQ1Can a hierarchical memory architecture enable RL agents to recall detailed past events after long delays or distractor tasks?
- RQ2To what extent can HCAM improve sample efficiency and generalization in memory-intensive RL tasks?
- RQ3Can agents with HCAM extrapolate to task sequences significantly longer than those seen during training?
- RQ4Does HCAM enable zero-shot generalization from meta-learning to multi-episode memory retention?
- RQ5How does HCAM compare in robustness and performance to TransformerXL and LSTM-based memory architectures under hyperparameter variation?
Key findings
- HCAM agents achieved 80–90% performance on the hardest tasks (e.g., 8-dance, long delays) at 1.5 billion training steps, outperforming the best TrXL agents, which reached only 40–50% on the same tasks.
- 75% of HCAM agents outperformed the best TrXL agents on the hardest task, with a statistically significant difference (p = 0.001 and p = 0.01 for paired t-tests).
- HCAM agents maintained high performance on tasks with 20 distractors or 4 episodes with 1 distractor each, while TrXL agents showed no significant above-chance performance in replication experiments.
- 50% of HCAM agents achieved high training performance within 5 billion steps on rapid word learning tasks, compared to only 17% of TrXL agents.
- HCAM demonstrated superior robustness to hyperparameter variation, with consistent performance across learning rates and entropy weights, unlike TrXL, which showed high sensitivity.
- HCAM enabled agents to generalize zero-shot from meta-learning to multi-episode memory retention, a capability not achieved by prior architectures.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.