Abstract
In this paper we consider the problem of how a reinforcement learning agent tasked with solving a set of related Markov decision processes can use knowledge acquired early in its lifetime to improve its ability to more rapidly solve novel, but related, tasks. One way of exploiting this experience is by identifying recurrent patterns in trajectories obtained from well-performing policies. We propose a three-step framework in which an agent 1) generates a set of candidate open-loop macros by compressing trajectories drawn from near-optimal policies; 2) evaluates the value of each macro; and 3) selects a maximally diverse subset of macros that spans the space of policies typically required for solving the set of related tasks. Our experiments show that extending the original primitive action-set of the agent with the identified macros allows it to more rapidly learn an optimal policy in unseen, but similar MDPs.
Introduction
In Reinforcement Learning (RL), agents typically begin exploration using only primitive actions. In complex environments, this leads to an inefficient "random walk" phase that scales poorly as the state space grows. While humans naturally synthesize high-level skills from past experiences, RL agents often lack the mechanism to transfer such knowledge between related tasks. This research introduces a framework to discover reusable, environment-agnostic macros—fixed sequences of actions—that allow agents to explore with purpose-built building blocks rather than wiggling joints at random.
The Compression-Inspired Framework
The proposed approach identifies recurring patterns of success by treating optimal action sequences as data to be compressed. The framework consists of three distinct stages:
- Macro Generation: The agent first solves a subset of training tasks. The resulting successful action sequences are processed using the LZW compression algorithm. Much like LZW identifies repeating substrings in text, it here extracts repeating sequences of actions that characterize near-optimal behavior.
- Macro Evaluation: To filter these candidates, the authors introduce the Utility value (U-value). This metric estimates the expected quality (Q-value) of a macro across the entire class of problems. A closed-form solution (Theorem 1) allows for efficient calculation without extensive re-training.
- Macro Selection: To avoid overwhelming the agent with redundant tools, a small, maximally diverse subset of macros is selected. This is achieved by comparing the end-state distributions of macros using KL divergence, ensuring the final set spans the necessary policy space.
Experimental Evaluation
The framework was evaluated across four problem classes: Chain Problem, Maze Navigation, Animat (a high-dimensional continuous-space environment), and Lunar Lander.
Key Results
The "Primitives + Macros" approach consistently outperformed standard baselines and state-of-the-art methods like Eigen-Options and Option-Critic. In the Animat task, the proposed method achieved a significantly higher average reward (-752.89) compared to Eigen-Options (-1432.46) and Option-Critic (-1955.47). Furthermore, agents equipped with these macros reached optimal performance significantly faster, as the macros allowed them to cover the environment more effectively than primitive actions alone.
Conclusion and Future Work
The core insight of this work is that optimal behavior across related tasks is highly compressible. By extracting these redundancies as open-loop macros, agents can bypass the limitations of random exploration. However, a primary limitation is the open-loop nature of these sequences; they do not adapt to environmental changes during execution. Future research will focus on extending this compression-based discovery to closed-loop options, enabling discovered skills to react to the state of the environment.
Summary updated