SAMBA: Safe Model-Based & Active Reinforcement Learning

Alexander I. Cowen-Rivers, Daniel Palenicek, Vincent Moens, Mohammed Amin Abdullah, Aivar Sootla, Jun Wang, Haitham Ammar · OpenReview

TL;DR

This paper introduces SAMBA, a novel safe reinforcement learning framework that combines probabilistic modeling with active exploration. SAMBA addresses the critical challenge of learning safe policies in real-world applications by efficiently exploring environments while strictly adhering to safety constraints, significantly reducing sample complexity and safety violations compared to existing methods.

What Problem Does This Paper Address?

Reinforcement learning (RL) has achieved remarkable success in simulated environments, but its application to real-world safety-critical domains like robotics or autonomous driving is hindered by two major challenges: sample inefficiency and the need for safety. Traditional RL methods often require millions of interactions, which is impractical and potentially dangerous in real-world scenarios. Furthermore, random exploration can lead to catastrophic failures and high operating costs. Existing safe RL approaches often rely on strong assumptions about the environment's dynamics or require a safe initial policy, which are not always available. This paper tackles the problem of developing sample-efficient RL algorithms that can learn safe policies without prior knowledge of the environment's dynamics or a safe starting point, focusing on achieving safe final policies.

Methods

SAMBA builds upon the model-based reinforcement learning framework of PILCO, which uses Gaussian Processes (GPs) for probabilistic modeling of the environment's dynamics. The key innovations in SAMBA are:

  • Novel Active (Semi-)Metrics: SAMBA introduces two new metrics, "Leave-One-Out" (LOO) and "Bootstrap," for active exploration. These metrics guide the agent to explore regions that are informative for improving the GP model while staying close to known safe regions. This is a departure from traditional entropy-based exploration, which can lead agents into unsafe areas.
  • Constrained Bi-Objective Formulation: The problem is framed as a bi-objective optimization problem that simultaneously aims to minimize expected cost and maximize information gain (guided by the new metrics), subject to a safety constraint.
  • Conditional Value-at-Risk (CVaR) Constraint: Safety is enforced using CVaR constraints, a robust risk measure that limits the average cost of tail events (i.e., violations beyond a certain risk level). This is more flexible than simple expectation constraints.
  • Policy Multi-Gradient Solver: A novel solver is developed to handle the bi-objective and constrained optimization problem, using policy gradients and neural network critics to estimate advantages and update the policy.

Datasets

The paper evaluates SAMBA on three benchmark environments:

  • Safe Pendulum: An adaptation of the standard pendulum environment with defined unsafe regions.
  • Safe Cart-Pole Double Pendulum: An adaptation of the Cart-Pole Double Pendulum environment with defined unsafe regions.
  • Safe Fetch Robot: An adaptation of the Fetch Robot environment from OpenAI's robotics environments, where the goal is to optimally control the end-effector to reach a 3D goal, with defined unsafe regions based on the end-effector's position.

Key Insights and Ideas

  • Active exploration can be dangerous: Traditional entropy-based exploration, while good for model learning, can actively drive agents into unsafe regions, which is counterproductive for safe RL.
  • LOO and Bootstrap metrics guide safe exploration: The proposed LOO and Bootstrap metrics are crucial for directing exploration towards informative areas that are also close to known safe data, effectively balancing learning and safety.
  • CVaR is a powerful tool for safety: Using CVaR as a safety constraint provides a flexible and principled way to manage risk in tail events, allowing for a controlled level of violations rather than demanding absolute safety.
  • Model-based RL is key for sample efficiency in safe RL: By learning a model of the environment, SAMBA can generate many simulated trajectories for policy improvement, drastically reducing the need for real-world interactions.

Key Results

  • Significant Reduction in Samples and Violations: SAMBA achieved orders of magnitude reductions in training samples and safety violations (TC and TV) compared to state-of-the-art model-free and model-based methods across all tested benchmarks.
  • Competitive Performance: SAMBA demonstrated competitive expected returns while being significantly safer than other methods, often outperforming them in terms of CVaR constraints.
  • Effective Active Metrics: Visualizations (Figure 3, 4, 5) clearly show that the LOO and Bootstrap metrics encourage exploration in safe regions, unlike entropy-based metrics which tend to explore hazardous areas.
  • Robust Model Learning: Figure 6 and 7 show that the GP dynamics models learned by SAMBA can accurately capture the system dynamics, even with limited data.

Limitations and Future Work

  • Guaranteed total safety is not provided: The paper acknowledges that absolute safety cannot be guaranteed without strong assumptions on dynamics or an initial safe policy. SAMBA aims to limit risk and violations according to the CVaR constraint.
  • Generalization to Variational GPs: The authors plan to generalize their method to variational GPs for potentially improved scalability and performance.
  • Real-world robotics application: The paper suggests applying the method to real-world robotics tasks.
  • Theoretical Guarantees: Further study is planned to investigate the theoretical guarantees of SAMBA regarding convergence to well-behaving, exploratory, and safe policies.

Summary updated

BibTeX
@article{cowenrivers2022samba,
  author = {Alexander I. Cowen-Rivers and Daniel Palenicek and Vincent Moens and Mohammed Amin Abdullah and Aivar Sootla and Jun Wang and Haitham Ammar},
  title = {{SAMBA: Safe Model-Based \& Active Reinforcement Learning}},
  journal = {Machine Learning},
  year = {2022},
  doi = {10.1007/s10994-021-06103-6},
}
Figure