Abstract: We develop provably safe and convergent reinforcement learning (RL) algorithms for control of nonlinear dynamical systems, bridging the gap between the hard safety guarantees of control theory and the convergence guarantees of RL theory. Recent advances at the intersection of control and RL follow a two-stage, safety filter approach to enforcing hard safety constraints: model-free RL is used to learn a potentially unsafe controller, whose actions are projected onto safe sets prescribed, for example, by a control barrier function. Though safe, such approaches lose any convergence guarantees enjoyed by the underlying RL methods. In this paper, we develop a single-stage, sampling-based approach to hard constraint satisfaction that learns RL controllers enjoying classical convergence guarantees while satisfying hard safety constraints throughout training and deployment. We validate the efficacy of our approach in simulation, including safe control of a quadcopter in a challenging obstacle avoidance problem, and demonstrate that it outperforms existing benchmarks.
Introduction
Reinforcement learning (RL) has shown great promise in solving complex control tasks, but its application to safety-critical systems is hindered by the "trial-and-error" nature of training. In domains like autonomous flight or industrial robotics, even a single violation of safety constraints during learning can be catastrophic.
Traditionally, safety has been handled in two ways: treating it as a penalty to be minimized (Constrained MDPs) or using external safety filters (Projection methods). However, CMDPs only satisfy safety "on average," and safety filters can break the convergence properties of RL algorithms by introducing non-differentiable perturbations—essentially "lying" to the agent about the actions it took. This paper introduces a single-stage, sampling-based approach that ensures hard safety constraints are satisfied throughout both training and deployment while maintaining rigorous convergence guarantees.
Methods
The core innovation is a sampling-based safety preservation method that restricts the agent's action space to a "safe set" $C(x)$ at every state $x$ from the start.
- CBF-Constrained Beta Policies: Unlike standard Gaussian policies with infinite support, the authors employ Beta distributions. These distributions have finite support, allowing them to be scaled and shifted to fit perfectly within the safe action set defined by Control Barrier Functions (CBFs). This maintains the differentiability required for policy gradient methods.
- Safe-RPG Algorithm: The authors develop the Safe Random-horizon Policy Gradient (Safe-RPG) algorithm. By sampling actions directly from the safe set, the algorithm ensures that every transition is safe by design. The authors prove that this approach maintains the $\mu$-irreducibility of the Markov chain, preserving classical convergence guarantees.
- Efficient Inner Approximation: To handle complex safe sets efficiently, the method solves a convex optimization problem at each step to find the largest hyperrectangle (a multi-dimensional box) within the safe action space, enabling fast sampling.
Experimental Setup
The approach was validated on two primary benchmarks modified with hard safety constraints:
- Safety-Constrained Inverted Pendulum: A classic control task where the pendulum's angle must remain within strict limits.
- Quadcopter Navigation: A high-fidelity simulation requiring a drone to navigate to a goal while avoiding obstacles. This task uses Exponential Control Barrier Functions (ECBFs) to manage the drone's complex, second-order dynamics.
Results and Analysis
The proposed method achieved a 100% safety rate during training, a feat not possible with standard RL or CMDP approaches. In the quadcopter navigation task, the algorithm demonstrated superior performance compared to traditional safety filters.
As shown in the learning progression above, the agent moves from wide initial exploration to discovering the goal direction and finally converging on a stable, safe path to the target. In scenarios with "interfering" obstacles—where the obstacle lies directly on the shortest path—the sampling-based approach successfully navigated around the hazard.
In contrast, projection-based filters often caused the agent to get stuck in these interfering scenarios because the projection acts as a mathematical "black box" that prevents the agent from learning how to navigate near safety boundaries. By restricting exploration to safe regions, the proposed method actually accelerates learning, as the agent does not waste time in failure-prone states.
Conclusion and Future Work
This work provides a theoretically sound and practically effective method for safe RL in nonlinear systems. By integrating safety directly into the policy's action space using Beta distributions and CBFs, the authors maintain the convergence properties of RL while providing the hard guarantees of control theory. Future research will focus on relaxing the assumption of known dynamics for the CBF, exploring methods to learn the safe set online, and deploying the algorithm on physical robotic hardware.
Summary updated