Calibrated Safe Policy Improvement for Continuous Offline Reinforcement Learning

Federico Bianchi, Alessandro Farinelli, Alberto CastelliniNeurIPS 2026

TL;DR

Trying to improve a control system using only pre-collected data is like navigating in the dark: take one wrong step outside what the data covers, and your learned world model might hallucinate a cliff into a shortcut. Cal-SPI brings provably safe policy improvement to continuous-control spaces by turning raw neural network uncertainty into a statistically calibrated "trust gate." If the system isn't mathematically confident that a new action beats the existing baseline, it gracefully falls back to the baseline—giving you upside when data is rich and a strict safety net when data is scarce.

What Problem Does This Paper Address?

In Offline Reinforcement Learning (RL), an agent must learn a better strategy from a static dataset without ever interacting with the real world. This is crucial in robotics, healthcare, or energy grids where live trial-and-error is expensive or dangerous.

Within this space, Safe Policy Improvement (SPI) has a modest, practical goal: given an existing, working "baseline policy" that generated the data, find a better policy that—with high probability—will not perform worse than what you already have.

In discrete, grid-like worlds, SPI is straightforward: you count how many times you've visited a state-action pair. Lots of visits? Trust the data and optimize. Few visits? Fall back to the baseline. In continuous spaces (like smooth robot joint angles and torques), you never visit the exact same floating-point coordinate twice—visitation counts are always zero. Researchers often use neural network ensembles to estimate uncertainty instead, but raw ensemble disagreement is an arbitrary number whose scale changes with network architecture and state dimensions. How do you turn an uncalibrated "vibe check" into a rigorous safety guarantee?

Methods

The authors introduce Cal-SPI (Calibrated Safe Policy Improvement), which marries standard model-based tools with a novel statistical calibration and switching pipeline:

  1. Deep Ensemble World Model (Standard): They train an ensemble of neural networks on the offline data to predict the next state, using the maximum disagreement between networks as a raw uncertainty score.
  2. Conformal-Style Safety Gate (Novel): Borrowing ideas from conformal prediction and Wilks' tolerance intervals, they use held-out data to map raw ensemble disagreement to a statistical upper bound on actual one-step prediction error. To prevent data leakage, the held-out set is split into three parts: one to partition uncertainty into bins, one to compute error bounds per bin, and one to pick an operating error threshold. This creates a hard binary predicate—ModelSafe(s, a)—that acts as a continuous stand-in for visitation counts.
  3. Gated Tree Search (Adapted): Using Monte Carlo Tree Search with Double Progressive Widening (MCTS-DPW), the planner explores continuous actions sampled around the baseline policy. If a simulated branch hits an uncertified (state, action) pair, expansion stops immediately and falls back to the baseline's value.
  4. Root-Level Safety Switch (Novel): MCTS only proposes and ranks safe actions. Before actually executing the winning action, Cal-SPI checks a final one-step certificate: does taking this action and following the baseline afterward beat just following the baseline from the start by a safety margin? If not—or if data was too sparse to even build valid calibration bins—it executes the baseline action.

Datasets

Rather than using static public offline datasets, the authors train a baseline policy using Proximal Policy Optimization (PPO) and roll it out to collect offline datasets of varying sizes (ranging from tiny 1- or 5-trajectory sets up to 4,000 trajectories) to study how the method scales with data support. They evaluate across five standard continuous-control benchmarks of increasing complexity:

  • Point Maze (2D navigation)
  • Hopper, HalfCheetah, Walker2d, and Ant (MuJoCo simulated locomotion tasks with contact dynamics and rising state-action dimensionality).

