Lecture 15

Hierarchical RL

Temporal abstraction for long-horizon tasks: options framework, goal-conditioned hierarchies, and feudal networks.

Options Framework Temporal Abstraction Subgoals Hierarchical Policies
Original PDF slides

The Long-Horizon Challenge

Consider the everyday tasks that humans handle effortlessly: cooking a meal from scratch, driving across town, debugging a complex software system, or giving detailed feedback on a lengthy report. Each of these tasks involves hundreds or thousands of individual decisions, executed over extended time horizons. In the language of reinforcement learning, these are long-horizon tasks—problems where the agent must visit a very large number of states, make many sequential decisions, and navigate through a landscape full of pitfalls.

Three factors conspire to make long-horizon tasks especially challenging for standard RL and imitation learning methods:

  1. Enormous state spaces. The number of states visited during a long task grows rapidly. A flat policy must learn to map every possible state to the right action, and the space of possible trajectories becomes intractably large.
  2. Compounding errors. At every time step, there is an opportunity for the agent to make a mistake. Over hundreds of steps, even a small per-step error rate compounds into a high probability of overall failure. This is the same compounding-error phenomenon we encountered with behavioral cloning in earlier lectures.
  3. Getting stuck. Without structure, exploration in a flat action space is unlikely to stumble upon the precise sequence of actions needed to complete a multi-stage task. The agent can easily enter states from which it cannot recover.
Example
Baking a cheesecake. The high-level task "bake a cheesecake" decomposes naturally into a hierarchy of subtasks: buy ingredients, go to the store, walk to the door, take a step, contract a quad muscle. The top of the hierarchy is extremely hard to learn end-to-end, while the bottom is trivially easy. This suggests a powerful insight: can we break hard tasks into easier subtasks?

The Hierarchical Decomposition

The central idea of hierarchical reinforcement learning (HRL) is to decompose a difficult long-horizon task into a cascade of simpler sub-problems. Instead of a single monolithic policy that maps observations directly to low-level actions, we introduce at least two levels of decision-making:

Definition
Hierarchical Policy. A hierarchical policy consists of (at minimum) two components:
  • A high-level policy $\pi_{\text{HL}}$ that takes the current observation $\mathbf{o}_t$ and task description (e.g., a language prompt) and produces an intermediate goal $\mathbf{g}_t$.
  • A low-level policy $\pi_{\text{LL}}$ that takes the current observation $\mathbf{o}_t$ and the goal $\mathbf{g}_t$, and produces primitive actions $\mathbf{a}_t$ to accomplish that goal.
The low-level policy operates at a higher frequency than the high-level policy. More than two levels of hierarchy are possible.

The intermediate goals $\mathbf{g}_t$ go by many names in the literature: subgoals, subtasks, skills, options, or high-level actions. Regardless of terminology, they serve the same purpose—they provide a structured interface between the strategic, slow-thinking high level and the reactive, fast-acting low level.

Rolling Out a Hierarchical Policy
  1. Observe initial observation $\mathbf{o}_1$ at $t = 1$.
  2. Plan goal $\mathbf{g}_t$ according to $\pi_{\text{HL}}(\cdot \mid \mathbf{o}_t, \text{prompt})$.
  3. Until a new goal is selected:
    1. Execute predicted action $\mathbf{a}_t$ according to $\pi_{\text{LL}}(\cdot \mid \mathbf{o}_t, \mathbf{g}_t)$.
    2. $t \leftarrow t + 1$, observe new observation $\mathbf{o}_t$.
  4. Return to step 2 to select the next goal.

Why Hierarchy Helps

Hierarchy is not merely an architectural convenience—it provides several concrete advantages over flat policies:

  1. Supervision signal. The intermediate goals provide a supervision signal on how to complete the task, not just whether it was completed. The high-level policy decomposes the "what" while the low-level policy handles the "how."
  2. Knowledge sharing across subtasks. A low-level skill like "pick up object" can be reused across many different high-level tasks (making a sandwich, cleaning a room, packing a box). This compositionality dramatically improves sample efficiency.
  3. Structured exploration. In RL, the high-level policy explores in a much lower-dimensional goal space rather than the raw action space. Exploring over subgoals like "go to the kitchen" is far more efficient than exploring over individual joint torques.
  4. Computational efficiency. In robotics, low-level controllers often must run at 50 Hz or higher for stable control, while high-level planning can operate at 1-5 Hz. A hierarchical architecture naturally accommodates these different time scales, running expensive reasoning models infrequently and cheap reactive controllers at high frequency.

Hierarchy vs. Flat Policies vs. Chain of Thought

It is worth asking: do we really need separate policies? There are three architectural paradigms to consider:

The chain-of-thought approach can benefit from the same supervision signal as hierarchy. However, it may be too computationally expensive for real-time control (e.g., at 50 Hz) since the model must produce both the reasoning and the action at every step. As of now, there is no conclusive empirical comparison between these paradigms, and this remains an active area of research.

