Recall Traces: Backtracking Models for Efficient Reinforcement Learning

Anirudh Goyal, Philemon Brakel, William Fedus, Soumye Singhal, Timothy P. Lillicrap, Sergey Levine, Hugo Larochelle, Yoshua Bengio

Introduction

Reinforcement learning (RL) often struggles with "sparse rewards," a scenario where an agent wanders aimlessly because it rarely encounters a success signal. To address this, researchers have introduced Recall Traces, a novel method where a model learns to "backtrack" from high-value states to reconstruct the paths that led there. By training the agent to imitate these reconstructed trajectories, this approach significantly improves sample efficiency across complex navigation and locomotion tasks.

The Challenge of Sparse Rewards

In many RL environments, high-reward states are like needles in a haystack. Model-free algorithms, which learn purely by trial and error, require a massive number of interactions to stumble upon these rewards. While model-based methods (which try to predict the future) can help, they often struggle to reach the same peak performance as their model-free counterparts.

The core challenge is sample efficiency: how can an agent learn more from fewer interactions? When an agent finally finds a high-reward state, that specific trajectory is incredibly precious. However, standard RL often fails to fully exploit the underlying logic of how that state was reached. Instead of just looking forward from the starting point, the authors propose that the agent should learn to look backward from success.

Methodology: The Backtracking Model

To implement this backward-looking approach, the authors introduce a Backtracking Model ($B_\phi$). This model is trained to predict the preceding state and action given a current state, formulated as $q(s_t, a_t | s_{t+1})$.

Conceptual diagram illustrating forward trajectories from an initial state versus backward trajectories generated from a high-value state.

The process follows four main steps:

  1. Training the Backtracker: The model is trained using maximum likelihood on the top $k\%$ of the agent's experienced trajectories. It learns the reverse dynamics of the environment in an unsupervised way.
  2. Generating Recall Traces: The agent identifies high-value states, either from its replay buffer or via a goal-generator like GoalGAN. The backtracking model then "imagines" a sequence of previous states and actions that could have led to that goal, creating a "Recall Trace."
  3. Imitation Learning: The agent’s policy is updated to imitate these generated traces. This effectively "seeds" the agent's policy with successful behaviors, even if those specific paths weren't exactly what the agent executed in the real environment.
  4. Variational Interpretation: The authors provide a theoretical framework linking this to the "wake-sleep" algorithm, viewing the backtracking model as an approximate posterior over trajectories that lead to high rewards.

Experimental Setup and Key Results

The method was evaluated on several standard and custom RL benchmarks, including a Four-Room Grid World (testing sparse-reward navigation), MuJoCo Locomotion (continuous control tasks like Half-Cheetah, Ant, and Humanoid), and U-Maze Navigation.

Superior Sample Efficiency

In sparse reward settings, the "search space" starting from the goal and moving backward is often much smaller and more informative than searching forward from the start. This theoretical advantage translated to massive empirical gains.

Learning curves for the Four Room Experiment (Sizes 15 and 19) comparing the Backtracking Model to standard SAC.

In the complex 19x19 Four-Room environment, the baseline Actor-Critic (SAC) often failed to converge entirely, whereas the Recall Trace model succeeded consistently and rapidly.

Benchmark Dominance and Complexity Handling

On MuJoCo tasks, the backtracking-augmented versions of TRPO and SAC consistently learned faster and achieved higher final rewards than standard baselines. The largest gains were observed in the most difficult tasks, such as Humanoid and Ant locomotion, where rewards are particularly hard to coordinate.

Furthermore, Recall Traces outperformed Prioritized Experience Replay (PER). While PER simply replays old successful data, Recall Traces generate new variations of successful paths, leading to better exploration and more robust policies. By training the backtracker only on the best trajectories, the agent naturally creates a curriculum for itself; as the agent improves, the "high-value" states it backtracks from become increasingly sophisticated.

Limitations and Future Work

While powerful, the Recall Traces method has a few limitations:

  • Trace Length Sensitivity: Performance is sensitive to the length of the recalled traces. If traces are too long, the model's errors compound (drift); if they are too short, the learning signal is insufficient.
  • Model Accuracy: Like all model-based methods, if the backtracking model learns an incorrect representation of the environment's physics, it could provide misleading traces to the agent.
  • Future Directions: The authors suggest that future work could involve training forward and backward models jointly to share features and improve the accuracy of both. Additionally, more theoretical work is needed to understand the specific environmental conditions (e.g., determinism vs. stochasticity) where backtracking is most advantageous.

Summary updated

BibTeX
@inproceedings{goyal2019recall,
  author = {Anirudh Goyal and Philemon Brakel and William Fedus and Soumye Singhal and Timothy P. Lillicrap and Sergey Levine and Hugo Larochelle and Yoshua Bengio},
  title = {{Recall Traces: Backtracking Models for Efficient Reinforcement Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
  url = {https://openreview.net/forum?id=SfP_Gy8Sxc},
}
Figure