Abstract
Ensuring the safety of reinforcement learning (RL) algorithms is crucial to unlock their potential for many real-world tasks. However, vanilla RL and most safe RL approaches do not guarantee safety. In recent years, several methods have been proposed to provide hard safety guarantees for RL, which is essential for applications where unsafe actions could have disastrous consequences. Nevertheless, there is no comprehensive comparison of these provably safe RL methods. Therefore, we introduce a categorization of existing provably safe RL methods, present the conceptual foundations for both continuous and discrete action spaces, and empirically benchmark existing methods. We categorize the methods based on how they adapt the action: action replacement, action projection, and action masking. Our experiments on an inverted pendulum and a quadrotor stabilization task indicate that action replacement is the best-performing approach for these applications despite its comparatively simple realization. Furthermore, adding a reward penalty, every time the safety verification is engaged, improved training performance in our experiments. Finally, we provide practical guidance on selecting provably safe RL approaches depending on the safety specification, RL algorithm, and type of action space.
Introduction
Reinforcement Learning (RL) has demonstrated remarkable success in complex environments, yet its inherent "trial and error" nature poses significant risks in safety-critical domains like robotics or autonomous driving. In these contexts, a single failure can lead to catastrophic outcomes. While traditional "Safe RL" often relies on soft constraints or probabilistic guarantees, high-stakes applications demand hard safety guarantees. This research addresses the lack of a unified framework for comparing such "provably safe" methods by providing a formal taxonomy, a survey of 47 key works, and a rigorous empirical benchmark.
Methodology: A Taxonomy of Safety Mechanisms
The core of provably safe RL lies in how the agent's actions are modified to ensure they remain within a "safe set" $\mathcal{A}_s$. The authors classify these strategies into three primary categories:
- Action Replacement: A "safety shield" monitors the agent's proposed action $a_t$. If $a_t$ is unsafe, it is replaced by a known safe action $a_t^\varphi$ (e.g., a failsafe).
- Action Projection: Unsafe actions are mathematically projected onto the nearest point $\tilde{a}$ within the provably safe action set $\mathcal{A}_\varphi$.
- Action Masking: The agent is preemptively restricted from selecting unsafe actions. This paper introduces a novel formulation for continuous action masking using axis-aligned box transformations.
Beyond the mechanism itself, the paper explores Learning Tuples—the strategy for updating the agent's policy after a safety intervention. The choice between learning from the intended action, the modified safe action, or incorporating an "adaptation penalty" significantly impacts training efficiency.
Experimental Setup and Benchmarking
The methods were evaluated on two control benchmarks modified with hard safety constraints and system disturbances:
- Inverted Pendulum: Balancing a pole under constraints.
- 2D Quadrotor Stabilization: Maintaining a drone within a safe zone despite wind-like disturbances.
The benchmarks utilized five major RL algorithms: TD3, SAC, DQN, and both continuous and discrete PPO.
Key Results and Insights
The benchmarking revealed several critical findings:
- 100% Safety Compliance: All provably safe methods successfully prevented violations throughout training, whereas vanilla RL baselines failed repeatedly.
- Superiority of Action Replacement: Despite its simplicity, Action Replacement (using a failsafe) consistently outperformed more complex methods in terms of total reward and learning speed.
- The Role of Penalties: Incorporating a reward penalty when the safety mechanism was triggered—an "adaptation penalty"—greatly improved performance. This signal helps the agent learn the boundaries of the safe space more effectively.
- Computational Trade-offs: Action Projection, while theoretically elegant, often faced numerical instability and high computational costs during training.
Conclusion and Future Directions
While provably safe RL offers a path toward reliable AI in physical systems, it currently relies on a Conformant Model—a mathematical representation of the system. The validity of the safety guarantee is tied to the accuracy of this model. Future research must address scaling these methods to high-dimensional systems and improving the efficiency of safety verification to enable real-time deployment in increasingly complex environments.
Summary updated