Robots trained in simulation are usually made robust with domain randomization: the simulator's physics (friction, mass, motor strength, latency) is varied across training episodes, so that the real robot looks like one more variation. A recent method, SPiDR, adds safety on top. It runs many randomized simulators side by side and treats their disagreement about what happens next as a reason for caution. On a quadruped and a small race car it kept the robot inside its safety limits on every hardware test. SPiDR's guarantee rests on one assumption, though: the real physics must lie inside the randomized range. When reality falls outside that range, nothing in the method notices. The simulators can still agree with each other, so the caution signal stays quiet, even as the robot heads into a failure none of them predicted.
We propose a different signal for deciding when a deployed robot should stop and hand control to a supervisor. It does not ask whether the simulators disagree with each other. It asks whether the transitions the robot actually observes could have come from any of the randomized simulators. The two questions come apart in exactly the case that breaks zero-shot safety. Inside the randomized range, we keep SPiDR's pessimism and never bother the supervisor. When the observed transitions fall statistically outside the range, the robot cedes control. The alarm threshold is set by calibrating on held-out randomized simulators, so its false-alarm rate inside the range is controlled by construction rather than tuned by hand.
Core Claim
Two quantities are easy to confuse. The first is spread within the ensemble: how much the randomized simulators disagree about the next state, written $\upsilon(s,a)$ in SPiDR. The second is the gap between reality and the ensemble: how far the actually observed next state $s'_t$ lies from every ensemble member's prediction. SPiDR penalizes the first. We claim that the second is the right trigger for intervention, and that the first is not.
The reason is direct. If every simulator gets the friction regime wrong in the same way, $\upsilon$ is near zero while the real-versus-ensemble gap is large.
Concretely, let $f_1,\dots,f_n$ be the randomized simulators' next-state predictions. Let $\Sigma$ be a per-dimension noise scale estimated in simulation. Over a sliding window of the last $W$ steps, we compute
$$z_t = \frac{1}{W}\sum_{k=t-W+1}^{t} \min_{i}\, \big\| s'_k - f_i(s_k,a_k) \big\|_{\Sigma^{-1}},$$
which is the average distance from the observed transitions to the closest ensemble member. Taking the minimum means the score stays small whenever some randomized physics explains the data. The alarm fires when
$$z_t > \tau_\alpha,$$
where $\tau_\alpha$ is the $(1-\alpha)$ quantile of $z_t$. That quantile is computed by running the policy in held-out randomized simulators that play the role of "reality."
If the real system is exchangeable with a randomization draw, the false-alarm rate is about $\alpha$. This is the standard quantile-calibration argument. Any excess alarm rate on hardware is therefore evidence that the support assumption has failed. When the alarm fires, a supervisor takes over. The supervisor is a scripted backup controller in sim-to-sim studies and a human teleoperator on hardware. The flagged transitions are logged as a continuous analogue of the "mismatch region" in Provably Safe Sim-to-Real Transfer, which in a tabular setting detects simulator-reality mismatch with confidence bounds and explores only there.
Relation to Prior Work
SPiDR (SPiDR: A Simple Approach for Zero-Shot Safety in Sim-to-Real Transfer) supplies the base method. It adds $\lambda\upsilon(s,a)$ to the safety cost of a constrained MDP, which is a reinforcement learning problem that maximizes reward subject to a budget on expected cumulative cost. We keep this unchanged. We add only a runtime test of its support assumption, which the authors themselves leave open.
The confidence-guidance literature motivates the use of a learner-triggered fallback but measures the wrong quantity for this regime. Can Autonomous Vehicles Identify, Recover From, and Adapt to Distribution Shifts? halts a vehicle and requests demonstrations when trajectory-predictor ensembles disagree. Uncertainty-Aware Action Advising for Deep Reinforcement Learning Agents triggers advice from variance across value heads. Decision Making for Human-in-the-loop Robotic Agents via Uncertainty-Aware Reinforcement Learning triggers it from return variance in gridworlds. All three use disagreement among the agent's own models. That is precisely the signal that can stay silent when every model shares a misspecification.
Blind Spot Detection for Safe Sim-to-Real Transfer is the closest relative in spirit, since it targets failures caused by what the simulator omits. It does so by training a classifier on real human corrections, and it is evaluated only on discrete games. Our test needs no real labels before deployment. It is calibrated entirely in simulation.
Two lines of work constrain the design. Sim-to-Lab-to-Real: Safe RL with Shielding and Generalization Guarantees shows that an automated reachability shield plus a physical lab phase still leaves residual violations. We therefore do not rely on a learned backup alone outside the training range. Breaking Safety Paradox with Feasible Dual Policy Iteration shows that safer policies starve their safety estimators of boundary data. That is one reason we calibrate the alarm on simulated rollouts rather than learning it from real near-failures.
Research Program
The work has three parts.
The first is the detector. We train SPiDR-style policies with an ensemble of $n \ge 8$ randomized simulators, implemented in MJX as in SPiDR. Ensemble predictions are obtained by stepping each simulator from the observed state. We then calibrate $\tau_\alpha$ on a held-out set of randomization draws and study how the window length $W$ trades detection delay against noise.
The second is the handover rule. Detection must come early enough for the supervisor to prevent a violation. We therefore measure, for each shift, the lead time between the alarm and the first constraint violation that SPiDR alone would have incurred.
The third is a secondary use of the logged mismatch transitions. They are used to widen the randomization ranges along the parameter directions that best explain them, and then the policy is retrained. This tests whether alarms can repair coverage rather than only stop the robot.
Baselines
The naive reference point is uniform domain randomization trained with a Lagrangian constrained learner (PPO-Lag, the Lagrangian-penalty version of the PPO policy-gradient algorithm, as packaged in Safety Gymnasium: A Unified Safe Reinforcement Learning Benchmark). It has no ensemble penalty and no fallback. It shows how bad unprotected transfer is under each shift.
The strongest existing method is SPiDR itself, with $\lambda$ tuned on in-range validation draws under the same budget we give our calibration step. On hardware, SPiDR reports satisfying constraints 100% of the time, with standard domain randomization incurring 26.1× more violations on the Unitree Go1 and 6.2× more on the race car. On Safety Gymnasium PointGoal2 and on the RWRL suite, there is no reported result found on Lacuna for SPiDR in isolated numerical form, so we will rerun it. Beating SPiDR means two things together. On out-of-range shifts, we need significantly fewer constraint violations. On in-range shifts, we must match SPiDR's return and violation rate while issuing alarms in at most about $\alpha$ of episodes.
The key ablation isolates the trigger signal. Using the same policy, the same supervisor and the same false-alarm budget $\alpha$, we fire alarms on SPiDR's within-ensemble spread $\upsilon$ instead of on $z_t$. If this ablation does as well, our core claim is wrong.
A second ablation replaces the ensemble minimum with the gap to a single nominal simulator. This tests whether randomization adds anything to the detector beyond plain prediction error.
We also compare against a blind-spot classifier in the style of Blind Spot Detection for Safe Sim-to-Real Transfer. It is given the same number of labeled supervisor interventions that our method incurs, and it is evaluated at matched query rates. That paper reports matching full-oversight performance while querying 14–23% of the time, with detection AUC 0.96 under a suboptimal oracle.
Every method gets identical simulators, policy architectures, environment-step budgets and hyperparameter search budgets. For all of them, the supervisor is the same scripted backup controller.
Why not just…?
Why not just threshold SPiDR's own disagreement signal? It is the obvious move, and it is the ablation above. The failure mode we target is a shared misspecification: an unmodeled payload, wind, or friction below the randomized floor. Under such a shift, every simulator predicts the same wrong outcome and $\upsilon$ stays low. Whether this happens often enough to matter is an empirical question, and our out-of-range suite is built to answer it. If the $\upsilon$-trigger catches out-of-range shifts as early as $z_t$ does, we will report that and drop the claim.
Why not just widen the randomization until reality is inside it? This is a real threat. For a known mismatch it may well suffice. But widening has a cost in performance: Active Domain Randomization documents instability of uniform randomization as the parameter space grows, and SPiDR's own penalty grows with ensemble spread, pushing toward frozen policies. We will plot return and violations against randomization width. Separately, we will test whether widening one parameter range protects against shifts along a parameter that was never randomized. By construction, it cannot.
Why not just learn a blind-spot classifier from real corrections? It needs labeled real-world failures or near-failures before it can work. That is exactly the data that is dangerous to collect. The suboptimality result in Blind Spot Detection for Safe Sim-to-Real Transfer shows its quality depends on the teacher visiting risky states. Our matched-label comparison measures how many real interventions the classifier needs before it equals a detector calibrated purely in simulation.
Why not just use a worst-case robust policy or an always-on shield? Worst-case planning in Can Autonomous Vehicles Identify, Recover From, and Adapt to Distribution Shifts? reached 42% success on unseen roundabouts, while adding one to three triggered demonstrations raised it to nearly 100%. Robustness alone leaves performance on the table. Shields trained in simulation inherit the same support assumption, which Sim-to-Lab-to-Real mitigates only with a physical lab phase.
Proposed Experiments
The main study is sim-to-sim, which gives exact ground truth on violations. We use Safety Gymnasium PointGoal2 ported to MJX and the RWRL Cartpole and Walker tasks with their constraint definitions. The "real" environments come in two matched families.
In-range shifts are fresh draws from the training randomization. Out-of-range shifts move parameters 1.5–3× beyond the randomized bounds. We also introduce effects never randomized: a constant external force field modeled on the windy cells of the gridworld in Provably Safe Sim-to-Real Transfer, an asymmetric actuator gain loss, and added latency.
We report cumulative cost and the fraction of episodes with any violation. We also report return, alarm rate, alarm lead time before first violation, and the false-alarm rate on in-range shifts against the target $\alpha$.
The decisive check is a two-by-two comparison. In-range, our method should be indistinguishable from SPiDR and alarm at roughly rate $\alpha$. Out-of-range, SPiDR's violations should rise, the $\upsilon$-trigger should alarm late or not at all, and $z_t$ should alarm before most violations.
The secondary check asks whether retraining with ranges widened from logged alarms reduces both later alarms and violations on the same shift.
If the sim-to-sim results hold, we will repeat the out-of-range protocol on the race car and quadruped platforms used by SPiDR. The shifts there will be added payload and a low-friction floor surface. The supervisor will be a human with a kill-and-teleoperate switch, and we will report the same metrics.
References
- Provably Safe Sim-to-Real Transfer
- SPiDR: A Simple Approach for Zero-Shot Safety in Sim-to-Real Transfer
- Can Autonomous Vehicles Identify, Recover From, and Adapt to Distribution Shifts?
- Uncertainty-Aware Action Advising for Deep Reinforcement Learning Agents
- Decision Making for Human-in-the-loop Robotic Agents via Uncertainty-Aware Reinforcement Learning
- Blind Spot Detection for Safe Sim-to-Real Transfer
- Sim-to-Lab-to-Real: Safe RL with Shielding and Generalization Guarantees
- Breaking Safety Paradox with Feasible Dual Policy Iteration
- Safety Gymnasium: A Unified Safe Reinforcement Learning Benchmark
- Active Domain Randomization