Introduction
Reinforcement learning (RL) is often hampered by extreme sample inefficiency, requiring agents to learn each new task from scratch. In contrast, humans possess the ability to compose complex instructions from simpler, known skills using logical operators—for instance, "go to the kitchen AND bring a spoon BUT NOT a fork." This paper introduces a formal mathematical framework that enables RL agents to perform similar zero-shot composition of tasks using Boolean logic (AND, OR, NOT).
Boolean Task Algebra and Extended Value Functions
The core of this approach lies in formalizing tasks as elements of a Boolean algebra. By defining a set of base tasks, new objectives can be constructed through logical expressions. For example, if $M_1$ represents "collecting red objects" and $M_2$ represents "collecting circles," an agent can immediately target "red objects that are NOT circles" ($M_1 \wedge \neg M_2$).
To support this algebra, the authors move beyond standard Q-functions, which typically only track the path to the nearest goal. They introduce Extended Value Functions ($\bar{Q}$). These functions encode the dynamics required to reach every possible goal in an environment. The researchers prove a "homomorphism" between the task algebra and the value function algebra: logical operations on tasks (like AND) correspond to specific mathematical operations (like min) on the learned extended value functions.
The Power of Mastery and Zero-Shot Composition
The requirement for an agent to achieve "mastery"—learning to reach any goal—imposes a higher initial training cost. However, this investment yields a super-exponential payoff. From a set of $K$ base tasks, the Boolean algebra allows the agent to solve $2^{2^K}$ distinct tasks. For example, 10 base tasks can generate more unique objectives than there are atoms in the universe.
Furthermore, to solve an environment with $N$ distinct goals, the agent only needs to learn $\log_2 N + 1$ base tasks. This logarithmic scaling represents an exponential improvement over traditional methods that require learning each goal as a separate task. Crucially, once the base tasks are mastered, the agent can solve any logically expressible combination in a zero-shot manner, with no additional fine-tuning or samples required.
Experimental Results
The framework was evaluated in a "Four Rooms" grid-world and a high-dimensional 2D video game environment using Universal Value Function Approximators (UVFAs).
In both settings, agents successfully solved complex logical tasks, such as Exclusive-OR (XOR), without any additional training. While the initial learning phase for extended value functions is more intensive, it eliminates the need for future training on composite tasks. The system also demonstrated robustness in stochastic environments, maintaining near-optimal policies even when actions were not perfectly deterministic.
Limitations and Future Directions
The current theoretical proof assumes deterministic dynamics and shared state/action spaces across tasks. While empirical results show some flexibility, scaling to highly dynamic environments remains an open challenge. Additionally, the computational cost of "mastery" in continuous or massive state spaces is significant. Future research may focus on more efficient learning algorithms for extended value functions and extending the algebra to include temporal composition (sequencing tasks over time).
Summary updated