Key Insight
If you train a hierarchical policy end-to-end with a completely latent (unconstrained) goal representation, the model will simply learn to ignore the hierarchy and collapse into a flat policy. The benefits of hierarchy come specifically from the structure imposed on the intermediate representation—think carefully about where the benefits are coming from!

Design Choice 1: Goal Representations

The choice of how to represent intermediate goals $\mathbf{g}_t$ is perhaps the most critical design decision in hierarchical RL. The best representation will often be domain-specific, but good goal representations share three key properties:

  1. Expressiveness. The representation must be able to communicate many different low-level behaviors. If the goal space is too restrictive, the high-level policy cannot express the full range of subtasks needed.
  2. Structure. Similar behaviors should map to similar goals. A well-structured goal space enables generalization—if the low-level policy can accomplish goal $\mathbf{g}$, it should also be able to accomplish nearby goals $\mathbf{g}'$.
  3. Appropriate level of abstraction. Goals should not be so abstract that the low-level policy cannot interpret them, nor so concrete that the high-level policy has to micromanage. The right abstraction level depends on the capabilities of both policies.

Common goal representations used in practice include:

Example
Choosing goals for different tasks. Consider a robot that cooks Italian dishes: language goals like "chop the tomatoes" and "boil the pasta" are natural and expressive. For a bicycle navigation agent, goal states representing target GPS coordinates are more appropriate. For a legal brief-drafting system, language goals describing each section would work well. The right representation depends on the domain.

Design Choice 2: Supervising Each Level

A hierarchical policy introduces a chicken-and-egg problem for training. The low-level policy and the high-level policy depend on each other:

In practice, several strategies address this interdependency:

  1. Sequential training. Train the low-level policy first on a broad distribution of goals (e.g., from demonstrations or self-play), then train the high-level policy using the frozen low-level policy. This is simple but the low-level may not cover all goals the high-level wants to issue.
  2. Joint fine-tuning. After initial separate training, fine-tune both levels together so that each adapts to the other's behavior. At minimum, at least one policy should be adapted to the deficiencies of the other.
  3. LLMs as high-level policies. Large language models can serve as effective high-level policies out of the box, since they already understand task decomposition through pre-training. This sidesteps the high-level training problem entirely.
Key Insight
Why not train everything end-to-end with a latent goal representation? Because without explicit structure or supervision on the goals, the system collapses into a flat policy—the intermediate "goals" become meaningless latent codes that the low-level policy ignores. The power of hierarchy comes from meaningful decomposition, not from architectural scaffolding alone.

Design Choice 3: When to Transition Between Subgoals

A critical question in hierarchical policy execution is: when should the high-level policy be re-queried to produce a new goal? There are two primary approaches, each with distinct trade-offs.

Option 1: Completion-Based Transitions

Re-query the high-level policy when the low-level policy has completed the current goal $\mathbf{g}_t$, estimated by measuring progress toward the goal (e.g., via a learned success classifier or distance metric).

Option 2: Fixed-Interval Transitions

Re-query the high-level policy every $n$ time steps, regardless of whether the current goal has been completed.

In practice, the fixed-interval approach is more common because its failure mode (taking wrong actions for $n$ steps) is less catastrophic than the completion-based approach's failure mode (getting permanently stuck). Many systems use a relatively frequent replanning interval as a compromise.

Hierarchy in Modern Robot Learning Systems

Hierarchical architectures have become the dominant paradigm in state-of-the-art robot learning systems. Several prominent examples from 2025 illustrate how hierarchy is deployed at scale:

Key Insight
The convergence of multiple industry systems toward hierarchical architectures is driven by a practical constraint: high-level reasoning models (VLMs, LLMs) are computationally expensive and run slowly, while robot control requires fast, reactive decisions. Hierarchy naturally decouples these requirements, allowing expensive models to run at 1-5 Hz and lightweight controllers at 50+ Hz.

Hierarchical Imitation Learning: Example Systems

Language Subgoals

One of the most natural instantiations of hierarchy uses language as the goal representation. This approach requires segmented demonstration data where each demonstration is divided into subtask segments, each annotated with a language description.

Data and Training

The training data consists of robot demonstrations segmented into sub-episodes, where each segment is labeled with a language command describing the subtask (e.g., "pick up the bag", "open the bag with scoop", "pour it into the bag"). Given this data, both levels of the hierarchy are trained with imitation learning:

Fine-Tuning with DAgger

