TL;DR
This paper demonstrates that incorporating safety filters—mechanisms that override unsafe actions—directly into the Reinforcement Learning (RL) training process significantly improves performance and sample efficiency. By making the RL agent "aware" of the safety filter through action filtering, reward penalties for corrections, and safe resets, the authors achieved 80% of peak performance 10 times faster than standard methods while eliminating crashes during training.
What Problem Does This Paper Address?
Reinforcement Learning (RL) is powerful for robotics but notoriously "unsafe" during the learning phase; agents often explore by crashing or violating constraints. To fix this, researchers often use safety filters (like a "shield") that sit between the controller and the robot, minimally correcting unsafe commands to ensure the robot stays within a safe state.
However, there is a catch: if the RL agent is trained without knowing the filter exists, it may persistently propose unsafe actions. This leads to chattering—high-frequency oscillations where the agent tries to go one way and the filter pushes back—and poor overall performance because the agent hasn't learned to navigate the "certified" system. The authors tackle how to bridge this gap between the learning agent and its safety constraints.
Methods
The authors analyze three specific modifications to the training process of a Proximal Policy Optimization (PPO) agent using Model Predictive Safety Filters (MPSFs):
- Filtering Training Actions (FA): Instead of the agent learning from its original (potentially unsafe) action, it learns from the corrected safe action actually executed by the robot. This ensures the agent's internal model matches the reality of the protected system.
- Penalizing Corrections (PC): The reward function is modified to penalize the agent based on the magnitude of the correction made by the filter. This encourages the agent to stay away from the boundaries of the safe set.
- Safely Resetting the Environment (SR): Episodes are only allowed to start from states where the safety filter can guarantee a safe future trajectory (the $H$-step robust positively control invariant set). This prevents "doomed" starts that waste training time.
Datasets
The researchers evaluated their approach using:
- safe-control-gym: A specialized simulation environment for safety-critical control. They focused on a 3D quadrotor (drone) tracking a figure-eight trajectory.
- Real-world Experiments: They deployed the trained models on a Crazyflie 2.0 nano-quadrotor to validate the sim-to-real performance and chattering reduction.
Key Insights and Ideas
- The "Shield" is a Teacher, not just a Guard: By training on the filtered actions, the agent treats the safety filter as an expert guide. This prevents the agent from becoming dependent on the filter in a way that causes instability.
- Sample Efficiency through Constraint: Counter-intuitively, adding constraints made learning faster. Because the agent was prevented from entering "useless" unsafe states (like crashing), it spent all its time exploring high-quality, safe regions of the state space.
- Smoothness Matters: Chattering is a major issue in real robotics. The authors found that penalizing the magnitude of the filter's correction (how much the "shield" had to move the agent's hand) was far more effective at producing smooth, flyable trajectories than a simple flat penalty for "being unsafe."
Key Results
- Speed: The "Safe" approach (combining FA, PC, and SR) reached 80% of its final return 10 times faster than standard training.
- Efficiency: It surpassed a return of 200 with 2.5 times fewer environment interactions.
- Safety: In simulation, the proposed modifications reduced training constraint violations to nearly zero (0.22% vs. 82.8% for the baseline).
- Real-world Performance: On the physical Crazyflie drone, the safe training approach increased the total return by up to 20% and reduced the "rate of change of inputs" (a proxy for chattering) by up to 35% compared to the baseline.
Limitations and Future Work
- Computational Overhead: Using an MPSF during training is computationally expensive. The "Safe" approach was roughly five times slower per training step than the baseline because it requires solving an optimization problem at every tick.
- Model Dependency: The safety filter relies on a "nominal model" of the system's physics. If this model is highly inaccurate, the safety guarantees may degrade.
- Future Directions: The authors suggest exploring Control Barrier Functions (CBFs) as an alternative to MPSFs to reduce the computational load, as well as investigating how these modifications perform in even more complex, high-dimensional environments.
Summary updated