Provably Safe Sim-to-Real Transfer

Tingting Ni, Maryam KamgarpourarXiv 2026

TL;DR

This paper introduces a provably safe framework for "sim-to-real" transfer in reinforcement learning, ensuring an agent never violates safety constraints while collecting real-world data to correct for simulator imperfections. By framing the problem as a reward-free constrained Markov decision process (CMDP), the proposed algorithm drastically reduces real-world sample complexity while remaining computationally efficient and capable of planning for any future reward function.

What Problem Does This Paper Address?

Reinforcement learning (RL) is notoriously sample-inefficient. To avoid costing millions or damaging hardware, roboticists often train agents in simulators before deploying them in the real world. However, simulators are imperfect approximations of reality—a discrepancy known as the sim-to-real mismatch. A policy that seems perfectly safe and optimal in simulation might fail catastrophically or violate safety constraints when deployed in the real world.

While agents can collect real-world data to fine-tune and correct these mismatches, the data-collection process itself must be safe (e.g., a self-driving car cannot crash just to learn that a simulator model was wrong). Existing methods either assume the real world is perfectly covered by a distribution of randomized simulators, or they require fully online learning from scratch for every new task reward, which is highly inefficient.

This paper tackles a challenging question: How can an agent safely leverage an imperfect simulator to minimize real-world data collection, while ensuring zero safety violations during exploration and remaining flexible enough to handle arbitrary task rewards later?

Methods

The authors formulate safe sim-to-real transfer as a reward-free safe RL problem using Constrained Markov Decision Processes (CMDPs). They assume the agent has a known, strictly safe baseline policy ($\pi^0$) to bootstrap exploration and that any actual mismatch between the simulator and the real world is statistically identifiable (separated by a minimum threshold, $\sigma_s$).

They introduce Algorithm 1: Sim-to-real safe RL, which relies on three core components:

  1. Estimating the Mismatch Region: The algorithm maintains an estimated "mismatch region" ($\hat{B}$). It starts by assuming the simulator is wrong everywhere and iteratively shrinks this region as real-world data confirms where the simulator's transitions match reality.
  2. Constructing a Hybrid Model: It builds a hybrid transition model ($\hat{P}$) that uses empirical real-world data only within the estimated mismatch region, while safely recycling the simulator's data everywhere else.
  3. Tractable Safe Exploration: To find out where to explore next, the algorithm solves a standard CMDP optimization problem to maximize an uncertainty "bonus" restricted to the mismatch region. Unlike prior reward-free safe RL methods that require solving intractable, non-convex optimization problems, this approach uses standard, computationally efficient CMDP solvers. To guarantee safety during exploration, the exploration policy is mixed with the safe baseline policy ($\pi^0$).

Datasets

The algorithm was evaluated using a synthetic benchmark environment:

  • Safety-Critical Gridworld: A $5 \times 5$ gridworld with a horizon of $H=12$. It features a central unsafe wall (which the agent must avoid) and a starting position. The simulator represents a nominal gridworld, whereas the real-world environment introduces a safety-critical mismatch: "windy" cells adjacent to the unsafe wall that actively push the agent toward danger with an 80% probability.

Key Insights and Ideas

  • The Power of Separability: By assuming a $\sigma_s$-separable shift (that simulator errors are distinct and not infinitely small), the algorithm can definitively classify state-action pairs as either "mismatched" or "verified." This prevents the agent from wasting real-world samples re-learning dynamics the simulator already got right.
  • Tractable Uncertainty Certificates: Instead of optimizing a complex, non-convex objective to guide exploration, the authors designed a computable upper bound on value estimation error. This mathematical pivot allows them to use standard linear programming or constrained policy optimization solvers.
  • Adaptive Sample Complexity: The theoretical analysis reveals that the sample complexity scales linearly with the size of the mismatch region ($|B|$), rather than the entire state-action space. If the simulator is highly accurate, the real-world sample requirement drops dramatically.

Key Results

The authors compared their algorithm against two baselines: Reward-free safe RL (which ignores the simulator) and Unconstrained sim-to-real RL (which ignores safety).

  • Safety: The unconstrained baseline violated safety constraints in 68.5% of its learning iterations. Both the reward-free safe RL baseline and the proposed sim-to-real safe RL algorithm maintained 0% safety violations.
  • Sample Efficiency: While the purely online safe baseline required 296,910 real-world samples to achieve accurate planning, the proposed sim-to-real safe RL algorithm required only 77,958 samples—nearly a 4x reduction in real-world interactions achieved simply by exploiting the imperfect simulator.

Limitations and Future Work

  • Tabular Constraints: The current theoretical guarantees and algorithms are limited to tabular CMDPs (discrete state and action spaces). Extending this framework to continuous domains (like deep RL or linear CMDPs) remains an open challenge.
  • Strict Separability Assumption: The algorithm relies on knowing the separation parameter $\sigma_s$. While the paper provides a method to estimate it, relaxing this assumption to handle more general, non-separable simulator biases is an important next step.
  • Baseline Dependency: The requirement of a pre-existing, strictly safe baseline policy ($\pi^0$) might be restrictive for entirely novel real-world systems where even a conservative safe policy is hard to define.

Summary updated

BibTeX
@misc{ni2026provably,
  author = {Tingting Ni and Maryam Kamgarpour},
  title = {{Provably Safe Sim-to-Real Transfer}},
  year = {2026},
  eprint = {2609.01418},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.01418},
}
Figure