Latent Space Policies for Hierarchical Reinforcement Learning

Tuomas Haarnoja, Kristian Hartikainen, Pieter Abbeel, Sergey Levine

Introduction

Hierarchical Reinforcement Learning (HRL) aims to break down complex tasks into a hierarchy of sub-tasks. Ideally, a bottom layer learns "primitive" skills (like walking or balancing), while a top layer sequences these skills to achieve a broader goal (like navigating a maze).

However, HRL is notoriously difficult to implement effectively. Most existing methods "cripple" the lower layers to force a hierarchy to emerge—for example, by withholding information from the bottom layer or forcing it to choose from a small, discrete set of actions. This often results in a "representation bottleneck" where the higher layer cannot fully control the robot because the lower layer's skills are too rigid or limited.

This paper introduces a novel framework that connects layers through an invertible latent space. By using maximum entropy objectives and normalizing flows, the authors create a hierarchy where higher levels can seamlessly steer lower-level "skills" without losing any of the original control authority. The challenge addressed is clear: How do we create a hierarchy that is useful for abstraction but doesn't sacrifice the expressivity and control of the agent?

Methods: Latent Space Policies (LSP)

The authors propose Latent Space Policies (LSP) to solve the representation bottleneck. The core of their approach relies on two key technical pillars:

  1. Maximum Entropy RL: Instead of just maximizing reward, the policy is trained to be as random as possible while still succeeding (maximizing entropy). This ensures the lower layer learns a diverse "menu" of behaviors rather than collapsing into just one way to solve a task.
  2. Normalizing Flows (Real NVP): The policy is structured as an invertible mapping between a latent variable ($h$) and an action ($a$).
Normalizing Flow Architecture

Because this mapping is bijective (invertible), a higher-level layer providing the latent variable $h$ retains full mathematical authority over the final action $a$. It can effectively "undo" any transformation the lower layer suggests, preventing the higher layer from being artificially constrained.

The Training Process

The hierarchy is built "bottom-up" to ensure stability:

  • Layer 0: Trained on a basic task (like locomotion) using a maximum entropy objective. This layer learns to map a latent space to a variety of movements.
  • Layer 1: The weights of Layer 0 are frozen. Layer 1 is then trained, using the latent space of Layer 0 as its action space.
  • This process can be stacked into multiple layers, where each layer views the one below it as part of the environment's dynamics.

Key Insights

  • Invertibility prevents "Skill Collapse": In traditional HRL, if a lower layer learns to only walk forward, the higher layer can never make it go backward. Because LSP uses invertible mappings, the higher layer can always steer the agent in any direction, even if the lower layer wasn't explicitly trained for it.
  • Stagewise Training is Stable: Unlike end-to-end hierarchical models which are often unstable, training one layer at a time and freezing it provides a stable curriculum for the agent.
  • Entropy as a Proxy for Utility: By forcing the lower layer to maintain high entropy, the authors ensure that the latent space remains "rich." The latent variables actually mean something (e.g., different values of $h$ correspond to different walking directions).

Key Results

The researchers evaluated their method on standard continuous control benchmarks from the OpenAI Gym and rllab suites, including Swimmer, Hopper, Walker2d, HalfCheetah, Ant, and Humanoid.

Performance on Ant and Humanoid
  • State-of-the-Art Performance: Their single-layer algorithm (SAC-LSP) outperformed or matched popular algorithms like PPO, DDPG, and Soft Q-Learning across all standard benchmarks.
  • Hierarchy Boosts High-Dimensional Control: On the most difficult tasks, such as Ant and Humanoid locomotion, adding a second hierarchical layer significantly improved both the learning speed and the final total return compared to a single-layer policy.
  • Solving Sparse Rewards: The authors also tested on an "Ant Maze"—a custom task where a quadruped robot must navigate a maze with only a sparse binary reward. A single-layer policy starting from scratch failed completely. However, an LSP hierarchy (where the bottom layer was pre-trained to simply "move" and the top layer was trained to "reach the goal") solved the maze efficiently, avoiding the local optima that plague standard fine-tuning approaches.

Limitations and Future Work

  • Temporal Abstraction: While the paper handles structural hierarchy well, it does not explicitly address temporal hierarchy (e.g., the top layer making decisions every 10 steps while the bottom layer acts every step). The authors note this as a promising direction for future work.
  • Manual Reward Shaping: For the complex maze task, the authors still provided a simple "motion" reward to the bottom layer. While easier to design than specific sub-goals, the ultimate goal of HRL is to discover these primitives entirely without manual reward design.
  • Bottom-Up Rigidity: Once a lower layer is frozen, it cannot adapt to the specific needs of the higher layer. Exploring "slow" adaptation of lower layers while training higher ones could offer a middle ground between stability and flexibility.

Summary updated

BibTeX
@inproceedings{haarnoja2018latent,
  author = {Tuomas Haarnoja and Kristian Hartikainen and Pieter Abbeel and Sergey Levine},
  title = {{Latent Space Policies for Hierarchical Reinforcement Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2018},
  url = {https://openreview.net/forum?id=VikPTVw_3Sp},
}
Figure