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

Safe Model-based Reinforcement Learning with Stability Guarantees

Felix Berkenkamp, Matteo Turchetta, Angela P. Schoellig, Andreas Krause

Reinforcement learning (RL) has achieved legendary status in virtual environments, from mastering Atari games to defeating world champions in Go. However, when it comes to the messy, physical world of robotics, RL often hits a wall—or more literally, the robot hits a wall. Standard RL relies on exploratory "trial and error," which is a polite way of saying "crashing until you learn not to."

In their paper "Safe Model-based Reinforcement Learning with Stability Guarantees," Felix Berkenkamp and colleagues from ETH Zurich and the University of Toronto propose a way to let robots learn without catastrophic failures.

TL;DR: This paper introduces a model-based RL framework that uses Lyapunov stability theory and Gaussian Processes to provide high-probability safety guarantees during learning. It allows an agent to safely explore and expand its "safe region" while optimizing a policy, ensuring the system never enters an unrecoverable state.

The Problem: Exploration vs. Exploitation in the Real World

The fundamental tension in RL is exploration vs. exploitation. To find an optimal policy, an agent must try new, unknown actions. In a simulation, a "crash" is just a reset button away. In the real world, a crash can destroy a multi-million dollar drone or endanger humans.

Existing "Safe RL" methods often define safety as staying within certain state constraints or minimizing a risk-sensitive reward. However, these rarely provide formal guarantees of stability—the ability of a system to recover to a desired state (like a car staying in its lane or a drone remaining level). The authors tackle the challenge of learning an optimal policy for continuous state-action spaces while guaranteeing that the system remains within a provably safe region at all times.

Methods: Control Theory Meets Statistical Learning

The authors combine two powerful tools to achieve guaranteed safety during learning:

  1. Dynamics Modeling with Gaussian Processes (GPs): They model the system dynamics as $x_{t+1} = h(x_t, u_t) + g(x_t, u_t)$. Here, $h$ is a known (but likely imperfect) physics model, and $g$ represents the unknown errors. They use a GP to model $g$, which provides not just a prediction, but a measure of uncertainty (variance).
  2. Lyapunov Stability: This is a classic control theory concept. If you can find a "Lyapunov function" $v(x)$—think of it as an energy function—that always decreases as the system moves, you can prove the system will eventually reach its goal. The set of states where this decrease is guaranteed is called the Region of Attraction (ROA).
  3. The SAFELYAPUNOVLEARNING Algorithm:
    • Safety Verification: Using the GP's uncertainty, the algorithm identifies a "safe" level set of the Lyapunov function where, even in the worst-case scenario within a high-probability confidence interval, the system remains stable.
  4. Safe Exploration: The agent only collects data at points that are informative (high uncertainty) but still within the current safe ROA.
  5. Policy Optimization: The policy (a neural network) is updated to maximize performance, but it is constrained by a Lagrangian formulation to ensure it doesn't shrink the proven safe region.

Key Insights

  • Uncertainty as a Safety Buffer: By using the GP's confidence intervals, the algorithm is "pessimistic" about safety. It only considers a state safe if the worst-case outcome under current model uncertainty is still stable.
  • The Virtuous Cycle of Learning: As the agent collects data within the safe zone, the GP's uncertainty shrinks. This allows the algorithm to "prove" that more distant states are safe, naturally expanding the ROA over time.
  • Stability as a Constraint, Not Just a Reward: Instead of just penalizing "falling," the stability requirement is baked into the policy optimization as a hard constraint.

Key Results

The primary evaluation is conducted on a simulated inverted pendulum benchmark. While a classic problem, it is highly relevant because the system is inherently unstable; if the controller fails, the pendulum falls, representing a "system failure."

The researchers demonstrated that their algorithm could safely optimize a neural network policy for the inverted pendulum without it ever falling down during the learning process.

  • ROA Expansion: The algorithm significantly increased the size of the provably safe region compared to the initial, conservative policy.
  • Performance Gains: The final policy was not just safe, but also high-performing, outperforming the initial policy based on the imperfect prior physics model.

Limitations and Future Work

While groundbreaking, the approach has limitations:

  • Discretization: To verify stability, the authors currently discretize the state space. This leads to the "curse of dimensionality," making it difficult to scale to complex robots with many joints.
  • Prior Knowledge: The method requires a candidate Lyapunov function and an initial (even if very poor) safe policy to start the process.
  • Computational Overhead: Updating GPs and verifying stability level sets is computationally more expensive than standard model-free RL methods like PPO or SAC.

Future work will likely focus on finding ways to verify stability in high-dimensional spaces without exhaustive discretization, perhaps through the use of neural Lyapunov functions.

Summary updated

BibTeX
@inproceedings{berkenkamp2017safe,
  author = {Felix Berkenkamp and Matteo Turchetta and Angela P. Schoellig and Andreas Krause},
  title = {{Safe Model-based Reinforcement Learning with Stability Guarantees}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
}
Figure