Abstract: Intelligent agents need to select long sequences of actions to solve complex tasks. While humans easily break down tasks into subgoals and reach them through millions of muscle commands, current artificial intelligence is limited to tasks with horizons of a few hundred decisions, despite large compute budgets. Research on hierarchical reinforcement learning aims to overcome this limitation but has proven to be challenging, current methods rely on manually specified goal spaces or subtasks, and no general solution exists. We introduce Director, a practical method for learning hierarchical behaviors directly from pixels by planning inside the latent space of a learned world model. The high-level policy maximizes task and exploration rewards by selecting latent goals and the low-level policy learns to achieve the goals. Despite operating in latent space, the decisions are interpretable because the world model can decode goals into images for visualization. Director outperforms exploration methods on tasks with sparse rewards, including 3D maze traversal with a quadruped robot from an egocentric camera and proprioception, without access to the global position or top-down view that was used by prior work. Director also learns successful behaviors across a wide range of environments, including visual control, Atari games, and DMLab levels.
Introduction
Reinforcement learning (RL) has achieved remarkable success in domains with relatively short decision horizons, such as Atari games or Go. However, when tasks require millions of low-level actions to achieve a single reward—akin to a robot navigating a complex city—standard "flat" RL agents often fail. The primary challenge lies in the sheer scale of the decision space and the sparsity of rewards.
Hierarchical Reinforcement Learning (HRL) offers a solution by decomposing complex tasks into manageable subgoals. Historically, HRL has relied on human-engineered goal spaces or manually defined subtasks. Director addresses this limitation by automatically learning hierarchies directly from raw pixels, planning within the latent space of a learned world model without requiring domain-specific knowledge.
The Director Architecture
Director builds upon the World Model framework (specifically DreamerV2), utilizing an internal "mental model" to predict future states. The architecture introduces three key components to enable hierarchical planning:
- Goal Autoencoder: To stabilize the goal-setting process, Director compresses the high-dimensional latent states of the world model into a compact set of discrete codes. This transforms the Manager's task from searching a continuous space into selecting from a discrete "menu" of potential subgoals.
- The Manager: Operating at a lower temporal frequency (every $K=8$ steps), the Manager selects a discrete code as a subgoal. It is incentivized by both the external task reward and an internal exploration reward, encouraging it to select goals that lead to novel, unvisited regions of the environment.
- The Worker: The Worker receives the Manager's goal, decoded back into the world model's latent space. It then selects primitive actions to reach that state. Training is facilitated by a novel max-cosine reward, which measures the alignment between the agent's current latent state and the target goal.
Empirical Results
Director was evaluated across a diverse range of benchmarks, most notably the Egocentric Ant Maze. In this task, a quadruped robot must navigate a 3D maze using only first-person visual input and proprioception, without access to global coordinates or top-down maps.
While state-of-the-art flat agents like DreamerV2 and exploration-focused agents like Plan2Explore failed to solve the maze, Director successfully navigated the environment by setting temporally-extended visual subgoals.
Beyond 3D navigation, Director demonstrated strong performance across the Atari 55 suite, achieving a higher human-normalized median score than DreamerV2. This suggests that hierarchical planning provides benefits even in environments where it is not strictly required for basic task completion.
Key Insights and Interpretability
A significant advantage of Director is its inherent interpretability. Because goals are selected within a generative world model, latent subgoals can be decoded back into human-readable images. This allows researchers to visualize the Manager's "intentions," such as imagining a specific wall or a reward object as a target for the Worker.
Furthermore, Director demonstrates that hierarchy does not necessarily come at the cost of performance on simpler tasks. By using discrete goal codes and top-down exploration, the agent maintains competitive performance on standard benchmarks while unlocking the ability to solve long-horizon, sparse-reward problems.
Conclusion and Future Work
Director represents a practical step toward general-purpose hierarchical agents that learn from pixels. While successful, the current implementation uses a fixed time step for the Manager and is limited to a two-level hierarchy. Future research may explore adaptive timing—allowing the Manager to intervene only when a goal is met or failed—and scaling the architecture to multiple levels of abstraction for even more complex, long-term planning.
Summary updated