Why Does Hierarchy (Sometimes) Work So Well in Reinforcement Learning?

Ofir Nachum, Haoran Tang, Xingyu Lu, Shixiang Gu, Honglak Lee, Sergey LevinearXiv 2019

TL;DR

This paper investigates why hierarchical reinforcement learning (HRL) is so effective on complex tasks. Surprisingly, they find that the primary benefit of HRL isn't necessarily easier learning or structured policies, but rather significantly improved exploration capabilities. They then propose simpler, non-hierarchical exploration methods inspired by HRL that achieve comparable performance.

What Problem Does This Paper Address?

Reinforcement learning (RL) agents learn by trial and error to achieve goals. However, many real-world tasks, like navigating a building or performing complex manipulation, are inherently hierarchical. For instance, to navigate, one must first learn to walk and turn before combining these to reach a destination. Hierarchical Reinforcement Learning (HRL) aims to leverage this structure by introducing multiple levels of policies, where higher-level policies set goals for lower-level policies that execute actions. While HRL has shown impressive success on challenging tasks where traditional "shallow" RL agents struggle, the exact reasons for this success are not well understood. Existing explanations often cite benefits like learning over longer time scales, more meaningful action spaces, and better exploration. This paper seeks to empirically disentangle these claimed benefits and understand which ones truly drive HRL's effectiveness, especially in fully observable environments where theoretical advantages of hierarchy are less clear.

Methods

The authors employ a rigorous empirical approach to dissect the claimed benefits of HRL. They design experiments to isolate specific hypotheses:

  • Temporal Abstraction (H1 & H2): They decouple the "training horizon" (how long a high-level action persists during learning) from the "exploration horizon" (how long a high-level action persists during data collection). This allows them to test whether learning over longer time steps (H1) or exploring over longer time steps (H2) is more impactful.
  • Semantic Actions (H3 & H4): To isolate the benefit of "semantic" (meaningful) high-level actions from exploration, they introduce a "shadow agent." This is a standard, non-hierarchical agent trained on experience collected by an HRL agent. If the shadow agent performs well, it suggests the semantic action representation itself isn't the primary driver of HRL's success, but rather the quality of the experience it generates.
  • Multi-step Rewards: They investigate the role of using rewards accumulated over multiple steps (n-step returns) as a potential confounder for temporal abstraction benefits.
  • Novel Exploration Strategies: Based on their findings, they propose two new exploration methods inspired by HRL:
  • Explore & Exploit (E&E): This method uses two non-hierarchical agents: one focused on maximizing rewards (exploit) and another on reaching random goals (explore). They switch between these agents periodically.
  • Switching Ensemble (SE): This approach trains multiple non-hierarchical agents and switches between them periodically, mimicking the idea of having multiple specialized lower-level policies.

Datasets

The paper evaluates its methods on four challenging simulated robotic tasks: AntMaze, AntPush, AntBlock, and AntBlockMaze. These tasks involve locomotion, navigation, and object manipulation, and are designed to be difficult for standard RL agents. The authors note that they fix the goal representation to relative x,y coordinates for simplicity in their analysis, but that goal-conditioned HRL can work without this prior knowledge.

Key Insights and Ideas

  • Exploration is King: The most surprising finding is that the primary driver of HRL's success on these tasks is not easier policy learning or the semantic meaning of high-level actions, but rather improved exploration. HRL agents are simply better at exploring the environment.
  • Temporal Abstraction's Dual Role: While temporal abstraction in training (H1) offers some benefit, it's largely due to enabling the use of multi-step rewards. Temporal abstraction in exploration (H2) is more impactful, but its benefits can be replicated by non-hierarchical agents.
  • Semantic Actions are Less Crucial Than Feared: The "semantic" nature of high-level actions (H3 & H4) appears to have a negligible direct impact on learning performance when exploration is controlled for. The "meaningfulness" seems to be a byproduct of effective exploration.
  • Multi-step Rewards are Powerful: Using multi-step rewards (n-step returns) can significantly boost performance for non-hierarchical agents, mimicking some of the benefits attributed to temporal abstraction in training.
  • HRL as an Exploration Inspiration: The paper demonstrates that HRL's success can be largely replicated by simpler, non-hierarchical agents that adopt HRL-inspired exploration strategies. This suggests a valuable avenue for future research in exploration.

Key Results

  • In the AntMaze, AntPush, AntBlock, and AntBlockMaze tasks, HRL methods (like HIRO and Options) achieve significantly higher success rates than shallow, non-hierarchical agents.
  • When temporal abstraction is decoupled, temporal exploration (Cexpl > 1) shows a stronger positive correlation with performance than temporal training (Ctrain > 1). However, even Cexpl = 1 can make non-negligible progress.
  • The "shadow agent" experiments reveal that a non-hierarchical agent trained on HRL-generated experience can achieve performance competitive with HRL, especially when using multi-step rewards (Crew=3 often performs best). This suggests that the benefits of HRL's training are largely transferable.
  • The proposed non-hierarchical exploration methods, Explore & Exploit (E&E) and Switching Ensemble (SE), achieve performance comparable to HRL on most tasks, with E&E on AntBlockMaze and SE on AntPush being the only exceptions. This confirms that temporally extended exploration is key.
  • Using separate networks for different policies (modularity) is consistently better than combined networks for both HRL and HRL-like methods, suggesting modularity is important.

Limitations and Future Work

The authors acknowledge several limitations:

  • Task Specificity: Their findings are based on a specific set of simulated tasks. The benefits of hierarchy might differ in more complex environments, multi-task settings, or tasks with sparser rewards.
  • Limited Hierarchical Designs: The analysis focused on a few specific HRL architectures (options, goal-conditioned). Other hierarchical designs might yield different conclusions.
  • Fixed Temporal Abstraction: The study used fixed temporal abstraction lengths (c). Investigating variable-length temporal abstractions could be fruitful.

Future work directions suggested include:

  • Developing more sophisticated hierarchical systems that can realize all claimed benefits, not just exploration.
  • Further exploring non-hierarchical exploration strategies inspired by HRL, investigating more variants.
  • Examining the role of hierarchy in multi-task learning and transfer learning.
  • Investigating how hierarchy interacts with other exploration mechanisms like count-based exploration in more complex or sparse reward settings.
  • Exploring different hierarchical structures and a wider variety of environments.

Summary updated

BibTeX
@misc{nachum2019why,
  author = {Ofir Nachum and Haoran Tang and Xingyu Lu and Shixiang Gu and Honglak Lee and Sergey Levine},
  title = {{Why Does Hierarchy (Sometimes) Work So Well in Reinforcement Learning?}},
  year = {2019},
  eprint = {1909.10618},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1909.10618},
}
Figure