Learning-based Model Predictive Control for Safe Exploration and Reinforcement Learning

Torsten Koller, Felix Berkenkamp, Matteo Turchetta, Joschka Boedecker, Andreas KrausearXiv 2019

Abstract

Reinforcement Learning (RL) often requires risky exploration that can lead to catastrophic failures in safety-critical systems. This paper introduces a Safe Model Predictive Control (SafeMPC) framework that provides high-probability safety guarantees during learning. By modeling unknown dynamics with Gaussian Processes and propagating uncertainty via ellipsoids, the system simultaneously plans a performance-optimizing trajectory and a robust safety fallback. This allows agents to explore aggressively while maintaining a guaranteed path back to a safe state.

Introduction: The Safety Challenge in RL

Reinforcement Learning (RL) has shown remarkable success in complex tasks, but its reliance on trial-and-error exploration poses significant risks for real-world applications like robotics or autonomous driving. Standard RL algorithms typically lack rigorous safety guarantees, often resulting in constraint violations during the learning phase. While some methods aim for "expected safety," they still permit occasional large violations that could be fatal for physical hardware.

The authors address this by developing a framework that ensures an RL agent can actively explore unknown dynamics while strictly adhering to state and control constraints at all times, ensuring the system never enters an unrecoverable state.

Methodology: The SafeMPC Framework

The proposed SafeMPC algorithm integrates robust control theory with statistical learning through several key components.

Gaussian Process Modeling and Uncertainty Propagation

The system begins with an approximate prior model of the dynamics. As the agent interacts with the environment, a Gaussian Process (GP) learns the model errors from transition data. To predict future states safely, the authors utilize ellipsoidal sets to propagate uncertainty over multiple time steps.

Ellipsoidal uncertainty propagation: the next state set is an over-approximation combining nominal dynamics, learned mean corrections, and bounded disturbances.

Unlike previous methods, this approach accounts for input-dependent uncertainties, creating a reliable "tube" of possible future states that the agent can navigate. By modeling how uncertainty changes based on control inputs, the agent can deliberately explore uncertain states only if a safe return path is verified to exist.

Simultaneous Trajectory Planning

A core innovation of this work is the decoupling of safety and performance. The MPC planner solves for two trajectories simultaneously:

  1. Performance Trajectory: Optimizes the RL reward based on stochastic estimates of the system dynamics.
  2. Safety Trajectory: A robust, worst-case path that is guaranteed to return the system to a known "safe set" (a region where a backup controller can maintain stability).
Visualization of simultaneous trajectory planning: a performance trajectory (green) aims for the goal, while a safety trajectory (purple) ensures a fallback to the safe region.

By constraining the first action of both trajectories to be identical, the system ensures that every executed action is both task-optimal and has a verified "eject button." This provides recursive feasibility: if the performance path becomes infeasible in the next step due to unexpected dynamics, the system can simply execute the previously planned safe return path.

Experimental Evaluation

The framework was evaluated on two classic control benchmarks: the Inverted Pendulum and the Cart-Pole system. In the Cart-Pole RL task, the proposed SafeMPC algorithm achieved a 0.0% failure rate across all tested planning horizons. In contrast, a baseline cautious MPC (which lacked the simultaneous safety trajectory fallback) failed catastrophically, crashing in 87.5% of rollouts for short horizons.

Furthermore, in the inverted pendulum experiment, planning an additional performance trajectory drastically improved exploration efficiency. It allowed the agent to gather significantly more informative samples about the system dynamics compared to standard cautious approaches, which were often too conservative to explore effectively.

Conclusion and Future Work

By separating safety verification from performance optimization, SafeMPC enables high-performance learning without compromising physical integrity. While the approach is computationally intensive due to GP uncertainty calculations, it provides a rigorous path forward for deploying RL in safety-critical domains. Future work will focus on optimizing solver efficiency and refining the switching mechanism between performance and safety trajectories to reduce performance fluctuations caused by aggressive recovery maneuvers.

Summary updated

BibTeX
@misc{koller2019learning,
  author = {Torsten Koller and Felix Berkenkamp and Matteo Turchetta and Joschka Boedecker and Andreas Krause},
  title = {{Learning-based Model Predictive Control for Safe Exploration and Reinforcement Learning}},
  year = {2019},
  eprint = {1906.12189},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.12189},
}
Figure