Planning from Pixels using Inverse Dynamics Models

Keiran Paster, Sheila A. McIlraith, Jimmy Ba

Introduction

In model-based reinforcement learning (RL), an agent typically learns a "world model" to predict how the environment changes in response to its actions. However, learning these models directly from high-dimensional pixel data is notoriously difficult due to the planning horizon dilemma: small errors in predicting the next state accumulate over time, leading to "hallucinations" during long-term planning. Furthermore, standard world models often waste capacity trying to model every pixel—including task-irrelevant details like moving clouds or background flicker.

This paper asks: Instead of predicting what the world will look like, can we just predict the actions needed to get to a desired state? To answer this, the authors introduce GLAMOR (Goal-conditioned Latent Action MOdels for RL). GLAMOR shifts the focus of world models from predicting future pixels to predicting the sequences of actions required to reach a specific visual goal. By leveraging inverse dynamics, the agent ignores task-irrelevant visual noise and achieves state-of-the-art sample efficiency on challenging vision-based RL benchmarks.

Methods: GLAMOR

GLAMOR models the relationship between states and actions using inverse dynamics. Instead of a traditional forward model that predicts the next state given a current state and action, GLAMOR learns two distinct components:

  1. Inverse Dynamics Model: Predicts the action sequence likely to bridge the gap between the current state and the goal.
  2. Action Prior: Represents the likelihood of taking those actions regardless of the goal.

Planning is performed by maximizing the ratio between these two models. Intuitively, the agent looks for action sequences that are much more likely to occur when a specific goal is intended than they would be by chance.

GLAMOR Architecture

As shown in the architecture diagram, the system uses ResNet encoders to process raw pixel observations (both the current state and the goal) into latent features. These features are then fed into an LSTM to generate or evaluate variable-length action sequences, concluding with a "STOP" token when the goal is reached. At test time, the agent samples candidate action sequences via random shooting and uses the learned models to select the one with the highest probability of reaching the goal.

Key Insights

  • Focus on Controllability: By training on inverse dynamics, the model naturally ignores environmental features it cannot control. If a background element changes but no action can influence it, the inverse model doesn't need to represent it to predict the correct actions.
  • Hindsight is 20/20: The model is trained using a technique similar to Hindsight Experience Replay. Any trajectory the agent takes—even a failing one—is a "success" for the specific state it actually ended up in, providing a rich source of self-supervised training data.
  • Variable Horizons: Unlike many models that plan for a fixed number of steps, GLAMOR uses "end-of-sequence" tokens, allowing it to plan for the shortest path to a goal and terminate episodes early once a goal is reached.

Evaluation and Results

The method was evaluated on two major suites of visual RL problems: 14 diverse Atari games (e.g., Pong, Breakout) and 7 continuous control tasks from the DeepMind Control Suite (discretized for action prediction). All observations were grayscale, down-scaled pixels, requiring the agent to learn directly from raw vision.

Performance on Atari and Control Suites

GLAMOR demonstrated superior performance and remarkable sample efficiency. It outperformed prior state-of-the-art goal-conditioned methods like DISCERN and GCSL in 17 out of 21 tasks. In the "low-data" regime (e.g., 500k environment steps), GLAMOR showed a massive lead. For instance, in the DeepMind Control Suite, GLAMOR often converged while baselines like DISCERN had barely begun to learn. Furthermore, the agent successfully learned to control complex entities even when it couldn't perfectly match the visual orientation of the goal, demonstrating a focus on functional success over pixel-perfect imitation.

Limitations and Future Work

  • Open-Loop Planning: The current planner generates a sequence of actions and follows them (open-loop). While it can re-plan, it may struggle in highly stochastic environments where the world changes unexpectedly mid-sequence.
  • Goal-Only Rewards: The framework is currently designed for "indicator" rewards (i.e., reaching a goal state). Extending this to general, scalar reward functions (like maximizing a score) is a noted next step.
  • Discrete Action Bias: While tested on control tasks, the continuous action spaces were discretized. Future iterations could explore fully continuous action densities.

Summary updated

BibTeX
@inproceedings{paster2021planning,
  author = {Keiran Paster and Sheila A. McIlraith and Jimmy Ba},
  title = {{Planning from Pixels using Inverse Dynamics Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=V6BjBgku7Ro},
}
Figure