SAMBA: safe model-based & active reinforcement learning

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

Abstract

Reinforcement learning (RL) has achieved remarkable success in simulated environments, yet its application to real-world physical systems remains limited by two critical factors: sample inefficiency and the risk of catastrophic failure during exploration. We present SAMBA (Safe Model-Based & Active RL), a framework designed to bridge this gap. SAMBA utilizes Gaussian Processes for probabilistic dynamics modeling, a novel "safety-aware" active learning acquisition function, and Conditional Value-at-Risk (CVaR) constraints. Our results demonstrate that SAMBA achieves orders of magnitude better sample efficiency than model-free baselines while maintaining strict safety constraints throughout the learning process.

Introduction

While RL agents have mastered complex games, transitioning these algorithms to robotics or autonomous vehicles is hazardous. Standard model-free RL requires millions of interactions, and its inherent trial-and-error nature often leads to safety violations that can damage hardware or the environment. Existing safe RL methods frequently rely on pre-existing safe policies or restrictive physical assumptions. SAMBA addresses these challenges by enabling safe and efficient learning from scratch.

Methodology

The SAMBA framework is built upon three core technical innovations:

1. Gaussian Process Dynamics

Rather than relying solely on real-world interactions, SAMBA constructs a probabilistic model of the environment using Gaussian Processes (GPs). This model allows the agent to simulate potential trajectories, evaluating both expected costs and safety risks before executing actions in the physical world.

2. Safety-Aware Active Learning

Traditional exploration strategies often maximize entropy, driving agents toward high-uncertainty regions. In safe RL, this is dangerous, as high uncertainty often correlates with high risk. SAMBA introduces the Leave-One-Out ($\zeta_{LOO}$) acquisition function. This function prioritizes exploration in regions that provide new information but remain "safe-adjacent"—close enough to known data to ensure predictable behavior.

3. Robust Safety with CVaR

Most safe RL algorithms optimize for "average" safety. However, in high-stakes environments, average performance is insufficient. SAMBA employs Conditional Value-at-Risk (CVaR), a statistical measure that focuses on the "tail" of the risk distribution. By penalizing worst-case scenarios, SAMBA ensures the agent avoids rare but catastrophic failures.

Experimental Results

We evaluated SAMBA across five benchmarks, including Safe Pendulum, Safe Fetch Reacher, and OpenAI Safety Gym tasks.

  • Sample Efficiency: SAMBA outperformed model-free baselines like PPO and TRPO by orders of magnitude. In the Pendulum task, SAMBA converged in approximately 1.6k samples, whereas model-free methods failed to reach comparable performance even after 1,000k samples.
  • Safety Performance: During training, SAMBA significantly reduced safety violations. In the Safety Gym "Car" environment, total violations were reduced by over 80% compared to Constrained Policy Optimization (CPO).
  • Constraint Adherence: SAMBA consistently satisfied safety constraints throughout both the training and evaluation phases, demonstrating its ability to learn safely rather than just producing a safe final policy.

Conclusion and Future Work

SAMBA represents a significant step toward deploying RL in safety-critical real-world applications. While the current implementation faces computational bottlenecks due to the $O(n^3)$ complexity of exact Gaussian Processes, future iterations will explore Variational GPs to scale to higher-dimensional systems. By balancing the need for information gain with rigorous safety thresholds, SAMBA provides a robust foundation for autonomous learning in the physical world.

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 Bou-Ammar},
  title = {{SAMBA: safe model-based \& active reinforcement learning}},
  journal = {Machine Learning},
  year = {2022},
  doi = {10.1007/s10994-021-06103-6},
}
Figure