Boundary Resets: Training Safety Critics on the Curriculum's Frontier for Sparse-Reward Sim-to-Real

Robots that must insert a plug or thread a nut get almost no learning signal. They are rewarded only when the whole task succeeds, and they are told they were unsafe only at the instant they break something: too much force, a dropped object, a joint driven past its limit. The most effective recent fix for the first problem is to cheat in simulation. Researchers teleport the simulated robot to states along a few demonstrations, start near the goal, and move backward as the robot improves. Safety methods for transfer to real hardware take the opposite stance. They avoid any region where the simulator might be wrong, and in contact-rich tasks that region is exactly where the goal lives. This proposal argues that the same teleportation trick that solves reward sparsity in simulation can also solve safety-signal sparsity. A safety estimator should be trained on starting states picked the way a good curriculum picks them: states where it is genuinely uncertain whether the robot will stay safe, judged across many randomized versions of physics.

In two sentences: we reset the simulator to states where the current policy sometimes violates a safety constraint across randomized physics, and we use those rollouts to fit a dense, physics-averaged probability of violation. That probability replaces both the passive crash penalty and the blanket "avoid uncertain physics" penalty, so the robot keeps its safety boundary sharp without deliberately crashing, and it is not pushed away from the contact states it needs to finish a sparse-reward task.

Core Claim

Two pieces of prior work show the gap this proposal targets. Breaking Safety Paradox with Feasible Dual Policy Iteration shows that as a policy becomes safe, its replay data stops containing violations. In their baseline the share of violation samples falls below 1% late in training, so the learned safety estimate degrades and costs spike. Their fix is a second, adversarial policy that seeks violations. SPiDR shows that plain domain randomization (training across randomly perturbed physics parameters) yields 26.1x more safety violations than its method on a real Unitree Go1. Its fix adds a penalty proportional to how much the next state disagrees across randomized simulators. These are the two papers that frame the problem.

Our claim is that both fixes target a proxy rather than the quantity that matters. SPiDR penalizes sensitivity of the next state to physics. In insertion, friction and contact stiffness change the next state a great deal even when no constraint is anywhere near violated, so the penalty discourages benign but necessary contact. FDPI generates boundary data by steering a policy toward failure from wherever the primal policy happens to be. With sparse rewards, the relevant boundaries, such as jamming force at the socket, lie deep in the task near the goal, where an exploring policy rarely arrives.

We propose a different safety estimate. Let $\xi$ be a vector of physics parameters drawn from the randomization distribution $p(\xi)$. Let $H$ be a short safety horizon. Define

$$v^\pi(s) = \mathbb{E}_{\xi \sim p(\xi)}\big[\, P(\text{violation within } H \text{ steps} \mid s_0 = s, \pi, \xi)\,\big],$$

the physics-averaged probability that policy $\pi$ violates a constraint starting from state $s$. We also define its pessimistic variant $v^\pi_\alpha(s)$, the upper $\alpha$-quantile over $\xi$ of the per-physics violation probability. The policy is constrained to keep $v^\pi_\alpha$ below a budget along its trajectories.

The new ingredient is how the training data for $v^\pi$ is collected. Starting states are chosen by a two-sided version of DemoStart's zero-variance filter. DemoStart keeps start states where task success is neither certain nor impossible. We additionally keep states where the violation outcome has non-zero variance across policy noise and physics draws. This places the estimator's data on the current safety frontier. The frontier stays populated even when the policy is safe from its usual initial states, and it lies along the demonstration path where the task's hard contacts happen.

Research Program

The system builds on the reverse-then-forward curriculum of Reverse Forward Curriculum Learning (RFCL). RFCL resets a simulated robot backward along each of roughly five demonstrations, then samples forward from a frontier of competence. It contains no notion of cost.

We add three components.

The first is a violation estimator trained as a classifier on Monte Carlo outcomes. From each selected start state we run short rollouts under several sampled $\xi$ and record a binary label: violated or not. Repeated resets are what turn the sparse binary safety event into a dense per-state target. On hardware this is impossible, and there one would need learned credit assignment of the kind TraCeS does from trajectory-level labels. In simulation, we argue, direct estimation is both cheaper and unbiased.

The second is the two-sided start-state filter described above. It maintains a buffer of frontier states for success and a separate buffer for safety. The two are sampled jointly so that the per-demonstration curricula do not collapse onto one mode.

The third is a constrained policy update, a SAC-Lagrangian variant compatible with RFCL's off-policy learner. It treats $v^\pi_\alpha$ as the cost. Truncated quantile critics as in COX-Q handle residual cost underestimation for the long-horizon part of the constraint.

For deployment, the same estimator thresholded at a calibrated level acts as a shield that triggers a retreat action. This shield is the one place where the real robot's sparse failure labels re-enter. We use a small number of real trajectories, labeled only pass or fail, to recalibrate the threshold, in the spirit of conformal calibration from sparse human feedback (Learning Robot Safety from Sparse Human Feedback using Conformal Prediction; code at conformal-safety-learning). We deliberately do not fine-tune the policy on hardware.

The analysis side asks one question that prior work leaves open. Where in state space do "next-state disagreement" and "violation-outcome disagreement" diverge, and does that divergence predict when SPiDR-style pessimism freezes a sparse-reward agent? We will map both quantities along demonstration trajectories in each task.

Relation to Closest Work

Provably Safe Sim-to-Real Transfer estimates regions where the simulator mismatches reality and explores only with a certified safe baseline policy. Its zero-violation guarantee, 0% unsafe iterations against 68.5% for an unconstrained baseline, holds in a 5x5 tabular gridworld under a separability assumption. We give up its guarantees in exchange for continuous, high-dimensional manipulation. We also need no real safe baseline policy.

Sim-to-Lab-to-Real densifies collisions with Hamilton-Jacobi reachability, which computes the set of states from which failure becomes unavoidable using a known model. It certifies the result with many physical lab environments. We obtain a dense safety signal from simulator resets instead of an analytic reachability solve, and we target sparse task rewards, which that work does not.

DemoStart and RFCL supply the curriculum mechanism we reuse. Both ignore safety entirely. Their agents freely jam, drop, and over-force during training, and their transferred policies inherit whatever force profiles simulation allowed.

Baselines

The naive reference point is RFCL run unconstrained on the same tasks, followed by plain domain randomization at deployment. This shows how often an unmodified sparse-reward curriculum violates our constraints. If it rarely does, the safety problem is not real for these tasks and the proposal is moot. Its reported performance anchors the reward side: RFCL reaches about 39.4% success on ManiSkill2 PlugCharger with five demonstrations, where baselines stay at 0% (RFCL).

The strongest existing competitor is the straightforward stack: RFCL plus SAC-Lagrangian with the binary per-step cost, plus SPiDR's disagreement penalty $\tilde c = c + \lambda \upsilon$. This is exactly what a practitioner would assemble from published parts, and SPiDR has the only hardware evidence of zero-shot safety in the file, with 100% real-world constraint satisfaction on Go1 and RaceCar. We will give it a full sweep over $\lambda$ and the cost budget, at least as many configurations as we tune for our method, with identical demonstrations, randomization ranges, and environment-step budgets. There is no reported result on Lacuna for SPiDR on sparse-reward manipulation; the file reports only relative violation ratios against domain randomization. So this baseline must be run by us rather than quoted.

The second strong competitor is RFCL plus an FDPI dual policy. Crashes are free in simulation, so FDPI's main weakness, deliberate violations, does not apply here, and it is the most direct alternative fix for safety-estimator starvation. Its reported evidence is a roughly 10x higher share of violation samples than its baseline late in training, with near-zero violations across 14 Safety-Gymnasium environments (FDPI).

Every method is charged for every simulated step, including the Monte Carlo rollouts our estimator consumes. Our method is therefore not credited with free data.

