Introduction
Reinforcement Learning (RL) is often hindered by extreme sample inefficiency, requiring millions of iterations to master complex tasks. A promising solution is task composition, where an agent learns simple "primitives" (e.g., "find the ball," "avoid the lava") and combines them at runtime to execute complex missions ("find the ball AND avoid the lava"). While previous work established a "Boolean Task Algebra" for goal-reaching, it lacked robust safety constraints and was largely limited to discrete action spaces. This paper introduces a framework for zero-shot task composition that strictly enforces safety and extends to continuous action spaces.
Methods
The Penalty Hierarchy
To enable safety awareness, the authors transition from simple negative rewards to a tiered penalty hierarchy. This structure ensures that an agent mathematically prefers a longer safe path over a shorter unsafe one by using a specific multiplier, $C_p$.
Two Notions of Safety
The framework defines two strategies for handling "bad" states:
- Minimum-violation: Prioritizes reaching the goal while minimizing encounters with "bad" states.
- Prioritized safety: A stricter approach using "negated" policies—learning explicitly what to avoid—to ensure certain regions are bypassed entirely, even at the cost of efficiency.
Continuous Action Composition
A major contribution is the extension to continuous action spaces. Unlike discrete RL, where one can iterate through all actions to find the highest Q-value, continuous spaces require a different approach. The authors prove that Boolean composition can be achieved by comparing the Q-values of the optimal actions suggested by individual primitive policies.
Evaluation and Results
The methods were tested in three environments: a static grid world, an item collection grid world using Deep Q-Networks (DQN), and a 3D physics simulation (Bullet-Safety-Gym) using the Twin Delayed DDPG (TD3) algorithm.
Key findings include:
- Zero-Shot Safety: Agents can navigate novel "lava + goal" scenarios without specific training, provided primitives use the correct penalty structure.
- Avoidance Asymmetry: Explicitly training negated tasks (avoidance) is more effective than analytically flipping a "reach" policy, preventing infinite loops in complex layouts.
- Scalability: Learning $N$ primitives and composing them is exponentially more efficient than learning all $2^{2^N}$ possible Boolean combinations individually.
Limitations and Future Work
The current theoretical proofs assume a deterministic environment, though experimental results show robustness in noisy simulations. Additionally, the framework requires identical Markov Decision Processes (MDPs) across tasks, meaning it cannot currently compose policies with differing physics or state spaces. Future research aims to extend these guarantees to stochastic environments and explore potential-based reward shaping to accelerate learning of complex safety hierarchies.
Summary updated