A robot policy trained in simulation usually fails on hardware because the simulator is wrong somewhere. It rarely fails because the simulator is wrong everywhere. Two separate communities have tools that bear on this. Sim-to-real researchers correct the simulator by learning an "action transformer": a small model that rewrites each simulated action so the simulated next state matches what the real machine would do. Learning it needs real-world rollouts, which are expensive and can damage hardware. Adversarial testing researchers train a second agent whose reward is the system's failure, and that agent finds rare, compounding failure sequences far faster than random sampling. Its weakness is that it is happy to exploit simulator physics that do not exist in reality. We propose to close this loop. A failure-seeking adversary runs inside the corrected simulator, and it only counts failures that occur where the correction is trustworthy. When it is drawn toward failures in regions where the correction is uncertain, those regions become requests for real data. The real robot then visits the safe side of those regions under a cost-budget check, and the correction is refit there.
The claim is that a fixed, safety-constrained real-world budget buys more transfer when it is aimed at failure-relevant simulator mismatch than when it is spread evenly or aimed at uncertainty alone. A second claim follows from the first. Failures discovered this way should reproduce on the target system far more often than failures found by an adversary in an uncorrected or randomized simulator.
Where This Sits
The closest work is Provably Safe Sim-to-Real Transfer. It shows that real-world sample complexity can scale with the size of the region where simulator and reality disagree, rather than with the full state-action space. It collects real data with a confidence-scaled mixture of a known safe controller and an exploratory one. On a 5x5 windy gridworld it reports 0% unsafe iterations, against 68.5% for an unconstrained baseline. It also needed 77,958 real samples, against 296,910 for a baseline that did not use the simulator. This paper motivates our design and supplies its safety logic. It is limited to tabular problems with a "separable shift" assumption, and its exploration covers the mismatch region uniformly rather than looking for the parts of it that cause failure.
Our proposal differs in two ways. It works in continuous control with neural policies. It also uses directed failure search to decide which mismatch is worth paying real samples to resolve.
Three papers supply the method:
- Reinforced Grounded Action Transformation (RGAT) trains the action transformer end-to-end with reinforcement learning. Its reward is the agreement between the simulated and real next states, and this works with deep policies where classical forward/inverse-model grounding collapses. RGAT collects its real data with an unconstrained policy, and we replace that step. - Uncertainty-aware Grounded Action Transformation (UGAT) attaches an evidential uncertainty estimate to the transformer and falls back to the raw action when that uncertainty is high. We reuse this uncertainty, but as a boundary on where simulated failures can be believed rather than only as a stabilizer.
- Breaking Safety Paradox with Feasible Dual Policy Iteration (FDPI) shows a problem with safe agents. As they get safer they stop seeing violations, and their cost estimates decay. FDPI repairs this with a KL-bounded "dual" policy that seeks violations near the main policy's behavior. It maintained roughly 10x more violation samples in the replay buffer late in training and reached near-zero violations across 14 Safety-Gymnasium environments. FDPI cannot run on hardware because the dual policy deliberately fails. We run it only in the corrected simulator.
Two papers constrain the design:
- Rethinking Robustness Assessment found that unconstrained adversaries against quadruped controllers had to be Lipschitz-regularized to avoid non-physical chatter. Some of its simulated attacks did crash a real ANYmal. Our grounding-gated adversary is an attempt to replace a hand-set smoothness prior with data-driven evidence of plausibility. We keep the Lipschitz term as well, because it is cheap.
- Sim-to-Lab-to-Real reached 76.7% success and 86.7% safety on a physical quadruped. It relied on a reachability-based backup shield and on hundreds of passively varied lab environments for statistical certification. That result suggests shields work, but that passive variation is expensive.
Core Mechanism
There are four components. First, a known safe baseline controller, an assumption shared with the tabular work above. Second, an action transformer trained RGAT-style, with an ensemble or evidential head that gives uncertainty $u(s,a)$. Third, a primal policy trained in the corrected simulator as a constrained problem, with a PID-tuned Lagrange multiplier. Fourth, a failure-seeking adversary, which combines an FDPI-style dual policy with a Lipschitz-regularized disturbance agent.
The adversary is rewarded only for failures the correction can vouch for:
$$r_{\text{adv}}(s,a) = c(s,a)\,\mathbf{1}[u(s,a)\le\alpha] \; - \; \beta\,\mathbf{1}[u(s,a)>\alpha]$$
Here $c$ is the constraint cost, $\alpha$ is the trust threshold on transformer uncertainty, and $\beta>0$ is a small penalty. The penalty prevents the adversary from simply fleeing into untrusted regions.
Not every untrusted region is reported. A region becomes a frontier request when it lies on an adversarial trajectory whose cost under the uncorrected simulator, or under an optimistic ensemble member, would have been high. The frontier score is uncertainty multiplied by that predicted cost. This is the key ingredient: real data is requested where the simulator might be hiding or inventing a failure, and not merely where it is uncertain.
For each frontier request, the system selects predecessor states that are predicted to be safe. Safety is judged by a cost-so-far plus pessimistic future-cost test, in the spirit of backward value functions, using the worst ensemble member. The real system is then driven toward those states by a mixture of the safe controller and a goal-reaching probe. The mixing weight is shrunk whenever the pessimistic budget check tightens, so the real robot approaches but does not cross the suspected boundary. The new transitions refit the transformer, the trusted region grows toward the true boundary, and the adversary can push further on the next round. The primal policy's cost critic trains on trusted adversarial violations, which is FDPI's remedy applied without hardware failures.
Research Program
The work proceeds in three stages. The first replicates the tabular windy gridworld from Provably Safe Sim-to-Real as a sanity check: the method should match its 0% unsafe iterations and should not need more real samples than its 77,958.
The second stage is the main study, run on surrogate-real continuous control. The pattern follows RGAT and UGAT: the "real" system is a held-out simulator with altered dynamics. Here the simulator is Safety-Gymnasium (Safety Gymnasium) navigation and velocity tasks. The "real" variants use friction, mass, damping and actuator-delay shifts drawn from the uncertainty sets of RRLS (code). Mismatches are deliberately placed in two kinds of region. Some lie near hazards, where they make the real system more dangerous than the simulator. Others lie in task-irrelevant regions, where they are large but harmless. That placement lets us test whether the method spends samples on the first kind.
The third stage is a hardware probe on a legged robot with proprioceptive disturbances, as in the ANYmal study. It is reported as a demonstration rather than a statistical claim.
The analysis questions are where real samples end up relative to true hazardous mismatch, and how trusted-region growth tracks the true boundary.
Baselines
The naive reference is direct transfer of a constrained policy trained in the nominal simulator. It is trained with the same primal algorithm and the same simulation budget, and it receives zero real samples. Every method must beat it on real cost.
The domain-randomization baseline trains the same constrained policy, with FDPI's dual policy, over the RRLS uncertainty set. It has the same simulation budget and no real data. This tests whether correction is needed at all.
The strongest sim-to-real competitor is RGAT plus UGAT gating. Its real data comes from the safe mixture policy of Provably Safe Sim-to-Real, adapted to continuous control with the same pessimistic budget check. Collection is either uniformly exploratory or driven by the task policy. It receives the same real-sample budget, the same transformer architecture and the same hyperparameter search. The only difference from our method is where real samples are requested. On this exact surrogate setup, no reported result was found on Lacuna for RGAT or UGAT in constrained continuous control. RGAT's own report is qualitative: it matched real-environment training where GAT failed. The tabular numbers above are the only quantitative anchor.
The key ablation is uncertainty-directed collection. Frontier requests are scored by transformer uncertainty alone, with no failure weighting and no adversary. This isolates the claim that failure relevance, not just uncertainty, should direct the budget.
We count our method as winning under two conditions. First, it must reach the competitor's final real-world return at equal or lower real cost with at most half the real samples. Second, it must show at least a 2x improvement in failure precision. That metric is the fraction of adversary-reported failures that reproduce on the "real" system. Failure precision is compared against an adversary trained in the uncorrected and randomized simulators. All methods are run over 10 seeds, matching the RRLS protocol.
Why not just…?
Why not just use domain randomization with FDPI in simulation and skip real data? Randomization covers parameter ranges but does not target sequential failure combinations. The quadruped study found DR-trained controllers still harbored multi-channel compounding failures. MetaDrive found that procedural diversity alone did not transfer to real driving logs without real data. RRLS reports DR as strong on average-case return, so this baseline is a real competitor in harmless-mismatch settings. The experiment that settles it is the hazard-placed mismatch condition, where the true danger lies outside or at the edge of the randomized range.
Why not just direct real collection by transformer uncertainty? This is the most serious threat. If uncertainty and failure relevance coincide, the adversary adds cost for nothing. The two diverge exactly when large mismatch sits in harmless regions, and our environments include that case on purpose. If the uncertainty-only ablation matches our method there, we will drop the adversary from the collection loop. In that case the adversary keeps only its role as a cost-critic data source, and we report that result.
Why not just extend the tabular safe mixture policy to continuous control with uniform coverage? That is precisely our strongest baseline. Its tabular guarantee rests on separable shifts, and uniform coverage of a continuous mismatch region is expensive. Head-to-head sample counts at matched safety will show whether direction pays.
Why not just reweight past failures with prioritized replay instead of running a simulated adversary? FDPI's analysis indicates that passive reweighting can only resample stale early-training violations, while the live buffer falls below 1% violations. We include a prioritized-replay variant of the primal critic to confirm that the late-training cost spikes return without active generation.
Decisive Checks
The central check is a sample allocation plot under the hazard-placed mismatch condition. It shows the fraction of real samples landing within a fixed distance of true hazardous mismatch, for our method, the uncertainty-only ablation and uniform collection. Our method should concentrate there; if it does not, the core claim fails. The second check is real-system violations during collection. These should be zero or within budget for all constrained methods, and nonzero for unconstrained RGAT collection, which mirrors the 68.5% unsafe tabular baseline. The third is failure precision of discovered attacks. The fourth is whether FDPI's late-stage cost spikes stay absent when the dual policy runs in the corrected simulator rather than in the target system.
References
- Provably Safe Sim-to-Real Transfer
- Reinforced Grounded Action Transformation for Sim-to-Real Transfer
- Uncertainty-Aware Grounded Action Transformation Towards Sim-to-Real Transfer for Traffic Signal Control
- Breaking Safety Paradox with Feasible Dual Policy Iteration
- Rethinking Robustness Assessment: Adversarial Attacks on Learning-based Quadrupedal Locomotion Controllers
- Sim-to-Lab-to-Real: Safe reinforcement learning with shielding and generalization guarantees
- Constrained Markov Decision Processes via Backward Value Functions
- Safety Gymnasium: A Unified Safe Reinforcement Learning Benchmark
- Rrls: Robust reinforcement learning suite
- MetaDrive: Composing Diverse Driving Scenarios for Generalizable Reinforcement Learning