Partially Observable Reinforcement Learning with Memory Traces

Onno Eberhard, Michael Muehlebach, Claire Vernade

Abstract

In partially observable reinforcement learning (POMDPs), agents must maintain history to make optimal decisions. While frame stacking is a common heuristic, it suffers from exponential complexity as history length increases. This paper proposes memory traces—compact, exponential moving averages of observations—as a mathematically rigorous and efficient alternative. We prove that memory traces are injective representations of history and demonstrate their superior sample efficiency in long-horizon tasks like the T-maze.

Introduction

Most reinforcement learning (RL) algorithms rely on the Markov property, assuming the current observation provides sufficient state information. However, real-world environments are often partially observable, requiring agents to remember past events. The standard deep RL solution, frame stacking, concatenates the last $m$ observations. This approach faces a "curse of dimensionality": as $m$ grows, the space of possible histories explodes, making learning intractable. While Recurrent Neural Networks (RNNs) offer a solution, their theoretical properties are difficult to analyze. This work introduces memory traces as a middle ground that is both powerful and theoretically tractable.

Methods: Memory Traces

Memory traces ($z_t$) are inspired by eligibility traces. Instead of storing a discrete window of past frames, the agent maintains a running average updated at each step: $$z_t = \lambda z_{t-1} + (1 - \lambda)y_t$$ where $y_t$ is the current observation and $\lambda \in [0, 1)$ is a forgetting factor.

Memory update rule and trajectory in a T-maze environment.

Theoretical Contributions

  1. Injectivity: The authors prove that for most rational values of $\lambda$, the memory trace $z_t$ uniquely represents the entire history of observations, ensuring no information is lost during compression.
  2. Fractal Geometry: The space of memory traces forms fractal patterns, such as Sierpiński triangles. The complexity of learning over these traces can be quantified using the Minkowski dimension of these fractals.
  3. Sample Complexity: Using metric entropy, the paper proves that for "slow forgetting" ($\lambda \ge 0.5$), memory traces can be exponentially more efficient than window-based methods.

Key Insights: The Geometry of Memory

A core insight of this work is that memory can be viewed as a position in a high-dimensional fractal space. By treating memory as a continuous feature, the agent can leverage Lipschitz continuity to bound how history changes affect value estimates.

Fractal patterns of memory traces for different forgetting factors (\lambda).

In environments like the T-maze, a window-based agent must observe the entire corridor to retain the initial hint, leading to a massive input space. Conversely, a memory trace agent with a high $\lambda$ (e.g., 0.99) keeps the initial signal "alive" throughout the trajectory, requiring significantly fewer samples to learn the correct association.

Experimental Results

The approach was evaluated on two primary benchmarks:

  • T-Maze (Minigrid): An agent must remember a hint from the start of a corridor to choose the correct exit. Memory traces solved corridor lengths up to 1024 steps, where frame stacking failed due to dimensionality.
  • Sutton’s Noisy Random Walk: In this 1001-state task with noisy observations, memory traces acted as a low-pass filter, effectively averaging out noise that overwhelmed windowed agents.

Integration with Proximal Policy Optimization (PPO) showed that memory traces are a "plug-and-play" replacement for frame stacking, significantly improving performance in long-horizon tasks.

Conclusion

Memory traces provide a robust, theoretically grounded alternative to frame stacking for POMDPs. By compressing history into a continuous fractal space, they avoid the combinatorial explosion of discrete windows while maintaining information integrity. Future work includes exploring dynamic $\lambda$ adaptation and multi-scale traces to handle varying temporal dependencies.

Summary updated

BibTeX
@inproceedings{eberhard2025partially,
  author = {Onno Eberhard and Michael Muehlebach and Claire Vernade},
  title = {{Partially Observable Reinforcement Learning with Memory Traces}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=c4zVRwxjDD},
}
Figure