Safe Reinforcement Learning with Probabilistic Guarantees Satisfying Temporal Logic Specifications in Continuous Action Spaces

Hanna Krasowski, Prithvi Akella, Aaron D. Ames, Matthias Althoff

TL;DR

This paper introduces a three-step safe reinforcement learning (RL) framework for continuous action spaces that provides explicit probabilistic safety guarantees for complex temporal logic specifications. By decoupling safety verification from performance optimization, the approach allows an RL agent to maximize performance within a verified "safe zone" around a baseline controller, eliminating the need for computationally heavy online safety predictions.

What Problem Does This Paper Address?

While vanilla Reinforcement Learning (RL) excels at solving complex control tasks, its trial-and-error nature lacks behavioral guarantees, making it risky for real-world deployment. Existing "safe RL" methods typically rely on control-theoretic tools like Control Barrier Functions (CBFs) or Model Predictive Control (MPC). However, these methods are generally limited to simple "reach-avoid" specifications—meaning they can keep a robot out of an unsafe region, but they struggle with complex, time-dependent rules.

For instance, autonomous ships or cars must follow specific traffic laws (like overtaking only on a certain side), which are best expressed using Signal Temporal Logic (STL). While prior work has combined RL with temporal logic for discrete action spaces, scaling this to continuous real-world systems usually requires a messy translation layer. This paper tackles the challenge of providing explicit, verifiable probabilistic safety guarantees for arbitrary STL specifications directly within continuous action and state spaces.

Methods

The authors propose a three-step framework that cleanly separates safety from performance:

  1. Step 1: Probabilistic Verification of a Safe Controller: The process starts with a baseline, black-box "safe controller" ($u$). The authors use a scenario-based optimization approach to determine how much random disturbance ($\xi$) can be added to the controller's input before it violates the STL safety specification ($\psi$). This establishes a verified "expansion set" ($\mathcal{E}$) where the system remains safe with a mathematically bounded high probability ($1-\epsilon$).
  2. Step 2: Reinforcement Learning with Continuous Masking: Next, an RL agent (trained via Proximal Policy Optimization, or PPO) is introduced to optimize performance. To ensure safety during training, the agent's action space ($\mathcal{A}(x)$) is constrained to a state-dependent region directly centered around the safe controller's output: $$\mathcal{A}(x) = u(x) \oplus \mathcal{E}$$ Because the agent only explores within this pre-verified safe envelope, the reward function can focus entirely on performance objectives (like speed or efficiency) without complex multi-objective tuning.

  3. Step 3: Probabilistic Verification of the Learned Agent: Once training is complete, the final deterministic policy ($\pi_a$) is re-verified using the same scenario approach to guarantee that the integrated agent-controller system still satisfies the probabilistic safety bounds.

Overview of the three-step safe RL process

Datasets

The method was evaluated using a custom-designed simulation and hardware setup rather than a standard benchmark dataset:

  • Evasion Task Simulation: A simulated unicycle robot environment where the agent must navigate to a goal while executing a specific case-by-case evasion maneuver (defined via STL) to avoid a dynamic obstacle.
  • The Robotarium: A remotely accessible swarm robotics research testbed used to validate the trained policies on physical hardware.

Key Insights and Ideas

  • Decoupling Safety and Performance: Instead of forcing the RL agent to learn safety and performance simultaneously through complex reward shaping, this method uses the baseline controller as a safety shield. The RL agent's job is simply to make the safe controller better and faster.
  • Continuous Action Masking via Minkowski Sums: By defining the allowable action space as the Minkowski sum of the safe control input and the verified disturbance set, the authors elegantly bridge the gap between discrete safety shields and continuous action spaces.
  • Model-Free Safety Verification: Because the verification step relies on a scenario approach (sampling trajectories), it treats both the system and the baseline controller as black boxes. It does not require an explicit analytical system model to predict safety online during runtime.
Visualization of the RL agent exploring within the safe expansion set around the baseline controller

Key Results

  • Maintained Safety Guarantees: In the evasion task, the baseline controller was verified to be safe with 95% probability ($N=50$ samples) at a 92.3% confidence level. After RL training, the final learned agent maintained a similar probabilistic safety level ($\rho^*_{50} = 0.221 > 0$).
  • Improved Performance: The RL-tuned agent successfully learned to outperform the deterministic safe controller. It achieved a higher mean robustness score (0.78 vs. 0.76), translating to faster goal-reaching behavior by optimizing the robot's trajectory around the obstacle.
  • Real-Time Feasibility: Because safety is guaranteed by the bounded action space, the system only requires a lightweight forward pass of the policy network online. This allowed the Python-implemented controller to run effortlessly in real-time on physical Robotarium hardware.

Limitations and Future Work

The primary assumption of this framework is the availability of an initial safe baseline controller. While the authors note that such controllers can be synthesized from data or simplified models, the framework cannot function without one.

Additionally, the evaluation was limited to a relatively simple environment featuring a single, non-reactive dynamic obstacle. The authors acknowledge that future work must investigate how this approach scales to highly complex, multi-agent environments, such as autonomous highway driving.

Summary updated

BibTeX
@inproceedings{krasowski2023safe,
  author = {Hanna Krasowski and Prithvi Akella and Aaron D. Ames and Matthias Althoff},
  title = {{Safe Reinforcement Learning with Probabilistic Guarantees Satisfying Temporal Logic Specifications in Continuous Action Spaces}},
  booktitle = {CDC},
  year = {2023},
  doi = {10.1109/cdc49753.2023.10383601},
}
Figure