arXiv:2610.37203cs.ROOct 2026

Manuscript Offprint

arXiv:2610.37203

Remember Where You Walk: Learning Spatial Memory for End-to-End Legged Robot Exploration

Leon Magnus, Nico Bohlinger, Jan Peters, Oleg Arenz

Leon Magnus ∗^{*},¹, Nico Bohlinger ∗^{*},¹, Jan Peters 1,2,3,4^{1,2,3,4}, Oleg Arenz 1^{1}

Abstract—Humanoids and other legged robots operating in complex environments must remember information that leaves their field of view and only becomes relevant much later. Reinforcement learning policies address this using memory networks such as LSTMs that are trained end-to-end with the policy to memorize such task-relevant aspects. Yet, such architectures often fail to preserve sufficient information over long horizons. In this work, we propose a network architecture based on Hadamard memory that specifically targets robot navigation. Our Local Spatial Matrix Memory (LSMM) enables RL agents to store generic task-relevant information at specific, position-based memory cells, enabling flexible and spatially grounded memorization. We evaluate LSMM on the task of autonomous maze exploration, where it matches the maze coverage of strong recurrent and finite-history baselines while being the only architecture that remembers the maze layout, reducing the reconstruction error threefold. We provide videos and code for our experiments at: https://leonmgns.github.io/RememberWhereYouWalkWebiste/

I. INTRODUCTION

Thanks to breakthroughs in Deep Reinforcement Learning (DRL), legged robots can now traverse rough terrain, jump over obstacles, and navigate toward goal positions using policies trained in highly-parallelized simulations or directly in the real world [1], [2], [3], [4], [5]. These policies usually follow velocity commands or short-horizon waypoints [6], [7], leaving the higher level planning to a human operator and making the system not fully autonomous. Autonomous exploration of an unknown environment is a fundamentally different problem. Now, the robot must not only reason and control its body in a local frame, but also decide where to go and remember where it has already been, to navigate and explore efficiently [8]. This turns locomotion into a long-horizon partially observable navigation problem in which the current local observation is not enough [9].

Memory-augmented policies address this problem by leveraging an observation-action history with architectures such as Long Short-Term Memories (LSTMs) [10], Gated Recurrent Units (GRUs) [11], Transformers [12], or simply concatenating history for an Multilayer Perceptron (MLP) [13]. However, unstructured recurrent states, through LSTMs or GRUs, easily mix or overwrite spatially distinct information, as credit-assignment is tricky, and finite-context

Figure

Fig. 1: (a) The Unitree Go2 autonomously explores a previously unseen 5×55 \times 5 m outdoor maze. The red line shows the walked path. (b) The matrix memory at the end of the run. The policy has written into the cells along its path, shown with the three memory channels interpreted as RGB colors, while unwritten cells keep their initial value in gray. (c) and (d) Shows the robot navigating through the maze.

approaches, like Transformers or concatenation, discard old observations in less than a second with the typical history lengths [13], [14]. Classical navigation systems avoid this problem by explicitly registering and using observations in spatial maps, but typically separate mapping, planning, and locomotion into individual components, losing out on potential end-to-end efficiency [15], [16], [17].

In this work, we introduce LSMM and evaluate it for end-to-end maze exploration. The layout of our matrix memory is aligned with the environment's frame and indexed using a position estimate. At every step, the policy modifies only a small window in the memory around the robot's position through learned calibration and update matrices, while the rest of the memory is not updated. A Convolutional Neural Network (CNN) [18] encoder transforms the spatial memory into features used by both the policy and an auxiliary maze-reconstruction head. This combines the information persistence of index-based updates and the locality of map-based navigation with learned latent representations and end-to-end locomotion control, without any explicit path planning or waypoint commands.

We formulate long-horizon, goal-free maze exploration as an end-to-end locomotion problem. We train our method for the Unitree Go2 quadruped in procedurally generated mazes and compare LSMM against unstructured recurrent and

This project was funded by National Science Centre Poland in the Weave programme UMO-2021/43/I/ST6/02711, by the German Science Foundation (DFG) under grant number PE 2315/17-1 and by the European Union's Horizon Europe research and innovation programme (Grant agreement ID: 101298421). This project has been supported by a hardware donation by NVIDIA through the Academic Grant Program. * Equal contribution. 1^{1} Technical University of Darmstadt, Germany. 2^{2} Robotics Institute Germany (RIG). 3^{3} German Research Center for AI (DFKI). 4^{4} hessian.AI

© 2026 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.

finite-history architectures. Our experiments provide comprehensive empirical evaluations in simulation and deployment in the real-world, demonstrating LSMM's capabilities on maze reconstruction, exploration efficiency, robustness to localization noise, and generalization to unseen mazes.

References (31)