ELMUR: External Layer Memory with Update/Rewrite for Long-Horizon RL
Egor Cherepanov, Alexey K. Kovalev, Aleksandr I. Panov
TL;DR
ELMUR tackles long-horizon, partially observable decision-making by extending transformers with layer-local external memory and a principled memory-update mechanism. Each layer includes a memory track that interacts with the token track via mem2tok and tok2mem cross-attention, and memory content is refreshed through an LRU policy with convex blending, enabling recurrence across segments and extending retention horizons by up to $100{,}000\times$ the native attention window. Theoretical results establish exponential forgetting bounds and memory boundedness, linking the blending factor $\lambda$, memory slots $M$, and segment length $L$ to retention horizons and stability. Empirically, ELMUR achieves perfect retention on the synthetic T-Maze with corridors up to one million steps, substantially improves robotic memory tasks, and attains top performance on a large POPGym suite, demonstrating robust generalization under partial observability. Together, these findings position structured, layer-local external memory as a simple yet scalable solution for reliable long-horizon decision making in sequential control and imitation-learning contexts, with practical implications for real-world robotic systems.
Abstract
Real-world robotic agents must act under partial observability and long horizons, where key cues may appear long before they affect decision making. However, most modern approaches rely solely on instantaneous information, without incorporating insights from the past. Standard recurrent or transformer models struggle with retaining and leveraging long-term dependencies: context windows truncate history, while naive memory extensions fail under scale and sparsity. We propose ELMUR (External Layer Memory with Update/Rewrite), a transformer architecture with structured external memory. Each layer maintains memory embeddings, interacts with them via bidirectional cross-attention, and updates them through an Least Recently Used (LRU) memory module using replacement or convex blending. ELMUR extends effective horizons up to 100,000 times beyond the attention window and achieves a 100% success rate on a synthetic T-Maze task with corridors up to one million steps. In POPGym, it outperforms baselines on more than half of the tasks. On MIKASA-Robo sparse-reward manipulation tasks with visual observations, it nearly doubles the performance of strong baselines. These results demonstrate that structured, layer-local external memory offers a simple and scalable approach to decision making under partial observability.
