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.
Figures & tables
Fig. 1 : (a) The Unitree Go2 autonomously explores a previously unseen 5×5m 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.
Fig. 2 : Actor architecture with the proposed LSMM memory module. Both branches share zth and otp , while the memory branch additionally uses noisy position and velocity estimates p^t and v^t to update the matrix memory Lt . A CNN then extracts ztm from Lt and an auxiliary MLP predicts the maze wall layout y^t . The actor maps ztm and its observation ot to μt and σt , from which at is sampled.
Fig. 3 : Percentage of explored cells at the end of an episode. Bars show the mean over 100 unseen evaluation mazes and three seeds per architecture, whiskers the standard deviation. All architectures reach a comparable coverage.
Fig. 4 : Average number of visits per maze cell across all evaluation episodes. DKL(p∥u) measures the divergence between the normalized visit distribution p and a uniform distribution u , where lower values mean more even exploration. LSMM spreads its visits most evenly over mazes.
Fig. 5 : Maze reconstruction error over the course of an episode. Lines show the mean over 100 unseen evaluation mazes and three seeds, shaded areas the standard deviation. LSMM is the only architecture that significantly reduces the error while exploring.
Fig. 6 : Predicted maze layout at three times during an evaluation episode. The trajectory walked up to each time is overlaid, colored from black to orange by trajectory time. The prediction of LSMM fills in wall by wall as the robot explores and closely matches the ground truth at the end of the episode, while the baselines struggle to remember the walls in the areas they have been before.
Fig. 7 : Maze reconstruction error of LSMM for memory sizes of 50×50×C with C∈{1,2,3,5,10} channels. Lines show the mean over 100 unseen evaluation mazes and three seeds, shaded areas the standard deviation. All memory sizes perform comparably.
Fig. 8 : Auxiliary prediction of spatially varying environment properties. Bars show the normalized mean absolute error over all visited cells at the final time step.
Fig. 9 : Time spent in each cell by our deployed LSMM policy. Compared to the simulation results, this deployment run distributes its visits less uniformly and follows a more repetitive pattern, which is also visible in the matrix memory in Figure 1 (b).
Fig. 10 : Maze reconstruction error over deployment time of our LSMM policy. The line shows the reconstruction error of the deployment run shown in Figure 1 . The policy reduces the error significantly within the first 30s .
Hyperparameter
Value
Training steps
2.5⋅109
Batch size (envs × steps per env)
5000×20=100000
Minibatch size / updates per batch
25000 / 5
Discount factor γ / GAE λ
0.995 / 0.9
Clipping range
0.2
Entropy coef. (linearly annealed)
4⋅10−4→10−4
TABLE I : Hyperparameters used in all experiments.
Reward
Term
Coeff.
Task
Cell visit (E)
exp(−ncell/200)
0.16
Maze coverage (E)
fraction of visited cells
0.1
Goal direction (G)
21(1+cos(vxy,gt))min(∥vxy∥,1)
0.04
Goal reached (G)
\mathds1[dgoal<0.25]
0.0625
Navigation shaping
TABLE II : Reward terms and coefficients, with [x]+=max(x,0) and ⋅ the mean over joints. E/G: exploration/goal episodes only; ncell : steps in the current cell; δi : offset from the cell center toward walled side i ; npairsair : leg pairs with both feet airborne; tair : foot air time.