Learning Retrospective Knowledge with Reverse Reinforcement Learning

Shangtong Zhang, Vivek Veeriah, Shimon Whiteson

Introduction

In standard Reinforcement Learning (RL), the primary focus is on predictive knowledge: answering questions like, "If I take this action, what reward will I get in the future?" General Value Functions (GVFs) are the standard tool for this, calculating expected future outcomes.

However, many real-world scenarios require retrospective knowledge: "How much energy have I consumed since my last recharge?" or "How did I get to this state?" While one could answer this by storing a massive log of every action ever taken, that approach is memory-intensive and impractical for embedded systems like microdrones or satellites. Standard GVFs struggle here because they are designed to ignore the past and focus exclusively on the future.

This paper introduces Reverse Reinforcement Learning (Reverse RL), a framework for learning retrospective knowledge. By bootstrapping in the reverse direction, the authors enable agents to maintain a memory-efficient "summary" of their history. This proves highly effective for real-time anomaly detection and significantly improves representation learning in complex tasks like Atari games.

Methods: The Reverse General Value Function

The core innovation of this paper is the Reverse General Value Function (Reverse GVF), which adapts the mathematical foundation of RL to look backward.

  1. Reverse Return ($\bar{G}_t$): Instead of summing future rewards, the authors define a return that accumulates past rewards. They use a "reverse discount factor" that allows the agent to "forget" events that happened before a specific milestone (such as a battery recharge).
  2. Reverse TD Learning: The authors derive a "Reverse Temporal Difference" update. While standard TD updates a state's value based on the next state, Reverse TD updates it based on the previous state. They provide theoretical proofs that this converges to a unique fixed point under linear function approximation.
  3. Distributional Reverse RL: To handle uncertainty, the framework is extended to learn the entire distribution of past events rather than just the average. This is crucial for anomaly detection; if the current state of the world is a 1-in-1,000,000 event according to the learned distribution, the agent can confidently flag an anomaly.
  4. Off-Policy Learning: The authors develop versions of the algorithm that can learn about one policy (e.g., "how much fuel would I have used if I were driving efficiently?") while actually following a different, perhaps more exploratory, behavior policy.

Key Insights

  • Bootstrapping Works Both Ways: The Bellman equation has a symmetrical reverse form. Agents can "predict the past" just as effectively as they predict the future.
  • Memory Efficiency: Retrospective knowledge provides a compressed history. An agent only needs to store its current estimate and update it at each step, requiring constant memory regardless of how long the mission lasts.
  • Inductive Bias for Learning: Learning about the past serves as an excellent auxiliary task. By forcing a neural network to understand how it reached its current state, the network develops a richer understanding of the environment, inadvertently making it better at its primary goal of maximizing future rewards.

Experimental Results

The authors evaluated their approach across three distinct environments: a Microdrone Toy MDP for validating basic theory, a continuous control Reacher task for anomaly detection, and a suite of Atari games for representation learning.

Convergence

The authors empirically confirmed that Reverse TD converges quickly and reliably across different settings and hyperparameter choices.

Mean Value Error (MVE) against training steps for different values of lambda, demonstrating the convergence of Reverse TD.

Anomaly Detection

In the Reacher environment, the Distributional Reverse RL agent successfully flagged anomalies (like simulated engine malfunctions or navigation errors) by identifying when the observed "past" deviated significantly from the learned expectation.

Atari Performance

Adding Reverse GVFs as auxiliary tasks to the IMPALA architecture resulted in a noticeable performance boost in 7 out of 10 tested Atari games. In some games, like Berzerk and Centipede, the improvement was substantial compared to standard baselines.

Performance improvement of IMPALA+ReverseGVF over the IMPALA+GVF baseline across various Atari games.

Limitations and Future Work

While Reverse RL offers a powerful new tool for representation learning, it comes with a few limitations:

  • Density Ratio Sensitivity: The off-policy version of the algorithm relies on density ratios to compare target and behavior policies. If these ratios are estimated poorly, learning can become unstable.
  • High Variance: In highly stochastic environments, the "past" can be very noisy. This can lead to false positives in anomaly detection, where the agent assumes a malfunction simply because it experienced an unlikely sequence of random transitions.

While the paper provides a strong proof-of-concept in simulations, testing on real-world sensor data and applying these ideas to fields like web page ranking remain logical and exciting next steps.

Summary updated

BibTeX
@inproceedings{zhang2020learning,
  author = {Shangtong Zhang and Vivek Veeriah and Shimon Whiteson},
  title = {{Learning Retrospective Knowledge with Reverse Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=rHx-QtHSrx5},
}
Figure