Training Agents using Upside-Down Reinforcement Learning

Rupesh Kumar Srivastava, Pranav Shyam, Filipe Mutz, Wojciech Jaskowski, Jürgen SchmidhuberarXiv 2019

Introduction

Traditional Reinforcement Learning (RL) typically relies on temporal-difference (TD) learning and bootstrapping—predicting future rewards based on current estimates. While powerful, these methods often suffer from the "deadly triad": instabilities arising from the combination of off-policy learning, non-linear function approximation, and bootstrapping. Furthermore, RL agents usually receive "evaluation signals" (how good an action was) rather than the "error signals" (what the correct action was) used in Supervised Learning (SL). Upside-Down Reinforcement Learning (UDRL) addresses these challenges by reframing RL entirely as a supervised learning problem.

The UDRL Framework

The core innovation of UDRL is to flip the standard RL framework. Instead of predicting rewards for actions, the agent is trained to follow specific commands.

The Behavior Function

UDRL replaces the traditional Q-function with a Behavior Function ($B$). This function takes the current observation and a command—consisting of a desired return ($d^r$) and a desired horizon ($d^h$)—as input. The output is a probability distribution over actions.

Comparison of the traditional Q-value function and the UDRL Behavior Function.

Hindsight Learning

Training is conducted via hindsight. The agent stores all experiences in a replay buffer. To train, it samples a past trajectory and treats it as a successful example of reaching a specific reward target. For any state in that trajectory, the agent knows exactly what return was achieved and how many steps it took. This allows the creation of supervised training pairs: Input(state, achieved return, remaining steps) -> Target(action taken).

Example of how states and commands (desired return and horizon) are mapped to actions in the training data.

Key Insights and Advantages

  • Stability via Supervised Learning: By avoiding TD-learning and bootstrapping, UDRL bypasses the mathematical instabilities of the deadly triad, optimizing a standard supervised learning objective.
  • Inherent Credit Assignment: By conditioning actions on the total future return, the model naturally learns which actions lead to high-reward outcomes without requiring complex reward-shaping.
  • Controllability: A UDRL agent is a "command-follower." Unlike standard RL agents that always maximize reward, a trained UDRL agent can be commanded to achieve specific low or high rewards, demonstrating a high degree of behavioral control.

Experimental Results

UDRL was evaluated on several OpenAI Gym benchmarks, including LunarLander-v2 and visual tasks like TakeCover-v0.

  • Competitive Performance: UDRL performed comparably to DQN on standard tasks and significantly outperformed both A2C and DQN on visual tasks, which often showed high volatility.
  • Robustness to Sparse Rewards: UDRL excels in environments where rewards are sparse or delayed. In variants where rewards are only given at the final step, traditional algorithms like PPO often fail. UDRL maintains performance because its hindsight-based assignment is indifferent to the timing of the reward.
  • Command Correlation: Experiments showed a strong correlation ($R \approx 0.98$) between the requested reward and the actual reward obtained, confirming the agent's ability to interpret and follow commands.

Limitations and Future Directions

While promising, UDRL faces challenges in highly stochastic environments where "lucky" outcomes might mislead hindsight learning. Current exploration relies on simple heuristics, such as sampling commands from the top of the replay buffer; more sophisticated strategies could improve efficiency. Additionally, scaling to partially observable tasks will likely require integrating recurrent architectures like LSTMs to handle state history.

Summary updated

BibTeX
@misc{srivastava2019training,
  author = {Rupesh Kumar Srivastava and Pranav Shyam and Filipe Mutz and Wojciech Jaskowski and Jürgen Schmidhuber},
  title = {{Training Agents using Upside-Down Reinforcement Learning}},
  year = {2019},
  eprint = {1912.02877},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.02877},
}
Figure