Tuning the Tuners of Domain Randomization When Reality Lies Outside the Simulator

Robots trained in simulation often fail on real hardware because the simulator is wrong in ways nobody wrote down. The standard remedy is domain randomization: train across many randomly perturbed copies of the simulator, varying mass, friction or damping, so that reality looks like one more sample. Recent methods automate how wide those perturbations should be. None of them removes the manual choices. They move them up one level, to knobs such as the success rate the policy must keep while randomization widens, the step size of a parameter search, or the exploration weight of an outer Bayesian optimizer. These higher-level settings are called meta-hyperparameters. They are picked in simulation, and simulation is exactly where the real target cannot be seen. Picking them is therefore a sim-to-real problem of its own, and nobody has measured how badly it goes.

This proposal makes two claims. The first is that the meta-hyperparameters of automated domain randomization matter little when the target's dynamics fall inside the randomized parameter space, and matter a lot when the target has unmodeled structure such as latency, backlash, actuator saturation or a different contact model. The second is that the usual way of choosing them, validating on held-out samples from the same randomized family, systematically picks the wrong setting in that second regime. We will measure this on controlled simulation benchmarks and test a simple replacement: cross-validation that holds out whole families of simulator error rather than parameter values.

Core Claim and Positioning

The motivating evidence comes from both directions. On the optimization side, How far away are truly hyperparameter-free learning algorithms? benchmarks learning-rate-free optimizers on the AlgoPerf suite. It finds that paper defaults fail on most workloads and that removing the learning rate shifts sensitivity onto weight decay, momentum and training horizon. A Method for Evaluating Hyperparameter Sensitivity in Reinforcement Learning supplies the measurement tool we reuse. It defines sensitivity $\Phi$ as the performance lost when one fixed setting is deployed everywhere instead of tuning per environment, and applies it to PPO across Brax tasks. It treats environments as distinct nominal tasks and never looks at randomized dynamics or transfer.

On the sim-to-real side, three automated methods each introduce a knob they do not set automatically. Domain Randomization via Entropy Maximization (DORAEMON) widens the randomization distribution as far as it can while keeping simulated success above a threshold $\alpha$, and retreats inside a trust region when success drops. Its own results show that different $\alpha$ values produce very different learned distributions, but it gives no rule for choosing $\alpha$. Bayesian Domain Randomization for Sim-to-Real Transfer (BayRn) tunes the randomization distribution with Bayesian optimization on real rewards. That brings in kernel and acquisition choices, and it costs hundreds of real rollouts. Auto-Tuned Sim-to-Real Transfer moves simulator parameters in the direction a trained classifier predicts, using hand-set step sizes.

The theoretical work constrains the design. Understanding Domain Randomization for Sim-to-real Transfer proves that domain randomization transfers with a gap of order $\sqrt{H}$ over a horizon $H$. The proof assumes that reality lies within the simulator's support and that the policy has memory. Our experiments are organized around what happens when the first assumption fails.

The closest idea to ours is Hyperparameter Tuning Through Pessimistic Bilevel Optimization. It shows that optimistic tuning overfits under shift and tunes against the worst near-optimal inner solution, but only on linear models and MNIST→FashionMNIST. We borrow its pessimism. We apply it to the choice among meta-hyperparameter settings, and we take the worst case over families of held-out simulator error rather than over inner solutions. We do not solve a min-max program.

We measure a meta-level sensitivity. Let $\lambda$ be a meta-hyperparameter setting (for DORAEMON, the pair of $\alpha$ and trust-region size) and let $\mathcal{T}$ be a set of target environments. Let $J(\lambda, t)$ be the normalized return on target $t$ of the policy trained with $\lambda$, and let $\hat\lambda$ be the setting a given selection rule picks. The meta-sensitivity is

$$\Phi_{\text{meta}}(\hat\lambda) = \frac{1}{|\mathcal{T}|}\sum_{t\in\mathcal{T}} \Big[\max_{\lambda} J(\lambda,t) - J(\hat\lambda,t)\Big],$$

that is, the average return lost relative to an oracle that could tune separately for each target. Normalization follows the [5, 95] percentile scheme of the RL sensitivity paper.

Research Program

Everything runs in simulation, where ground truth is available, using the MuJoCo environments of RRLS : Robust Reinforcement Learning Suite (Hopper, Walker2d, HalfCheetah, Ant, InvertedPendulum) and the DORAEMON MuJoCo tasks. Each method randomizes the standard parameter set of mass, friction and damping.

We build two tiers of "pseudo-real" targets. In-support targets are parameter vectors drawn from the RRLS uncertainty sets. Out-of-support targets add structure the randomizer never varies, in four families:

  1. action and observation latency;
  2. actuator deadzone and backlash;
  3. torque saturation together with motor-gain drift;
  4. altered contact-solver stiffness.