Key Insights and Ideas

  • Decoupling exploration from certification: A clever insight here is that the MCTS planner doesn't need to be mathematically airtight across multi-step rollouts to guarantee safety. MCTS acts purely as a local candidate ranker inside the safe zone, while the theoretical PAC-style safety guarantee is enforced entirely by the one-step certificate at the root decision.
  • Exact conservative collapse: Most offline RL algorithms try to maximize return globally with soft penalties, meaning they often underperform the baseline when data is tiny. Because of Cal-SPI's bin-admissibility rules, if you hand it 5 trajectories where statistical calibration is impossible, the safe set is empty and it mathematically collapses exactly into the baseline policy.
  • Safety is cheap: You might expect statistical gating and tree checks to bottleneck real-time control. Profiling shows the explicit certification machinery accounts for only 9–11% of planning time; standard neural network inference dominates the rest.

Key Results

  • Preventing catastrophic model exploitation: On Hopper and HalfCheetah, an identical ungated MCTS-DPW planner hallucinates wildly in low-data regimes, crashing HalfCheetah returns down to -231 (versus PPO's ~780). Cal-SPI preserves the PPO baseline at low data and climbs to ~850 with 500 trajectories.
  • Scaling to complex locomotion: On Walker2d, Cal-SPI matches the PPO baseline return (1644.1) when given only 5 or 50 trajectories, then jumps to 2100.3 (and nearly triples survival rate from 0.288 to 0.804) at 1,000 trajectories. On high-dimensional Ant, it holds the baseline (1657.6) up to 500 trajectories before improving to 1882.0 at 4,000 trajectories.
  • Outperforming offline RL baselines in small data: Standard offline RL methods (like CQL, IQL, MOPO, and MOReL) frequently degrade below the PPO baseline when trajectory counts are small on Point Maze and Hopper, whereas Cal-SPI stays at or above the baseline across the board.
  • Practical latency: End-to-end decision time averages 46.6 to 88.5 ms across all five domains, hitting roughly 94.7% to 98.5% empirical error coverage during live deployment (matching the nominal 95% target).

Limitations and Future Work

  • The i.i.d. tension: The finite-sample Wilks guarantee assumes calibration errors within each bin are independent or exchangeable. Offline RL trajectories are temporally correlated sequences. Splitting data at the trajectory level avoids train-test leakage, and empirical audits look solid, but extending the math to handle Markovian/dependent sequential data is an open problem.
  • Search bottlenecks in massive action spaces: Sampling candidates via MCTS worked up to Ant, but scaling to humanoid-level control will strain random Gaussian candidate generation. Replacing MCTS with learned action-proposal networks while keeping the calibrated root switch is a natural next step.
  • The baseline ceiling: Because Cal-SPI only deviates where the dataset provides calibrated support, a narrow baseline dataset imposes a ceiling on how much improvement can ever be certified. More expressive latent world models could help stretch sample efficiency.

Summary updated

Abstract

Safe Policy Improvement (SPI) aims to improve a baseline policy offline using fixed data while avoiding performance degradation with high probability. Existing baseline-bootstrapping SPI methods rely on count-based support, which does not directly extend to continuous state-action spaces. We propose Calibrated Safe Policy Improvement (Cal-SPI), a continuous offline SPI framework that replaces count-based support with calibrated model trust. Cal-SPI learns a deep ensemble dynamics model and calibrates ensemble disagreement on held-out data through a Wilks-style tolerance construction, turning raw uncertainty into a statistical upper bound on one-step model error. This certificate defines a hard trust gate over continuous state-action candidates. MCTS-DPW is used to propose and rank gate-certified deviations, while execution is controlled by a separate baseline-relative one-step certificate with fallback to the baseline. We show that, under the stated calibration and deployment-transfer conditions, this mechanism yields a conditional PAC-style baseline-relative improvement bound and collapses exactly to the baseline when no admissible gate can be constructed. Experiments across five continuous-control domains of increasing complexity show that Cal-SPI preserves baseline performance when calibration support is insufficient and improves over the baseline once calibrated model trust becomes reliable.
BibTeX
@inproceedings{bianchi2026calibrated,
  author = {Federico Bianchi and Alessandro Farinelli and Alberto Castellini},
  title = {{Calibrated Safe Policy Improvement for Continuous Offline Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=yOfHpD0Pkv},
}
Figure