TL;DR
This paper introduces Adaptive Probabilistic Shielding, a novel framework for safe reinforcement learning (RL) that operates when environment transition probabilities are unknown. By interleaving online model learning with dynamic shield recomputation, the framework allows an RL agent to safely explore its environment, refining its protective "shield" in tandem with its policy.
What Problem Does This Paper Address?
Reinforcement learning agents learn by trial and error, which inherently means they will make catastrophic mistakes during training if left unchecked. To prevent this, researchers use a technique called shielding—a supervisor that monitors the agent's proposed actions and blocks them if they violate safety constraints.
Traditionally, computing a probabilistic shield requires knowing the exact transition probabilities of the underlying Markov Decision Process (MDP) beforehand. But in real-world applications, these probabilities are rarely known. Learning the model offline first doesn't solve the problem either, as data collection itself can be dangerously unsafe. This paper tackles a realistic middle ground: How can we ensure safety during training when the environment's structure (topology) is known, but the exact transition probabilities are completely unknown?
Methods
The authors propose an integrated, online learning loop that combines policy learning, model estimation, and shield construction.
The core workflow operates as follows:
- Data Collection: As the agent interacts with the environment, a transition database records the frequency of observed state-action-state triples.
- Model Estimation: The framework uses this data to build an approximation of the environment. The authors evaluate three estimators:
- MAP (Maximum A-Posteriori): A standard point estimate of probabilities.
- PAC (Probably Approximately Correct): Uses Hoeffding's inequality to construct mathematically bounded intervals of probabilities.
- LUI (Linearly Updating Intervals): An iterative interval estimator without strict PAC guarantees but with lower data requirements.
- Shield Synthesis: Using the state-of-the-art probabilistic model checker PRISM, a new shield is computed from the estimated model every $u$ episodes. The shield can be robust (pessimistic, assuming worst-case transitions) or optimistic (assuming best-case transitions).
- Unshielded Exploration: Crucially, during the random exploration phase ($\epsilon$-greedy), the agent is allowed to choose actions outside the shield's recommendations. This deliberate risk-taking allows the model estimator to gather data on unknown transitions, preventing the shield from remaining permanently over-conservative.
Datasets
The authors evaluated their approach across five simulated environments featuring mixed safety and optimization objectives:
- Aircraft: A collision avoidance benchmark from literature where an aircraft must maintain vertical distance from a randomly moving opponent.
- Antlion: A new benchmark where an agent must navigate around a stationary predator to reach a goal.
- Sinkholes: A new environment with multiple goals and hazardous holes that return the agent to the start.
- Crossroads: A deferred-risk benchmark forcing a choice between a safe, low-reward path and a risky, high-reward path.
- Gravity: A benchmark where the agent collects checkpoints near a dangerous gravity well.
Key Insights and Ideas
- The Exploration-Safety Dilemma: An overly conservative shield can trap an agent in a "safety lock," preventing it from exploring the environment enough to learn that certain paths are actually safe.
- Unshielded Exploration is a Necessity: Counterintuitively, allowing the agent to occasionally disregard the shield during random exploration steps is vital. Without this "unshielded exploration," the agent fails to uncover optimal routes because the shield blocks it from gathering the data needed to relax its own boundaries.
- Robust Isn't Always Better: Robust (pessimistic) shields do not always yield the safest final policies. Because they are highly conservative early on, they often force the agent to settle for an imperfect, early-discovered route, ignoring potentially safer alternatives that require initial exploration.
Key Results
- Oracle-Level Safety: Across most environments, the adaptive shield limited training safety violations to nearly the same low level as an "oracle" shield that had perfect, a priori knowledge of the true MDP.
- Superiority Over Unshielded RL: Standard RL with reward shaping frequently caused massive safety violations during training (e.g., a 99.2% unsafe episode rate in the Gravity environment), whereas the adaptive robust LUI estimator kept violations to a fraction of that while still achieving solid rewards.
- Estimator Performance: Interval-based estimators (LUI and PAC) significantly outperformed the point-estimate MAP approach. The MAP estimator frequently suffered from severe under-exploration, failing to even leave the initial states in the Antlion environment.
Limitations and Future Work
The primary limitation of this work is the assumption of a known topology—the agent must know which transitions are possible, even if it doesn't know their probabilities. It also assumes a finite, discrete state space.
For future work, the authors suggest:
- Dynamic Safety Thresholds: Starting with an optimistic shield to encourage early exploration, and gradually tightening the safety threshold ($\theta$) as training progresses to guarantee final safety.
- Biased Exploration: Replacing uniformly random exploration with smart, model-based exploration techniques that target under-explored states specifically.
Summary updated