NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Safe Reinforcement Learning Using Robust Control Barrier Functions

Yousef Emam, Gennaro Notomista, Paul Glotfelter, Zsolt Kira, Magnus Egerstedt

TL;DR

This paper introduces a novel framework for safe reinforcement learning (RL) by integrating Robust Control Barrier Functions (RCBFs) into a Soft Actor-Critic (SAC) algorithm. This approach not only ensures safety during exploration but also improves learning efficiency and enables modular task learning, leading to better transferability to new environments with different safety constraints.

What Problem Does This Paper Address?

Reinforcement learning (RL) has shown great promise in various applications, but its inherent need for extensive exploration can lead to unsafe states, making it unsuitable for safety-critical systems. Existing safe RL methods often struggle with scalability, require extensive prior knowledge, or fail to effectively integrate safety constraints into the learning process. A key challenge is how to ensure safety during the entire training process, not just at the end, and how to decouple the learning of the core task from potentially arbitrary safety constraints that might change between training and deployment.

Methods

The core contribution is a framework called SAC-RCBF, which combines a standard Soft Actor-Critic (SAC) RL algorithm with a Robust Control Barrier Function (RCBF) based safety layer.

  • RCBF Safety Layer: Instead of traditional Control Barrier Functions (CBFs), the paper uses RCBFs, which are more general and can handle non-affine dynamics and disturbances. This layer acts as a wrapper around the RL agent's actions, projecting them onto a safe set of actions.
  • Differentiable Safety Layer: A key innovation is making the safety layer differentiable. This allows gradients to flow back through the safety layer to the RL agent's policy and value functions. This explicit accounting for the safety layer's influence significantly improves learning performance and sample efficiency.
  • Disturbance Estimation: The framework uses Gaussian Processes (GPs) to learn an estimate of the unknown disturbances in the system dynamics. This learned disturbance estimate is then used by the RCBF to ensure safety.
  • Modular Task Learning: The paper proposes a method to learn the reward-driven task (e.g., reaching a goal) independently of specific safety constraints encountered during training. This is achieved by modifying the Bellman update to ignore the safety layer's influence when computing the cost-to-go, leading to a value function that is not overly penalized by temporary safety constraints.
  • Model-Based Enhancement: For further sample efficiency, the framework can leverage a learned dynamics model to generate synthetic data for training.

Datasets

The paper does not introduce new datasets. Instead, it uses custom-built simulated environments for evaluation:

  • Unicycle Environment: A unicycle robot navigating to a goal while avoiding obstacles.
  • Car Following Environment: A chain of five cars where the agent controls one car and must maintain safe distances.
  • PVTOL Environment: A 2D quadcopter tasked with reaching a goal while avoiding obstacles and a safety pilot.

These environments are designed to test specific aspects like obstacle avoidance, collision avoidance, and the impact of safety constraints on learning and transfer.

Key Insights and Ideas

  • Differentiable Safety is Crucial: Explicitly accounting for the safety layer's impact on the RL agent's objective function (through backpropagation) is vital for efficient learning and achieving optimal policies, not just safe ones.
  • Modularity for Transferability: Decoupling the core task learning from specific safety constraints during training is essential for enabling policies to transfer effectively to new environments with different safety requirements.
  • RCBFs Offer Robustness: The use of Robust Control Barrier Functions allows for handling more complex and realistic system dynamics with unknown disturbances, making the safety layer more broadly applicable.
  • Safety Layer Affects Value Function: The safety layer's modifications to actions during training can significantly alter the learned value function, making it difficult for the agent to learn a task-independent representation.

Key Results

  • Improved Sample Efficiency: Both Model-Based (MB) and Model-Free (MF) SAC-RCBF significantly outperform baselines in terms of sample efficiency across various environments, demonstrating the benefits of the differentiable safety layer and model-based data augmentation.
  • Enhanced Transferability: The proposed Modular SAC-RCBF approach shows a substantial improvement in zero-shot transfer performance compared to standard SAC-RCBF and baselines. For instance, in the Unicycle environment, it achieved a 63% completion rate compared to 17% for SAC-RCBF.
  • Safety Guaranteed: Across all experiments, no safety violations were observed, validating the effectiveness of the RCBF-QP in keeping the system safe during training.
  • Value Function Independence: Modular SAC-RCBF successfully learns a value function that is nearly identical to one trained without any safety constraints, indicating successful decoupling of the task from safety.

Limitations and Future Work

  • Computational Cost: Explicitly accounting for the RCBF-QP in the RL losses increases computation time during training, although inference time remains the same.
  • Discrete-Time Approximation: The framework relies on discretizing continuous-time dynamics, which has no effect on safety but is an approximation.
  • Future Work: The authors suggest extending the framework to non-safety-critical CBFs and exploring more advanced techniques for handling actuator constraints and stochastic disturbances. They also mention leaving modifications for handling large time steps (At) to future work.

Summary updated

BibTeX
@article{emam2025safe,
  author = {Yousef Emam and Gennaro Notomista and Paul Glotfelter and Zsolt Kira and Magnus Egerstedt},
  title = {{Safe Reinforcement Learning Using Robust Control Barrier Functions}},
  journal = {IEEE Robotics Autom. Lett.},
  year = {2025},
  doi = {10.1109/lra.2022.3216996},
}
Figure