Automaton Constrained Q-Learning

Anastasios Manganaris, Vittorio Giammarino, Ahmed H Qureshi

Abstract

Reinforcement learning (RL) often struggles with complex, multi-stage tasks and strict safety requirements in continuous control environments. This paper introduces Automaton Constrained Q-Learning (ACQL), a framework that integrates Linear-time Temporal Logic (LTL) with goal-conditioned RL. By utilizing an augmented state space based on Deterministic Büchi Automata (DBA), a novel LTL-aware Hindsight Experience Replay (HER) mechanism, and a "minimum-safety" critic, ACQL enables agents to learn sophisticated behaviors while maintaining hard safety constraints. Experimental results across high-dimensional simulations and real-world robotic tasks demonstrate that ACQL significantly outperforms existing logic-based RL methods, achieving high success rates where traditional baselines fail.

Introduction

Standard Reinforcement Learning is highly effective at optimizing for single, well-defined goals. However, real-world robotics requires the execution of complex, multi-step instructions—such as navigating a kitchen to retrieve an object while avoiding specific hazards. Specifying these behaviors using traditional reward functions is notoriously difficult and often leads to "reward hacking," where the agent finds unintended ways to maximize reward without fulfilling the actual task.

To address this, researchers use Linear-time Temporal Logic (LTL) to formally define sequences and safety rules. While LTL provides a robust mathematical framework for task specification, it introduces significant challenges for deep RL: rewards are typically "sparse," meaning the robot only receives feedback at the end of a long sequence. Furthermore, existing methods struggle to handle safety constraints that change dynamically depending on the robot's current task stage. ACQL was developed to bridge this gap between formal logic and continuous control.

Methodology

ACQL introduces three key technical innovations to enable efficient learning of logic-constrained tasks:

1. Augmented Product CMDP

The algorithm translates LTL instructions into a Deterministic Büchi Automaton (DBA), which acts as a logical map of the task. ACQL then creates an augmented state space that combines the robot's physical coordinates, its current progress within the automaton, and a list of active subgoals. This allows the agent to remain "aware" of its logical requirements at every step.

2. LTL-Aware Hindsight Experience Replay (HER)

Sparse rewards are a primary bottleneck in LTL-based learning. ACQL adapts Hindsight Experience Replay to the logical domain. If an agent fails to reach a specific goal but accidentally satisfies a different logical state, the algorithm retroactively relabels the experience. This "learning from failure" ensures that every trajectory provides a useful signal for the policy, regardless of whether the original instruction was completed.

3. Minimum-Safety Constraint

Traditional "Safe RL" often uses a cumulative cost budget, which can be mathematically noisy and allow for small, repeated safety violations. ACQL instead employs a Safety Critic that predicts the minimum safety value the robot will encounter in the future. By treating safety as a hard classification boundary—where any action predicted to fall below a safety threshold is blocked—ACQL better reflects the "hard safety" requirements of physical robotics.

Experimental Evaluation

The researchers evaluated ACQL using the Brax physics engine across several high-dimensional continuous control environments:

  • PointMass Field: 2D navigation.
  • Quadcopter Room: 3D drone navigation.
  • Ant Field: An 8-DOF quadruped robot navigating specific regions.
  • UR5e Shelf: A simulated 6-DOF robotic arm.

Beyond simulation, the framework was validated on a physical UR5e robotic arm performing multi-stage reaching tasks in a cluttered cabinet environment.

Key Results and Insights

ACQL demonstrated a significant performance leap over existing baselines such as Reward Machines (CRM-RS) and the Logical Options Framework (LOF). In complex tasks involving sequential goals (e.g., the "Loop" task), ACQL achieved success rates of 60-80%, while baselines frequently failed to learn entirely (0% success).

Safety and Reliability

In environments with dynamic or disappearing safety constraints, ACQL consistently avoided unsafe regions. The "minimum-safety" formulation proved more reliable than budget-based methods, ensuring the agent maintained a safe distance from obstacles throughout the task execution.

Real-World Transfer

A policy trained entirely in simulation was deployed directly onto a physical 6-DOF robot arm. The robot successfully navigated a cluttered cabinet to reach three subgoals in sequence with a 100% success rate over 16 trials, demonstrating the robustness of the learned goal-conditioned policy.

The Importance of HER

Ablation studies highlighted the criticality of the relabeling mechanism. Removing the LTL-aware HER caused success rates to plummet from approximately 91% to 13%, confirming that the ability to learn from unintended outcomes is essential for mastering formal logic tasks.

Conclusion and Future Work

ACQL provides a scalable solution for teaching robots complex, safe, and logically structured behaviors. By treating the automaton as a goal generator and utilizing a single, universal goal-conditioned policy, the system avoids the complexity of hierarchical methods that require separate skills for every logical transition.

Future research will focus on expanding the framework to handle Partial Observability, where the robot may have imperfect sensor data or hidden obstacles. Additionally, the authors aim to explore even more expressive logical structures beyond Deterministic Büchi Automata to encompass even more sophisticated human-robot interactions.

Summary updated

BibTeX
@inproceedings{manganaris2025automaton,
  author = {Anastasios Manganaris and Vittorio Giammarino and Ahmed H Qureshi},
  title = {{Automaton Constrained Q-Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=DLt2Ep1S3q},
}
Figure