Reinforcement Learning with Adaptive Regularization for Safe Control of Critical Systems

Haozhe Tian, Homayoun Hamedmoghadam, Robert Noel Shorten, Pietro Ferraro

TL;DR

RL-AR (Reinforcement Learning with Adaptive Regularization) ensures zero safety violations during the training of RL agents by blending a model-free policy with a "hard-coded" safe controller (like Model Predictive Control). Using a state-dependent "focus module," the system prioritizes safety in unexplored states while allowing the agent to converge to optimal, high-performance behavior in well-understood environments.

The Problem: Exploration vs. Catastrophe

Reinforcement Learning (RL) is famous for mastering complex games, but its inherent "trial-and-error" learning mechanism makes it dangerous for "single-life" critical systems. You cannot allow a nuclear fusion reactor to overheat or a surgical robot to make a stray cut just so an agent can "explore" the state space.

Existing "Safe RL" methods often fall into two traps:

  1. Safety only after training: They might be safe once fully deployed, but they crash frequently during the learning phase.
  2. Computational Overhead: Methods that verify every action in real-time are often too slow for high-speed physical control.

The authors aim to bridge the gap between classic control (which is safe but relies on perfect models) and RL (which is adaptive but risky).

Methods: The RL-AR Algorithm

The core of the paper is the RL-AR algorithm, which utilizes three main components to balance safety and exploration:

  1. The Safety Regularizer (MPC): A constrained Model Predictive Controller that uses an estimated (and potentially imperfect) model of the environment. It forecasts future states and "hard-codes" safety constraints to prevent the system from entering failure states.
  2. The Adaptive Agent (SAC): A standard off-policy Soft Actor-Critic agent that learns from actual interactions to maximize rewards and adapt to the real environment's nuances.
  3. The Focus Module ($\beta$): This is the novel "blender." It is a neural network that outputs a state-dependent weight $\beta(s) \in [0, 1]$.

The final action taken by the system is a weighted combination: $a = \beta \cdot a_{safe} + (1 - \beta) \cdot a_{RL}$.

At the start of training, $\beta$ is initialized near 1 (trusting the safe controller). As the agent explores, $\beta$ is updated via gradient ascent to maximize the expected return, naturally shifting control to the RL agent as it proves its performance in specific states.

Environments and Evaluation

The researchers evaluated RL-AR on simulated safety-critical environments, focusing on scenarios with significant parameter mismatch (where the model used for safety is different from the "real" world):

  • Glucose & BiGlucose: Medical simulations for regulating blood sugar in Type 1 diabetes patients. Failure (hypoglycemia) is catastrophic.
  • CSTR (Continuous Stirred Tank Reactor): A chemical engineering benchmark where improper temperature control leads to tank failure or explosion.
  • Cart Pole & Acrobot: Classic physics tasks adapted with continuous action spaces and strict boundary/time constraints.

Key Insights

  • State-Dependent Blending is Key: Previous attempts often used a single global value to blend policies. RL-AR’s focus module learns that some states are "safe" (letting the RL agent take over) while others are "danger zones" (keeping the MPC in charge).
  • Robustness to Imperfect Models: The paper demonstrates that even if the initial model used by the MPC has a 60% parameter mismatch compared to reality, RL-AR still prevents failures. The RL agent learns to compensate for the MPC's inaccuracies.
  • Theoretical Guarantees: The authors provide proofs showing that this blending acts as a form of policy regularization and that the focus module does not prevent the agent from eventually reaching the true optimal policy.

Key Results

Training Performance and Failures
  • Zero Failures: In the first 100 training episodes across all tasks, RL-AR recorded 0 failures. In contrast, standard SAC failed up to 99% of the time, and other "safe" benchmarks (like CPO or SEditor) still suffered dozens of failures before learning to be safe.
  • Competitive Returns: Once converged, RL-AR matched or exceeded the performance of unconstrained RL agents. It achieved faster regulation and less oscillation than using MPC alone.
  • Real-Time Viability: The average decision time was approximately 0.037 seconds, making it fast enough for real-time hardware applications where millisecond-level responses are required.

Limitations and Future Work

  • The "Reasonable Model" Assumption: RL-AR still requires an initial estimated model that is "good enough" to derive a viable starting policy. If the initial model is completely detached from reality, the safety regularizer might fail before the RL agent has a chance to learn.
  • Online Model Updates: The authors suggest that future work could involve updating the estimated model in real-time using observed data, which would make the safety regularizer even more robust to initial inaccuracies.
  • Scaling to Higher Dimensions: While tested on complex systems like BiGlucose (12 states), further testing is needed for extremely high-dimensional state spaces (e.g., raw video input).

Summary updated

BibTeX
@inproceedings{tian2024reinforcement,
  author = {Haozhe Tian and Homayoun Hamedmoghadam and Robert Noel Shorten and Pietro Ferraro},
  title = {{Reinforcement Learning with Adaptive Regularization for Safe Control of Critical Systems}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=MRO2QhydPF},
}
Figure