Hierarchical Representation Learning for Markov Decision Processes

Lorenzo Steccanella, Simone Totaro, Anders Jonsson

Abstract

In this paper, we present a novel method for learning reward-agnostic hierarchical representations of Markov Decision Processes. Our method works by partitioning the state space into subsets, and defines subtasks for performing transitions between the partitions. At the high level, we use model-based planning to decide which subtask to pursue next from a given partition. We formulate the problem of partitioning the state space as an optimization problem that can be solved using gradient descent given a set of sampled trajectories, making our method suitable for high-dimensional problems with large state spaces. We empirically validate the method, by showing that it can successfully learn useful hierarchical representations in domains with high-dimensional states. Once learned, the hierarchical representation can be used to solve different tasks in the given domain, thus generalizing knowledge across tasks.

Introduction

Reinforcement Learning (RL) agents frequently encounter "sparse reward" environments, where feedback is infrequent and exploration is difficult. Hierarchical Reinforcement Learning (HRL) addresses this by decomposing complex tasks into simpler subtasks. However, traditional HRL often requires human experts to manually define these hierarchies. Automating the discovery of subtasks from high-dimensional observations (such as raw pixels) remains a significant challenge. This paper introduces a novel approach to automatically learn reward-agnostic hierarchical representations by partitioning the state space into abstract regions using gradient descent.

Methodology

The proposed system utilizes a "Manager-Worker" architecture built upon a learned state-space compression function.

1. State-Space Partitioning

The core of the method is a compression function, $f_\psi$, implemented as a neural network that maps high-dimensional states to a discrete set of abstract partitions. This mapping is optimized using a three-part loss function:

  • Temporal Consistency ($L_Z$): Encourages states occurring close in time to be grouped into the same partition.
  • Balance ($L_H$): Prevents the collapse of all states into a single partition by encouraging an even distribution across the abstract state space.
  • Determinism ($L_D$): Ensures a sharp, non-fuzzy mapping from raw observations to specific partitions.
Learned state-space partitions in the NineRooms environment. The top row shows the gridworld layouts, and the bottom row shows the corresponding abstract partitions discovered by the model.

The interaction between temporal consistency and balance is crucial; it forces the network to identify "bottlenecks," such as doorways, as natural boundaries between partitions.

2. Manager-Worker Architecture

The hierarchy consists of two levels:

  • The Manager: Operates on the abstract graph of partitions. It uses model-based planning (Value Iteration) to select the next target partition.
  • The Worker: A low-level policy (Double DQN) trained to move the agent between adjacent partitions. To improve performance, the worker receives a Controllability bonus for reaching boundary states that maximize future movement options.

Experimental Evaluation

The method was evaluated on several image-based environments, including a 19x19 "NineRooms" gridworld and a 10x10 "Key-Door" environment.

The Key-Door0 environment, a 10x10 gridworld used to evaluate the agent's ability to solve sparse-reward tasks and transfer learned hierarchies.

Key Results

  • Exploration Efficiency: In the NineRooms environment, the HRL agent significantly outperformed "flat" learners like Self-Imitation Learning (SIL) and DQN with Prioritized Experience Replay (DQN-PER), which often failed to reach the goal within 100,000 steps.
  • Comparison with HRL Baselines: The proposed method showed superior stability and final performance compared to the Option-Critic (OC) framework.
  • Transferability: Hierarchies learned in empty environments were successfully transferred to complex tasks like Key-Door, drastically reducing the time required to learn new policies.

Conclusion

By formulating state-space partitioning as a gradient-based optimization problem, this research provides a scalable way to discover hierarchies in high-dimensional MDPs. The resulting reward-agnostic representations are robust and transferable across different tasks within the same environment. Future work will explore interleaving representation learning with policy improvement and dynamically determining the optimal number of partitions.

Summary updated

BibTeX
@inproceedings{steccanella2023hierarchical,
  author = {Lorenzo Steccanella and Simone Totaro and Anders Jonsson},
  title = {{Hierarchical Representation Learning for Markov Decision Processes}},
  booktitle = {CoLLAs},
  year = {2023},
  url = {https://openreview.net/forum?id=rOfwBY7y8V},
}
Figure