SPoRt - Safe Policy Ratio: Certified Training and Deployment of Task Policies in Model-Free RL

Jacques Cloete, Nikolaus Vertovec, Alessandro Abate · DOI

Abstract

Reinforcement Learning (RL) often lacks safety guarantees during the exploration phase, making it difficult to deploy in safety-critical environments. We present SPoRt (Safe Policy Ratio), a framework that establishes a certified bound on the probability of safety violations. By constraining the ratio between a new task policy and a known safe base policy, SPoRt allows for a controlled trade-off between performance and safety. This bound holds throughout the training process, providing a mathematical safety net for model-free RL without requiring precise environment dynamics.

1. Introduction

Standard Reinforcement Learning algorithms, such as Proximal Policy Optimization (PPO), rely on trial-and-error exploration. In real-world applications like robotics or autonomous driving, this "reckless" exploration can lead to catastrophic failures. While existing "Safe RL" methods attempt to mitigate these risks, they often fall short in model-free settings. Constrained MDPs (CMDPs) typically bound average costs rather than individual trajectory violations, and Safety Filters often require precise physical models that are unavailable in complex environments. SPoRt addresses these gaps by providing a prior bound on the probability of violating safety properties in an episodic, model-free setting.

2. Problem Statement

The primary challenge is to ensure that a task policy $\pi_{task}$ does not exceed a specific probability of failure during both training and deployment. Formally, we seek to bound the probability of a trajectory violating a safety property, even when the underlying environment dynamics are unknown. This requires a method that can operate without the formal models required by Control Barrier Functions or the high computational overhead of certain formal methods (LTL), while providing stronger guarantees than simple average-cost constraints.

3. The SPoRt Framework

The SPoRt framework consists of three integrated components designed to provide and maintain safety certifications:

3.1 Data-Driven Safety Baseline

Using the "scenario approach," researchers collect a finite set of trajectories from an existing, demonstrably safe base policy ($\pi_{base}$). This empirical data allows for the calculation of a baseline violation probability ($\epsilon_{base}$) with high statistical confidence, serving as the foundation for the task policy's safety bound.

3.2 The Maximum Policy Ratio ($\alpha$)

The core theoretical contribution of SPoRt is the Maximum Policy Ratio. The authors prove that if the ratio between the new task policy and the base policy is constrained such that $\frac{\pi_{task}}{\pi_{base}} \leq \alpha$, the violation probability of the new policy is bounded by: $$\epsilon_{task} \leq \epsilon_{base} \cdot \alpha^T$$ where $T$ represents the episode length. This provides a literal "safety dial" ($\alpha$) that researchers can adjust to balance exploration and risk.

3.3 Projected PPO

To implement these constraints during training, the authors developed Projected PPO. At each training step, the task policy is projected onto a feasible set of distributions that satisfy the $\alpha$ constraint. This projection is formulated as a convex optimization problem, minimized via KL divergence, and solved efficiently using CVXPY. This ensures the agent learns to optimize behavior within the safety boundaries rather than simply being "clipped" after the fact.

4. Experimental Setup

The framework was evaluated using the Safety Gymnasium benchmark in a "reach-avoid" scenario. An agent (point-mass) was tasked with reaching a goal while avoiding hazards. The agent utilized a 16-beam LiDAR-like sensor and inertial data (44 continuous observations) to control forward drive and turning velocity. This setup tested the algorithm's ability to improve performance (speed to goal) while adhering to strict safety bounds.

5. Key Results and Insights

  • Certified Safety: SPoRt successfully maintained user-specified violation bounds throughout the entire training process.
  • Performance vs. Safety: Even with conservative bounds (e.g., $\epsilon_{task} = 0.1$), the agent achieved significant reductions in time-to-goal compared to the base policy.
  • The Role of Exploration: Interestingly, a more exploratory base policy (higher variance) provides a larger feasible region for the task policy. A rigid base policy restricts the agent's ability to find more efficient paths.
  • Computational Efficiency: The projection step runs in milliseconds, making the framework suitable for high-frequency control loops in physical robotics.
  • Empirical vs. Theoretical Risk: In practice, empirical violation rates were significantly lower than the theoretical maximum ($\epsilon_{base} \cdot \alpha^T$), suggesting that the method is even safer in application than the conservative mathematical bound suggests.

6. Discussion and Limitations

The primary limitation of SPoRt is the exponential growth of the safety bound relative to the episode length ($T$). For long-horizon tasks, the bound can quickly become "trivially 1," offering no useful safety information. Future research will focus on tightening these bounds to reduce conservativeness and adapting the method for longer horizons. Despite this, SPoRt represents a significant step toward certified, safe deployment of model-free RL in real-world robotics.

Summary updated

BibTeX
@inproceedings{cloete2025sport,
  author = {Jacques Cloete and Nikolaus Vertovec and Alessandro Abate},
  title = {{SPoRt - Safe Policy Ratio: Certified Training and Deployment of Task Policies in Model-Free RL}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.24963/ijcai.2025/554},
}
Figure