The out-of-support tier is the stand-in for reality. It lets us compute $\Phi_{\text{meta}}$ exactly, which a real robot never allows.

For each automated method we sweep its meta-hyperparameters on a fixed grid:

  1. DORAEMON's $\alpha$ over four values from 0.3 to 0.9, crossed with three trust-region sizes.
  2. The step size and update frequency of the auto-tuned classifier search, run sim-to-sim.
  3. BayRn's acquisition exploration weight and kernel, with the pseudo-real target acting as the black box.
  4. The bound width of uniform randomization, which serves as the simplest meta-hyperparameter.

We cross each sweep with policy history length (none, short, long). The theory says memory is necessary, but memory may also lock onto simulator-specific timing, and this cross lets us observe that interaction directly. Every cell uses five seeds and the same training budget.

We then compare selection rules, each of which sees only simulated signals:

  1. The paper default.
  2. In-support validation, which scores each setting on held-out parameter samples.
  3. Leave-one-family-out structural cross-validation. For each held-out error family, a setting is scored by its worst return across the remaining families, and the setting with the best worst-case score is chosen.

The held-out family is never used for selection, so the test honestly simulates meeting a new kind of error.

Baselines

The naive reference point is uniform domain randomization with wide fixed bounds, which uses no meta-level tuning. The file reports it failing on hardware: 0% success on PandaPush in DORAEMON and 0% on both xArm tasks in the auto-tuned sim-to-real paper. We still run it on our pseudo-real targets to see whether that collapse reproduces.

The strongest existing method is DORAEMON with its published default threshold. Its reported result is 60% zero-shot success on the physical PandaPush task, against 46.7% for LSDR and 26.7% for AutoDR (Domain Randomization via Entropy Maximization). On the RRLS environments we found no reported per-environment return on Lacuna for DORAEMON or for domain randomization. We likewise found no reported per-task value of $\Phi$ on Lacuna, so all simulation comparisons are measured fresh under matched budgets.

A second strong competitor is a BayRn-style selector that spends real, here pseudo-real, rollouts to choose among settings. We give it a fixed budget of target rollouts, far below BayRn's reported 700, because the question is how much target access structural cross-validation can replace.

The ablation that isolates the key ingredient is in-support validation run with exactly the same compute as structural cross-validation. The only difference between the two is whether whole error families are held out. Structural cross-validation beats a baseline if it achieves lower $\Phi_{\text{meta}}$ and higher worst-family return on the held-out family, with non-overlapping seed-bootstrap intervals, and if it does so without lowering in-support return by more than a few normalized points.

Why not just…?

Why not just use the published default threshold? Defaults are the regime in which How far away are truly hyperparameter-free learning algorithms? found widespread failure, and DORAEMON's own sweep shows that $\alpha$ reshapes the learned distribution. Whether that reshaping changes transfer outcomes is exactly what $\Phi_{\text{meta}}$ for the default rule will show. If the default's meta-sensitivity is near zero on out-of-support targets, the problem we describe is not real and we will report that.

Why not just validate on held-out parameter samples from the randomizer? This is the real threat. It is cheap, standard, and may rank settings correctly if performance on in-support targets predicts performance on structural errors. We test it directly: we compute the Spearman correlation, across settings, between in-support validation scores and out-of-support returns. A high correlation, around 0.8 or above in every family, would mean that simple validation is enough, and we would drop the proposed method in favor of reporting that finding.

Why not just spend a few real rollouts to choose, as BayRn does? When hardware is cheap and safe, this is correct, and we do not argue against it. The comparison asks how many target rollouts the rollout-based selector needs before it matches structural cross-validation, which requires none. The answer defines when simulation-only selection is worth doing.

Why not just train a worst-case robust policy and skip meta-tuning? RRLS reports that worst-case methods such as M2TD3 give up nominal performance while domain randomization wins on average return. Robust training also has its own uncertainty-set radius to choose, so it simply moves the meta-hyperparameter again. We include M2TD3 with the RRLS configuration as a reference, but it is not a way to avoid meta-tuning.

Proposed Experiments and Decisive Checks

The first decisive check tests the core claim. For each method we plot $\Phi_{\text{meta}}$ under the oracle-free rules separately for in-support and out-of-support targets. The claim holds if out-of-support meta-sensitivity is several times larger than in-support meta-sensitivity. It fails if the two are comparable.

The second check is the rank correlation test described above, reported per error family.

The third check tests the history-length interaction. If long memory increases $\Phi_{\text{meta}}$ specifically under latency and backlash, that is direct evidence that memory overfits simulator timing, a tension the domain randomization theory leaves open.

If hardware access is available, a final test repeats the DORAEMON $\alpha$ selection on PandaPush. There we compare the settings chosen by in-support validation and by structural cross-validation against the published 60% reference. That test would confirm the simulation findings, but the study's conclusions do not depend on it.