TLDR: This research introduces three new types of Reward Machines (Numeric, Agenda, and Coupled RMs) and a novel algorithm called Q-learning with Coupled RMs (CoRM). These innovations address the scalability challenges of applying Reinforcement Learning to long-horizon tasks with unordered subtasks, where traditional Reward Machines struggle due to exponentially increasing state spaces. CoRM enables parallel learning of low-level subtask policies and a high-level policy for optimal subtask ordering, demonstrating significantly faster convergence, improved sample efficiency, and better scalability in various complex environments compared to existing methods.
Reinforcement Learning (RL) is a powerful approach that teaches artificial intelligence agents to make decisions by interacting with an environment and receiving feedback in the form of rewards. The ultimate goal is for the agent to learn a strategy, or ‘policy,’ that maximizes its total expected reward over time. However, designing effective reward functions for complex tasks can be incredibly challenging and time-consuming.
One popular method to address this is the use of Reward Machines (RMs). RMs essentially provide a structured way to define the reward system of an environment, acting like a finite-state machine that guides the agent through different stages of a task. This approach is particularly beneficial for non-Markovian tasks, where the agent’s current state doesn’t fully capture all the information needed to decide the next best action. Agents equipped with RMs can learn more efficiently from fewer interactions with the environment.
The Challenge of Long-Horizon Unordered Tasks
Despite their advantages, traditional Boolean Reward Machines face significant limitations when dealing with ‘long-horizon unordered tasks.’ Imagine a scenario where an agent needs to complete a set of subtasks, but the order in which these subtasks are completed doesn’t matter. For example, collecting multiple boxes and delivering them to a station. A standard Boolean RM would need to account for every possible permutation of subtask completion orders. This leads to an exponential increase in the number of states the RM needs to track, making the learning process incredibly slow, memory-intensive, and often impractical for even moderately complex problems.
Introducing New Reward Machine Generalizations
To overcome these scalability issues, researchers Kristina Levina, Nikolaos Pappas, Athanasios Karapantelakis, Aneta Vulgarakis Feljan, and Jendrik Seipp have introduced three innovative generalizations of Reward Machines:
- Numeric RMs: These allow for a more compact and user-friendly way to describe complex tasks. Instead of tracking individual Boolean conditions, numeric RMs can use discrete numeric variables (e.g., counting the number of uncollected items). This simplifies the initial task modeling effort.
- Agenda RMs: Building on Numeric RMs, Agenda RMs associate each state with an ‘agenda’ – a set of remaining subtasks that need to be completed. This clever labeling scheme helps in identifying and merging symmetric states, effectively reducing the overall state space the agent needs to learn from.
- Coupled RMs: This is the most significant advancement. In Coupled RMs, states that represent a collection of subtasks are ‘split’ into individual states, each corresponding to a single subtask within that collection. Crucially, the agent is considered to be in all these coupled states simultaneously. This parallel representation is key to enabling more efficient learning.
Q-learning with Coupled RMs (CoRM)
To fully leverage the power of Coupled RMs, the researchers developed a new compositional learning algorithm called Q-learning with Coupled RMs (CoRM). CoRM allows the agent to learn two types of policies concurrently:
- Low-level policies: These policies dictate how to complete each individual subtask (e.g., how to navigate to a specific box or reach a station). Because of the coupled states, CoRM can learn these low-level policies in parallel for all relevant subtasks.
- High-level policy: This policy decides the optimal order in which to complete the subtasks. CoRM achieves this by tracking the minimum number of steps observed to reach a goal state from each coupled subtask state, guiding the agent towards the most efficient sequence.
CoRM also incorporates a sophisticated reward function that ensures the agent learns globally optimal solutions, even if a locally optimal action might seem better in isolation. This joint optimization is crucial for long-horizon tasks where the overall efficiency depends on the sequence of actions.
Experimental Validation and Benefits
The effectiveness of CoRM was rigorously tested across various environments, including ‘Delivery’ (collecting and delivering boxes), ‘Office’ (delivering coffee to multiple offices), and ‘Water’ (touching colored balls in a dynamic environment). The results consistently showed that CoRM significantly outperforms state-of-the-art RM algorithms, especially as the number of unordered subtasks increases. For instance, in tasks with many items to collect, traditional Boolean RM methods often hit memory or time limits, whereas CoRM scales much more efficiently.
CoRM demonstrates faster convergence, improved sample efficiency, and better scalability, making it a robust solution for complex, flexible tasks. The paper highlights that CoRM’s runtime scales linearly with the number of subtasks, a stark contrast to the exponential scaling observed in some other methods.
Also Read:
- Diagnosing AI’s Reasoning Abilities with TempoBench
- Unveiling AI’s Research Prowess: A New Benchmark for LLM Agents
Conclusion
The introduction of Numeric, Agenda, and Coupled Reward Machines, along with the CoRM algorithm, represents a substantial step forward in Reinforcement Learning. This work provides a powerful framework for AI agents to tackle long-horizon tasks where subtasks can be completed in any order, offering a more efficient and scalable path to learning optimal behaviors. For more details, you can read the full research paper here.


