Deep Hierarchical Planning from Pixels

Danijar Hafner, Kuang-Huei Lee, Ian Fischer, Pieter Abbeel

Overview

Standard reinforcement learning (RL) agents often struggle with "long-horizon" tasks—problems that require thousands or millions of low-level motor commands to achieve a single high-level objective. While humans naturally break complex tasks down into manageable subgoals, artificial intelligence typically reasons at the "clock rate" of primitive actions.

Previous attempts at Hierarchical Reinforcement Learning (HRL) have tried to address this by using manually specified goal spaces (such as providing the agent with its exact XY coordinates) or pre-defined subtasks. However, these methods rely heavily on domain-specific engineering. Director is a novel HRL agent designed to overcome these limitations. It learns to solve long-horizon, sparse-reward tasks directly from raw pixels by autonomously breaking complex problems into interpretable visual subgoals, without relying on privileged global information.

The Director Architecture

Director builds upon the Recurrent State Space Model (RSSM), a world model that learns to predict future latent states from past observations and actions. The architecture operates using a "manager-worker" paradigm and consists of four primary components:

  1. World Model: Learns a compact, 1024-dimensional latent representation of the environment directly from pixel inputs.
  2. Goal Autoencoder: This component is crucial to Director's success. It compresses the high-dimensional latent states into a compact space of discrete codes. By discretizing the latent goals, the "action space" for the high-level manager becomes significantly easier to learn.
  3. Manager Policy: Operating at a lower frequency (e.g., every 8 steps), the manager selects a discrete goal code. This code is then decoded back into a continuous latent feature vector.
  4. Worker Policy: The low-level worker receives the current state and the manager's decoded latent goal. It is trained to maximize a max-cosine similarity reward, which incentivizes the worker to move the agent's state toward the manager's target in the latent space.

Key Insights and Mechanisms

Director introduces several conceptual advantages over standard flat RL methods:

  • Tractable Planning via Discretization: By forcing the manager to choose goals from a discrete code space, Director avoids the "curse of dimensionality" inherent in continuous latent spaces, making high-level planning computationally tractable.
  • Visual Interpretability: Because Director utilizes a generative world model, researchers can decode the manager's latent goals back into images. This allows us to visually inspect what the agent is "thinking." For instance, in a maze navigation task, the manager might visualize a specific colored wall as its next milestone.
  • Temporally-Extended Exploration: The manager receives intrinsic rewards for selecting "novel" goals—states that the world model has not yet mastered. This drives much more efficient, directed exploration compared to flat policies that rely on step-by-step random jitter.
  • Decoupled Learning: The worker policy does not strictly need the external task reward; its primary objective is simply to follow the manager's subgoals. This separation of concerns allows the hierarchical system to solve tasks where environmental rewards are extremely sparse.

Experimental Benchmarks and Results

The researchers evaluated Director on a mix of standard RL suites (Atari 55, DeepMind Control Suite, DMLab, Crafter) and newly designed, highly challenging benchmarks:

  • Egocentric Ant Maze: A quadruped robot must navigate a 3D maze using only a first-person camera and proprioception, lacking the global GPS or top-down views used in prior work. Director successfully solved the massive "Ant Maze L" and "XL" benchmarks. Flat baselines like DreamerV2 and Plan2Explore failed to make any progress on these larger mazes due to the extreme sparsity of rewards.
  • Visual Pin Pads: A logic task requiring the agent to activate colored pads in a specific sequence. Director mastered sequences of up to 6 pads, whereas flat exploration methods struggled to progress past sequences of 4.
  • General Applicability: Director is not limited to navigation tasks. It achieved a higher human-normalized median score on 55 Atari games than the state-of-the-art DreamerV2, demonstrating that its hierarchical structure does not hinder performance even in reactive, short-horizon environments.

Limitations and Future Work

While Director represents a significant step forward for HRL from pixels, it has a few notable limitations. Currently, the manager operates on fixed time steps, picking a new goal every 8 steps. In reality, some subgoals naturally take longer to achieve than others; future iterations could benefit from a dynamic "commitment" mechanism where the manager waits until a goal is reached before issuing a new one.

Additionally, the manager currently treats its actions as abstract tokens, unaware that they correspond to specific environment states. Integrating this structural knowledge could further accelerate learning. Finally, scaling Director's two-level hierarchy to three or more levels could unlock the ability to solve even more massive, multi-stage problems in the future.

Summary updated

BibTeX
@inproceedings{hafner2022deep,
  author = {Danijar Hafner and Kuang-Huei Lee and Ian Fischer and Pieter Abbeel},
  title = {{Deep Hierarchical Planning from Pixels}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=Ge1dH1qd6cH},
}
Figure