Reinforcement Learning for Task Specifications with Action-Constraints

Arun Raman, Keerthan Shagrithaya, Shalabh BhatnagararXiv 2022

Abstract

This paper presents a novel framework that integrates Reinforcement Learning (RL) with Supervisory Control Theory (SCT) to address non-Markovian action constraints and uncontrollable environmental events. By utilizing finite-state automata as supervisors, the proposed method ensures strict adherence to safety and task specifications while optimizing agent policies through a modified Q-learning algorithm. The approach is validated in a complex grid-world environment, achieving a 100% success rate during inference.

Introduction

Standard Reinforcement Learning (RL) is highly effective at optimizing behavior through trial and error. However, it often fails to guarantee safety or satisfy complex task specifications, particularly when constraints are non-Markovian or when the environment includes uncontrollable events. Non-Markovian constraints, where the validity of an action depends on the history of previous actions, are difficult to encode in standard Markov Decision Processes (MDPs). Furthermore, uncontrollable events—such as sensor failures or accidental drops—require the agent to possess robust recovery strategies that still satisfy global constraints.

Methodology

The authors propose a Supervised Q-learning framework that bridges RL with Supervisory Control Theory (SCT). The core of this approach involves modeling safe and unsafe action sequences as Finite State Automata (FSA). Specifically, an automaton $H$ tracks illegal sequences, while $G_s$ tracks sequences required for task completion.

A "supervisor" monitors these automata and prunes the agent's action space in real-time, disabling any controllable action that would lead to an unsafe state. To handle high-level milestones, Reward Machines (RM) are integrated to provide structured rewards based on reaching specific states. A critical theoretical contribution is the offline controllability check, which determines if a valid supervisor exists given the set of uncontrollable events. If uncontrollable events make a task impossible to guarantee, the theory identifies the closest possible safe behavior.

Experimental Evaluation

The framework was evaluated using a Pick-up and Delivery Grid World. The agent's objective is to collect three items (labeled 1, 2, and 3) in sequence and deliver them to a destination ($S$) following a Last-In-First-Out (LIFO) protocol (3-2-1).

The Pick-up and Delivery Grid World environment used for testing.

The environment introduces complexity through uncontrollable "drop" events ($d_u$), forcing the agent to execute remedial sequences to recover the item. Additionally, the agent is constrained by a "no U-turn" rule, defined as prohibiting two consecutive left or right turns. These constraints are non-Markovian, as the agent must remember its previous move to avoid a violation.

Results

Experimental results over 500,000 iterations demonstrate that the agent successfully learns to navigate the complex logic of the grid world. The average score improved steadily as the agent internalized the pick-up/drop-off requirements and the supervisor's constraints.

Average score achieved by the agent during training iterations.

By the conclusion of the training phase, the agent achieved a 95% success rate under an $\epsilon$-greedy policy. Most notably, during inference (setting $\epsilon=0$), the agent reached a 100% success rate, perfectly satisfying all action constraints and task specifications despite the stochastic nature of uncontrollable events. This demonstrates that the supervisor effectively prevents the agent from entering states where a violation becomes inevitable.

Conclusion and Future Work

This work successfully demonstrates that formal methods from Supervisory Control Theory can provide hard safety guarantees for RL agents without sacrificing optimality. By augmenting the state space with automata states, the agent can solve non-Markovian tasks using standard Markovian learners.

However, the approach faces challenges related to state-space explosion as the number of constraints or the complexity of the environment increases. Future research will explore scaling these formal methods to continuous action spaces and high-dimensional environments where tabular Q-learning is insufficient.

Summary updated

BibTeX
@misc{raman2022reinforcement,
  author = {Arun Raman and Keerthan Shagrithaya and Shalabh Bhatnagar},
  title = {{Reinforcement Learning for Task Specifications with Action-Constraints}},
  year = {2022},
  eprint = {2201.00286},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2201.00286},
}
Figure