Abstract
Reinforcement Learning (RL) often prioritizes reward maximization at the expense of safety, a significant barrier to deployment in safety-critical domains. While shielding offers a mechanism to override unsafe actions, traditional approaches rely on hand-coded environment models. We present Approximate Model-Based Shielding (AMBS), a framework that learns a world model and employs safety critics to estimate long-term risks. AMBS significantly reduces safety violations in complex Atari environments while maintaining or exceeding the performance of standard RL agents.
Introduction
Reinforcement Learning (RL) has demonstrated remarkable success in complex games, yet its "trial-and-error" nature is inherently risky. In safety-critical applications—such as autonomous driving or industrial robotics—exploratory failures are unacceptable. Shielding has emerged as a prominent solution, acting as a monitor that intercepts and corrects unsafe actions. However, classical shielding requires a perfect, pre-defined model of environment dynamics and safety constraints, which is rarely available in real-world scenarios. Previous attempts to use learned models, such as latent shielding, often suffered from "short-sightedness," failing to account for dangers just beyond their simulation horizon.
The AMBS Framework
AMBS addresses these limitations by integrating safety directly into a model-based RL architecture, specifically building upon the DreamerV3 architecture. The framework consists of four primary pillars:
- World Model Learning: The agent learns a compact "latent" representation of the environment. This allows the agent to "imagine" future trajectories and consequences without actually taking actions in the real world.
- Safety Critics: To overcome the "short-sightedness" of finite-horizon simulations, AMBS utilizes neural safety critics. These networks are trained to estimate the long-term probability of safety violations, effectively "bootstrapping" safety estimates beyond the immediate simulation horizon.
- PCTL Formalism: The authors employ Probabilistic Computation-tree Logic (PCTL) to define "bounded safety." This provides a rigorous mathematical language to ensure the probability of a violation within $n$ steps remains below a specific threshold $\Delta$.
- Shielding Procedure: During interaction, the agent samples multiple "imaginary" futures for a proposed action. If the safety critic indicates the estimated safety does not meet the PCTL threshold, the shield overrides the action with one from a learned "safe policy."
Experimental Evaluation
The researchers evaluated AMBS on five Atari games (Assault, DoubleDunk, Enduro, KungFuMaster, and Seaquest) using state-dependent safety labels. These games provide diverse safety challenges: in Seaquest, the agent must manage oxygen levels; in Enduro, it must avoid collisions; and in KungFuMaster, it must preserve lives and energy.
AMBS was compared against vanilla DreamerV3, a Lagrangian-based safety method (LAG), and state-of-the-art model-free agents including Rainbow and IQN.
Key Results and Insights
Massive Violation Reduction
AMBS demonstrated a dramatic decrease in safety violations during the training process. In KungFuMaster, the vanilla agent committed approximately 427,000 violations, while AMBS committed only 11,000—a 97% reduction. This highlights the effectiveness of the shield even as the world model is being learned.
Performance Gains as Inductive Bias
Contrary to the assumption that safety constraints necessarily hinder performance, AMBS often outperformed vanilla agents. In Assault, AMBS achieved a best score of 44,467, compared to just 14,738 for the standard DreamerV3. This suggests that safety constraints can act as a useful "inductive bias," helping the agent prune useless parts of the search space and focus on high-reward, long-lasting trajectories.
Theoretical Grounding
Beyond empirical success, the paper provides PAC-style probabilistic bounds. For tabular environments, the authors prove exactly how many samples are needed to guarantee a specific level of safety estimation accuracy, bridging the gap between deep RL and formal verification.
Limitations and Future Work
Despite its success, AMBS faces a "cold start" problem: because the world model and safety critics are learned from scratch, the agent still commits violations early in training. Potential solutions include "jump-starting" the process with offline expert data. Additionally, while more efficient than classical formal verification, running Monte Carlo simulations in a latent space at every timestep adds computational overhead. Future work will explore more complex, high-dimensional benchmarks like SafetyGym.
Conclusion
AMBS represents a significant step toward autonomous agents that can learn safely in complex environments without prior knowledge of system dynamics. By combining learned world models with safety critics and formal logic, it provides a robust framework for balancing exploration with the necessity of safety.
Summary updated