Safe Reinforcement Learning Using Robust MPC

Mario Zanon, Sébastien Gros

Abstract

This paper introduces a framework for Safe Reinforcement Learning (RL) that leverages Robust Model Predictive Control (MPC) as a differentiable policy. By integrating the constraint-handling capabilities of MPC with the adaptive learning of RL, the proposed method ensures strict safety guarantees while optimizing performance through data-driven parameter updates.

Introduction

Reinforcement Learning (RL) has demonstrated significant potential in solving complex control tasks. However, its application in safety-critical domains—such as autonomous driving or chemical process control—is hindered by a lack of formal safety and stability guarantees. Standard RL often employs "black-box" Deep Neural Networks (DNNs) as policies, which are notoriously difficult to constrain. Conversely, Model Predictive Control (MPC) excels at handling constraints explicitly but is limited by the accuracy of its underlying system model. This work bridges this gap by treating a Robust MPC scheme as a differentiable function approximator for RL, creating a controller that is both optimal and provably safe.

Methodology

The core of the proposed framework is the definition of the RL policy $\pi_\theta$ as the solution to a Robust MPC problem. The learnable parameters $\theta$ include the MPC cost weights, constraint boundaries, and the description of the system's uncertainty set.

Overview of the Safe RL framework integrating Robust MPC, uncertainty set updates (Section IV), parameter optimization (Section V), and the control loop (Section III).

As illustrated in the figure above, the architecture consists of several key components:

  1. MPC as a Function Approximator: The policy is implicitly defined by the optimization problem. Sensitivity analysis based on KKT conditions allows for the computation of gradients $\nabla_\theta Q_\theta$ and $\nabla_\theta \pi_\theta$, enabling standard RL algorithms (e.g., Q-learning or Policy Gradient) to tune the MPC parameters.
  2. Uncertainty Set Management (Section IV): To reduce conservatism, the agent learns the "shape" of the system's noise. Noise samples $\mathbf{w}$ are extracted using the nominal model and aggregated into a convex hull. This provides a compact, geometrically optimal representation of uncertainty used to tighten MPC constraints.
  3. Safe-Design Constraint (SDC): A critical safety feature is the SDC, which restricts RL parameter updates. An update to $\theta$ is only permitted if the resulting MPC scheme remains feasible and safe relative to all previously observed data.
  4. Safe Exploration: During learning, exploratory actions are projected onto a provably safe set, ensuring that even random "trial-and-error" does not violate physical limits.

Experimental Evaluation

The framework was evaluated on two simulated benchmarks: a Linear Double Integrator and a Nonlinear Evaporation Process. The linear system visualized the agent's ability to adapt a noise polytope to approximate complex true noise distributions. The evaporation process, a standard chemical industry benchmark, tested the framework's ability to handle nonlinear dynamics through linearization.

Key results include:

  • Constraint Satisfaction: In both scenarios, the controller strictly respected state and input constraints throughout the entire learning and exploration process.
  • Performance Optimization: The RL-tuned MPC outperformed standard robust controllers by adjusting terminal sets and feedback gains to fit the specific task dynamics.
  • Computational Efficiency: The learning overhead was minimal; the RL parameter update step was approximately five times faster than the MPC solve itself, supporting real-time feasibility.

Discussion and Limitations

A significant insight is the concept of "$\eta$-safety," which acknowledges that absolute safety is impossible against unseen disturbances. Instead, safety is guaranteed relative to the probability that observed data represents the true system dispersion.

However, several challenges remain. The current theoretical guarantees rely on linear nominal models with additive noise. While linearization worked for the evaporation process, highly nonlinear systems might require more complex "Scenario-Tree" MPC formulations. Additionally, the use of a discount factor $\gamma < 1$ in RL complicates the stability proofs typically associated with MPC (where $\gamma = 1$).

Conclusion

By embedding Robust MPC within the RL loop, this framework provides a path toward deploying adaptive agents in safety-critical environments. The ability to learn both the reward structure and the uncertainty set allows for high-performance control that never compromises on prescribed safety limits.

Summary updated

BibTeX
@article{zanon2019safe,
  author = {Mario Zanon and Sébastien Gros},
  title = {{Safe Reinforcement Learning Using Robust MPC}},
  journal = {IEEE Transactions on Automatic Control},
  year = {2019},
  doi = {10.1109/tac.2020.3024161},
}
Figure