A key advantage of the language-based hierarchy is that the high-level policy can be fine-tuned using only language supervision—no kinesthetic demonstrations required. The "Yell At Your Robot" system (Shi, Hu, Zhao, Sharma, Pertsch, Leo, Levine, Finn; RSS 2024) demonstrated this through hierarchical DAgger:

  1. Deploy the hierarchical policy with the low-level policy frozen.
  2. A human observer provides language corrections when the high-level policy makes a wrong subtask prediction (e.g., saying "avoid pouring outside the bag" when the robot is about to spill).
  3. These language corrections override the high-level policy's prediction and are recorded as training data.
  4. The high-level policy is updated via gradient descent on the collected corrections, following the DAgger paradigm.

After fine-tuning, the high-level policy internalizes the corrections and can self-correct—it learns to predict the right subtask without human intervention. Experimental results from Hi Robot (Shi et al., ICML 2025) show that hierarchy provides a 19-34% improvement over flat VLA policies on long-horizon tasks, and DAgger-based fine-tuning of the high-level policy closes an additional 20% gap toward oracle (human-corrected) performance.

Image Subgoals

An alternative to language goals is to use images as the intermediate representation. In this paradigm, the high-level policy produces a goal image depicting what the scene should look like after completing the next subtask, and the low-level policy is conditioned on this goal image rather than a language command.

SuSIE: Subgoal Synthesis via Image Editing

The SuSIE system (Black, Nakamoto, Atreya, Walke, Finn, Kumar, Levine; ICLR 2024) implements this idea by using an image editing model as the high-level policy. Given the current observation and a language task description, the image editor generates a modified version of the current image showing the scene after the next subtask is completed. The low-level policy is a goal-image-conditioned controller trained to reach the depicted scene.

This approach offers several advantages over language-based hierarchy:

Experiments demonstrate that including human videos in the high-level policy training data improves performance on manipulation tasks. For example, on a suite of tabletop tasks, adding the Something-Something human video dataset to robot-only data (BridgeData) improved average success rates from 0.30 to 0.50 on harder scenes and from 0.80 to 0.88 on easier scenes.

Hierarchical Reinforcement Learning

While the imitation-based systems described above learn hierarchical policies from demonstrations, hierarchical reinforcement learning addresses the setting where the agent must discover both the goal decomposition and the low-level skills through trial and error.

HIRO: State-Based Goal-Conditioned Hierarchy

The HIRO system (Nachum, Gu, Lee, Levine; NeurIPS 2018) represents goals as state vectors—specifically, relative target positions of the agent and objects. The architecture works as follows:

Why hindsight relabeling helps in hierarchical RL.

Consider a high-level policy that proposes goal $\mathbf{g}$ but the low-level policy actually reaches state $\mathbf{s}'$ instead. Without relabeling, this transition is uninformative for the high-level policy because the proposed goal was not achieved. With hindsight relabeling, we retroactively pretend the high-level policy intended to reach $\mathbf{s}'$. This creates a valid training sample: "from state $\mathbf{s}$, if I propose goal $\mathbf{s}'$, the low-level policy will reach $\mathbf{s}'$ and receive reward $r$." This is the hierarchical analog of Hindsight Experience Replay (HER), and it transforms every trajectory into useful training data regardless of whether the original goals were achieved.

Language-Conditioned Hierarchical RL

Jiang, Gu, Murphy, and Finn (NeurIPS 2019) extended hierarchical RL to use language as the goal space. In this approach:

Using language as the goal space in RL is particularly appealing because language inherits the structure of natural language semantics, making the goal space naturally well-organized. However, it requires a mechanism for grounding language in the environment, which can be challenging without pre-training.

Unsupervised Skill Discovery

A related research direction asks: can we discover a set of diverse skills without any supervision? The DIAYN framework (Eysenbach, Gupta, Ibarz, Levine; ICLR 2019) addresses this by training a set of skills that are maximally distinguishable from each other, using a mutual information objective. The learned skills can then serve as the action space for a high-level policy, providing a form of unsupervised hierarchy.

Definition
Unsupervised Skill Discovery. The objective is to learn a set of policies $\{\pi(\cdot \mid s, z)\}_{z \in \mathcal{Z}}$ indexed by skill codes $z$, such that different skill codes produce distinguishable behaviors. This is typically achieved by maximizing the mutual information $I(z; \tau)$ between the skill code $z$ and the resulting trajectory $\tau$, encouraging each skill to visit distinct parts of the state space.

Summary and Open Questions

Hierarchical reinforcement learning addresses the fundamental challenge of long-horizon decision-making by decomposing difficult tasks into manageable subtasks. The key design decisions are:

  1. Goal representation: Language, images, state vectors, or learned embeddings—each with different trade-offs in expressiveness, structure, and supervision requirements.
  2. Supervision for each level: The high-level and low-level policies can be trained separately or jointly, via imitation learning, RL, or a combination. The co-dependence between levels requires careful handling.
  3. Subgoal transition timing: Completion-based transitions are ideal but fragile; fixed-interval transitions are simpler and more robust in practice.

Several important open questions remain in this area: