Exploring Under Constraints with Model-Based Actor-Critic and Safety Filters

Ahmed Agha, Baris Kayalibay, Atanas Mirchev, Patrick van der Smagt, Justin BayerCoRL 2024

TL;DR

This paper introduces "CASE," a novel approach to safe reinforcement learning (RL) for robots operating under strict constraints. By combining a constrained model-based actor-critic (CMBAC) method with a planning-based safety filter, CASE significantly reduces constraint violations during the critical learning and exploration phases, making RL more practical for real-world robotic applications.

What Problem Does This Paper Address?

Applying reinforcement learning (RL) to physical robots is challenging, especially when tasks require the robot to adhere to safety constraints at all times, even while it's still learning. Traditional RL methods can lead to unsafe behaviors during exploration, potentially damaging the robot or its environment. While constrained RL methods aim to address this, they often struggle with high sample complexity and instability, particularly in learning to satisfy constraints during the exploration phase. This paper tackles the problem of enabling safe and efficient learning for robots in environments with strict safety requirements, where exploration must be managed to prevent violations.

Methods

The core of the proposed method, "CASE" (Constrained Actor-Critic with Safety Filter), is a two-pronged approach:

  • Constrained Model-Based Actor-Critic (CMBAC): This component learns a policy that aims to maximize rewards while adhering to constraints. It leverages a learned dynamics model of the environment to simulate interactions, which is more data-efficient than model-free methods. The CMBAC uses a Lagrangian relaxation technique to handle the constraints during policy optimization.
  • Planning-Based Safety Filter: This acts as a backup policy. During exploration, if the primary policy is predicted to violate a constraint, the safety filter intervenes. It uses a model-predictive control (MPC) approach with a look-ahead horizon to plan actions that minimize constraint violations. Crucially, this filter is "pessimistic," meaning it considers the worst-case predictions from an ensemble of safety critics to account for epistemic uncertainty in the learned model. This pessimism helps it trigger interventions more reliably in uncertain situations.

The novelty lies in the synergistic combination of these two components. The CMBAC learns the primary policy, while the safety filter acts as a robust safety net during exploration, preventing violations without making the primary policy overly conservative.

Datasets

The paper evaluates CASE on several benchmarks:

  • Omnisafe: Used for constrained velocity control tasks (halfcheetah, hopper, walker, ant). These tasks involve balancing reward (moving with high velocity and correct pose) against a constraint (not exceeding a velocity limit).
  • RWRL: Used for evaluating performance on other constrained tasks.
  • Safe-control-gym: Another benchmark suite for safe learning-based control and RL in robotics.

No new benchmarks were introduced; instead, the paper leverages existing, well-established environments for evaluating safe RL algorithms.

Key Insights and Ideas

  • Safety Filter as a Crucial Exploration Aid: The safety filter is not just an add-on; it's essential for reducing constraint violations during exploration. Without it, the constrained policy alone leads to significantly more violations.
  • Pessimism for Robustness: Employing a pessimistic safety filter (considering worst-case predictions) is vital for handling epistemic uncertainty in learned models. This leads to fewer constraint violations, especially in complex environments.
  • Base Policy Rollouts Improve Planning: Including rollouts of the base policy within the safety filter's planning objective helps guide the intervention towards states where the base policy is likely to perform safely, improving overall performance.
  • Model-Based RL for Safety: The paper reinforces the idea that model-based RL approaches are more suitable for safety-critical tasks on physical robots compared to model-free methods, due to their ability to perform look-ahead control and avoid uncertain actions.

Key Results

  • Reduced Constraint Violations: CASE significantly reduces constraint violations during exploration compared to both model-free (SAC/TD3 Lagrangian, SAC/TD3 PID) and model-based baselines (LOOP, Recovery RL). For instance, in the Omnisafe benchmark, constraint violation rates are substantially lower.
  • Competitive Task Performance: Despite its focus on safety, CASE maintains competitive task performance, often matching or exceeding baselines in terms of reward.
  • Efficiency: While planning-based methods are generally less computationally efficient than purely policy-based methods, CASE achieves a reasonable runtime (around 50 Hz), making it feasible for physical systems. It outperforms LOOP in terms of runtime and computational efficiency.

Limitations and Future Work

  • No Absolute Safety Guarantees: The paper acknowledges that CASE does not provide absolute guarantees of constraint satisfaction. Achieving such guarantees would require stronger assumptions about the system dynamics (e.g., smoothness, availability of safe terminal sets), which are not always applicable in real-world scenarios.
  • Computational Cost of Planning: Online planning, while beneficial for safety, can be computationally expensive, which is a general limitation of planning-based RL methods.
  • Limited to Fully Observable Systems: The current implementation of the learned transition model is restricted to fully observable environments. Future work aims to extend this to partially observable systems by leveraging models that can learn dynamics in such settings.
  • Potential for Oscillation: The authors note that previous safety filtering methods sometimes exhibit oscillatory behavior. While CASE aims to mitigate this, it's an area for continued research.

Summary updated

BibTeX
@inproceedings{agha2024exploring,
  author = {Ahmed Agha and Baris Kayalibay and Atanas Mirchev and Patrick van der Smagt and Justin Bayer},
  title = {{Exploring Under Constraints with Model-Based Actor-Critic and Safety Filters}},
  booktitle = {Conference on Robot Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=s31IWg2kN5},
}
Figure