Three ablations isolate the key ingredient. The first trains our violation estimator on uniformly sampled curriculum states instead of the two-sided frontier. The second uses success-only zero-variance filtering. The third replaces our outcome-based pessimism $v_\alpha$ with SPiDR's next-state variance, keeping everything else fixed.

Beating the stack means one of two things on held-out physics. Either we reach higher success at matched deployment violation rate, or we reach a lower violation rate at matched success. This should show as a dominating Pareto curve across the competitor's whole $\lambda$ sweep, not just against one setting.

Why not just…?

Why not just stack RFCL with SPiDR's penalty and tune $\lambda$? This is the real threat. The proposal stands or falls on it. Our hypothesis is that in contact tasks, next-state disagreement is high exactly at the socket or bolt, so any $\lambda$ large enough to suppress over-force also suppresses insertion. SPiDR's own limitations note the freezing risk, but its experiments are locomotion and obstacle avoidance, not contact goals. The success-versus-violation frontier over the full $\lambda$ sweep settles this. So does the ablation that swaps only the pessimism signal. If tuned SPiDR matches our frontier, we will report that outcome-based pessimism adds nothing in these tasks.

Why not just use FDPI's dual policy, since crashing in simulation is harmless? FDPI starts its violation-seeking from where the primal policy goes. With sparse rewards early in training, that is far from the goal-side contact states whose boundaries matter at deployment. Resets reach those states directly. We can test this by measuring the estimator's calibration error separately on states near the goal end of each demonstration. If FDPI's estimator is equally well calibrated there, resets are only a cheaper route to the same data, and we will say so.

Why not just up-weight rare crash samples with prioritized replay? FDPI already argues and shows that passive reweighting replays stale violation states that leave the current policy's support, and its baseline's violation share still collapses below 1%. We include prioritized replay of violations as a cheap baseline in one task only to confirm this transfers to manipulation. We do not expect it to compete.

Why not just learn per-step cost credit from trajectory labels as TraCeS does? In simulation the binary violation event is observed at every step and can be resampled from any state. Learned credit assignment solves a harder problem than we face. TraCeS-style credit is reserved for the real-robot calibration stage, where only pass/fail trajectories exist.

Proposed Experiments

The main suite uses ManiSkill2 (ManiSkill2), specifically PlugCharger, PegInsertionSide, and PickCube, with sparse success rewards and five demonstrations, matching RFCL. We add three binary constraints: end-effector contact force above a threshold, object drop, and joint-limit proximity. Physics randomization covers friction, mass, contact stiffness, and actuator gain. Evaluation uses two held-out physics sets, one inside the randomization support and one deliberately outside it. The second probes the support-overlap assumption that both SPiDR and our method share.

Metrics are task success; violations per episode at deployment; cumulative violations during training; a "frozen" rate, meaning episodes that end with no progress past the demonstration's first contact; and calibration error of the violation estimator on frontier states.

As a regression check in a dense-reward setting, we run SPiDR's Safety-Gymnasium PointGoal2 port (Safety Gymnasium). Here we expect parity rather than gains, because the next-state and outcome signals should roughly coincide away from contact. No reported result was found on Lacuna for SPiDR's absolute cost on PointGoal2.

If hardware is available, PickCube and a peg insertion run on a real arm with zero-shot transfer and shield calibration from at most 50 real pass/fail trajectories. ManiSkill2 reports 91% simulated and 60% real success for PickCube without fine-tuning. DemoStart reports 64% real plug insertion with no safety constraints. These are the reference points our safe policy must approach without exceeding real violation counts.

The decisive checks are three. First, the Pareto comparison against the tuned RFCL+SPiDR stack on held-out physics. Second, the ablation replacing outcome pessimism with next-state variance, which isolates the mechanism. Third, whether the regions where these two signals diverge are where frozen episodes occur. If the divergence map does not predict freezing, the core explanation is wrong, even if the aggregate numbers favor us.