From Perturbed Markov Decision Processes to Deployed Robots
Associate Professor, ECE | The Ohio State University
Co-Director, IITB-OSU Frontier Center
Founder, Ensemble Control Inc. (https://ensemblecontrol.com/)
The sim-to-real gap is a resource allocation problem. Closing the gap means trading off two expensive resources:
Compute (GPU Hours)
Highly scalable, cheaper at the margin
Bound by fidelity limits (contact physics, soft bodies)
Risk: Overfitting to a flawed simulator wastes months of compute.
Real-World Data (Robot Hours)
Non-scalable, expensive (requires human supervision)
True ground-truth physics
Risk: Hardware damage, safety incidents during early training.
Tip
The Architectural Mandate
You cannot solve the gap with just more compute or just more data. A modern production robotics architecture must be designed to use compute to minimize the need for real data, and spend real data only when it is most valuable (e.g., fine-tuning).
Every simulator is an approximate model of the physical world (see embodiment gap below). The policy that is optimal in the simulator is not optimal on the robot — and can have degraded performance for seemingly minor reasons.
The sim-to-real gap
The performance a policy loses when it is trained under one dynamical model and deployed under another. This talk: what that loss is mathematically, and ten ways to shrink it.
The Embodiment Gap
The discrepancy between the physical characteristics of the simulated robot and the actual hardware in the real world (e.g., differences in mass, friction, actuators, and unmodeled physical phenomena).
Part I — Theory of the gap
Part II — Ten methods, classified
Simulator: \(\hat M = (\mathcal X, \mathcal A, \hat P, \hat r, \gamma)\) — the model we train in.
Reality: \(M = (\mathcal X, \mathcal A, P, r, \gamma)\) — the actual system model where the policy interacts with the real world. \(P\) is unknown.
Value of a policy \(\pi\) in model \(M\): \[ J_M(\pi) \;=\; \mathbb E^{\pi}_{M}\Bigl[\textstyle\sum_{t=0}^{\infty} \gamma^{t}\, r(x_t, a_t)\Bigr], \qquad V^\pi_M(x) = \mathbb E^{\pi}_{M}\bigl[\cdot \mid x_0 = x\bigr] \]
We train \(\hat\pi \approx \arg\max_\pi J_{\hat M}(\pi)\) but we are graded on \(J_{M}(\hat\pi)\).
Two distinct quantities, often conflated
(a) the evaluation gap \(\;\Delta(\pi) = J_{\hat M}(\pi) - J_{M}(\pi)\) for a fixed \(\pi\), and
(b) the transfer regret \(\;\mathcal R = J_M(\pi^*_M) - J_M(\hat\pi)\) — what we actually lose by optimizing the wrong model.
There could also be faster dynamics in the system that is ignored in the simulation – this gives rise to singularly perturbed systems
The abstract error \(\hat P \ne P\) decomposes into distinct physical channels — each attacked by different methods in Part II:
| Channel | Typical culprit | Mathematical form |
|---|---|---|
| Dynamics parameters | mass, friction, CoM, motor constants | \(f_{\hat\xi}\) vs. \(f_{\xi^\star}\), \(\xi^\star\) unknown |
| Unmodeled dynamics | backlash, cable stretch, contact softness | \(P \notin \{P_\xi : \xi \in \Xi\}\) — model class bias |
| Actuation | latency, torque limits, PD-loop bandwidth | composition with an unmodeled actuator map \(g\) |
| Observation | rendering vs. camera, sensor noise | emission \(q(o\mid x) \ne \hat q(o \mid x)\) |
| Reset & task distribution | initial states, object geometry | \(\rho_0 \ne \hat\rho_0\) |
The POMDP view unifies them
Reality is the POMDP whose hidden static variable is \(\xi^\star\): state \((x_t, \xi^\star)\), observation \(o_t\). Every method in this talk is an approximation to the Bayes-adaptive optimum — the policy that plans under the posterior \(p(\xi \mid o_{1:t}, a_{1:t})\). Memoryless policies average over \(\xi\); recurrent/adaptive policies infer it.
| Symbol | Meaning |
|---|---|
| \(x_t,\ a_t,\ o_t\) | robot state, motor action, raw observation (pixels, proprioception) |
| \(P(\cdot\mid x,a),\ \hat P(\cdot\mid x,a)\) | real and simulated transition kernels |
| \(\xi \in \Xi\) | physical (domain) parameters: masses, friction, latency, motor gains |
| \(M_\xi\) | the simulator instantiated at parameters \(\xi\); reality \(\approx M_{\xi^\star}\) |
| \(\pi_\theta,\ J_M(\pi)\) | policy and its expected discounted return in model \(M\) |
| \(T^\pi_M,\ T_M\) | Bellman evaluation / optimality operator of model \(M\) |
| \(\lVert \mu - \nu \rVert_{TV}\) | total variation distance \(\; \sup_{A} \lvert \mu(A) - \nu(A)\rvert\) |
| \(W_1(\mu,\nu)\) | Wasserstein-1 distance \(\;\inf_{\text{couplings}} \mathbb E\,\lVert X - Y\rVert\) |
| \(\hat z_t = \phi(x_{t-k:t}, a_{t-k:t})\) | on-line estimate of the latent domain parameters |
Deploy the simulator optimum \(\hat\pi \in \arg\max_\pi J_{\hat M}(\pi)\) on real system. Then the transfer regret obeys
\[ \underbrace{J_M(\pi_M^*) - J_M(\hat\pi)}_{\text{what we lose in reality}} \;=\; \underbrace{\bigl[J_M(\pi^*_M) - J_{\hat M}(\pi^*_M)\bigr]}_{\le\, \sup_\pi |\Delta(\pi)|} + \underbrace{\bigl[J_{\hat M}(\pi^*_M) - J_{\hat M}(\hat\pi)\bigr]}_{\le\, 0 \ \text{(by optimality of } \hat\pi)} + \underbrace{\bigl[J_{\hat M}(\hat\pi) - J_M(\hat\pi)\bigr]}_{\le\, \sup_\pi |\Delta(\pi)|} \]
Corollary (the gap controls everything)
\[ J_M(\pi_M^*) - J_M(\hat\pi) \;\le\; 2 \sup_{\pi} \bigl| J_{\hat M}(\pi) - J_M(\pi) \bigr| \] Uniform closeness of values over the policy class — not pointwise accuracy of the physics — is the currency of sim-to-real.
So the entire field reduces to one question: how does \(|J_{\hat M}(\pi) - J_M(\pi)|\) scale with model error?
Simulation Lemma (Kearns & Singh 2002)
If \(\;\sup_{x,a}\lVert \hat P(\cdot\mid x,a) - P(\cdot\mid x,a)\rVert_{TV} \le \varepsilon_P\;\) and \(\;\sup_{x,a} |\hat r - r| \le \varepsilon_r\), with \(|r| \le R_{\max}\), then for every policy \(\pi\): \[ \bigl| J_{\hat M}(\pi) - J_M(\pi) \bigr| \;\le\; \frac{\varepsilon_r}{1-\gamma} \;+\; \frac{\gamma\, \varepsilon_P\, R_{\max}}{(1-\gamma)^2} \]
Proof in one line (telescoping over when the models first disagree): \[ V^\pi_{\hat M} - V^\pi_M = \sum_{t\ge0} \gamma^{t}\, \mathbb E^\pi_{M}\Bigl[ (\hat r - r) + \gamma \bigl(\hat P - P\bigr) V^{\pi}_{\hat M} \Bigr] \quad\text{and}\quad \bigl|(\hat P - P) V\bigr| \le \varepsilon_P \lVert V\rVert_\infty . \]
Read the exponent
The gap scales as \((1-\gamma)^{-2}\) — an effective-horizon-squared amplification. Long-horizon tasks (locomotion, manipulation sequences) magnify tiny physics errors. This is why sim-to-real is hard, in one exponent.
For deterministic dynamics \(x' = f_\xi(x,a)\), any parameter error makes \(\lVert \hat P - P \rVert_{TV} = 2\): the TV bound is vacuous, yet a 1% mass error barely matters. The fix: metrics that see geometry, not just overlap.
Lipschitz refinement of the Simulation Lemma
If \(V^\pi_{\hat M}\) is \(L_V\)-Lipschitz (guaranteed when \(r\) is \(L_r\)-Lipschitz, \(P\) is \(L_P\)-Lipschitz in \(W_1\), and \(\gamma L_P < 1\), with \(L_V \le \tfrac{L_r}{1-\gamma L_P}\)), then \[ \bigl| J_{\hat M}(\pi) - J_M(\pi) \bigr| \;\le\; \frac{\gamma\, L_V}{1-\gamma}\; \sup_{x,a}\, W_1\!\bigl(\hat P(\cdot\mid x,a),\, P(\cdot\mid x,a)\bigr) \]
Value functions are fixed points: \(V_M = T_M V_M\), \(\;V_{\hat M} = T_{\hat M} V_{\hat M}\), each \(T\) a \(\gamma\)-contraction. Standard perturbation bound for contractions:
\[ \lVert V_M - V_{\hat M} \rVert_\infty \;\le\; \frac{1}{1-\gamma}\, \sup_{V} \bigl\lVert T_M V - T_{\hat M} V \bigr\rVert_\infty \]
Now note what training with randomized physics actually does — it iterates a random operator:
\[ V_{k+1} \;=\; \hat T_{\xi_k} V_k, \qquad \xi_k \stackrel{iid}{\sim} p(\xi) \]
There is no fixed point anymore; \((V_k)\) is a Markov chain in value-function space. 1 2
\[ \textbf{(R) Robust:}\quad \max_\pi \min_{P' \in \mathcal P} J_{P'}(\pi), \qquad \mathcal P = \bigl\{ P' : d(P', \hat P) \le \rho \bigr\} \]
\[ \textbf{(B) Bayesian / adaptive:}\quad \max_{\pi \in \Pi_{\text{hist}}} \ \mathbb E_{\xi \sim p}\bigl[ J_{M_\xi}(\pi) \bigr] \quad \text{— infer } \xi \text{ while acting} \]
\[ \textbf{(D) Data-driven correction:}\quad \hat P \leftarrow \text{update}(\hat P;\ \text{real rollouts}), \quad \text{or fine-tune } \pi \text{ on } M \]
The ten methods of Part II are engineering instantiations of (R), (B), (D) — and hybrids. Classify a paper by which stance it takes, and you know its failure modes.
| # | Method | Family | Stance | Real data? |
|---|---|---|---|---|
| 1 | Domain randomization | A. Robustify in sim | average-case (R/B) | none |
| 2 | Robust & adversarial RL | A. Robustify in sim | worst-case (R) | none |
| 3 | System ID & actuator nets | B. Calibrate the sim | (D) offline | small, offline |
| 4 | Adaptive / Bayesian DR | B. Calibrate the sim | (B)+(D) loop | small, iterative |
| 5 | Grounded sim / residual dynamics | B. Calibrate the sim | (D) on \(\hat P\) | moderate |
| 6 | Teacher–student distillation | C. Adapt at deployment | (B) amortized | none |
| 7 | Online estimation (RMA / OSI) | C. Adapt at deployment | (B) explicit | none |
| 8 | Meta-learning | C. Adapt at deployment | (B) in weights | none / few shots |
| 9 | Observation alignment (visual) | D. Correct with real data | (D) on \(q(o\mid x)\) | unlabeled images |
| 10 | Real fine-tuning & residuals | D. Correct with real data | (D) on \(\pi\) | on-robot RL |
A–B act before deployment; C adapts at deployment without real training; D spends real data.
Train one policy against a distribution of simulators:
\[ \max_\theta \; \mathbb E_{\xi \sim p(\xi)} \bigl[ J_{M_\xi}(\pi_\theta) \bigr] \]
Replace the average by a minimax — stance (R) in its pure form:
\[ \max_\theta \min_{P' \in \mathcal P} J_{P'}(\pi_\theta) \qquad\Longleftrightarrow\qquad \max_\theta \min_{\omega} J\bigl(\pi_\theta, \pi^{\text{adv}}_\omega\bigr) \]
Shrink \(d(\hat P, P)\) directly: fit the simulator to real trajectories before training.
\[ \hat\xi \;=\; \arg\min_{\xi} \sum_{i} \bigl\lVert x^{\text{real}}_{i+1} - f_\xi\bigl(x^{\text{real}}_i, a_i\bigr) \bigr\rVert^2 \qquad\text{(classical gray-box ID)} \]
The decisive modern refinement: identify the actuator, not just the rigid body —
\[ \tau_t = g_\eta\bigl(\text{command}_{t-k:t},\ \dot q_{t-k:t}\bigr) \quad \text{(a learned network in the sim loop)} \]
Calibration and randomization are complements, not rivals: identify what you can, randomize what you cannot.
Close an outer loop over the randomization distribution itself — a bilevel program:
\[ \min_{p \in \mathcal P_\Xi} \; D\Bigl( \mathbb P^{\text{real}}_{\tau},\ \mathbb E_{\xi\sim p}\, \mathbb P^{\text{sim},\xi}_{\tau} \Bigr) \qquad \text{s.t.} \qquad \pi_p = \arg\max_\theta \mathbb E_{\xi \sim p} J_{M_\xi}(\pi_\theta) \]
Do not re-fit \(\xi\) — learn the model-class bias itself from real rollouts (stance D applied to \(\hat P\)):
\[ x_{t+1} \;=\; \underbrace{f_{\hat\xi}(x_t, a_t)}_{\text{physics engine}} \;+\; \underbrace{g_\theta(x_t, a_t)}_{\text{learned residual}} \qquad\text{or}\qquad \hat P \;\to\; \hat P \circ h_\theta \ \ \text{(action transformation)} \]
Tip
Where do “World Models” fit?
Modern World Models (e.g., DayDreamer, large video-predictive models) are the deep-learning extreme of Method 5. Instead of learning a residual on top of a physics engine, they learn the entire transition kernel \(\hat P\) from offline real-world trajectories. This turns the sim-to-real gap into a pure representation-learning problem.
Residual dynamics is real-to-sim: move reality’s information into the simulator, then keep training where data is free.
Exploit the simulator’s superpower: it knows \(\xi\) and the full state.
Step 1 (teacher, RL in sim): train \(\pi^{T}(x_t, \xi)\) with privileged access — an easy, fully-observed MDP. Step 2 (student, supervised): distill into a deployable policy that sees only sensor history:
\[ \min_{\psi}\ \mathbb E_{\xi \sim p,\ \tau \sim \pi^S} \Bigl[ \bigl\lVert \pi^S_\psi(o_{1:t}) - \pi^T(x_t, \xi) \bigr\rVert^2 \Bigr] \qquad \text{(DAgger-style, on-policy states)} \]
The gap between teacher and student is precisely the value of information of knowing \(\xi\) — a quantity team theory has studied for decades.
Make the inference of Method 6 explicit and fast:
\[ \hat z_t = \phi\bigl(x_{t-k:t},\ a_{t-k:t}\bigr) \;\approx\; z = e(\xi), \qquad a_t \sim \pi\bigl(\cdot \mid x_t,\ \hat z_t\bigr) \]
Move adaptation into the training objective: optimize for post-adaptation performance.
\[ \max_\theta \; \mathbb E_{\xi \sim p(\xi)} \Bigl[ J_{M_\xi}\bigl( U_\xi(\theta) \bigr) \Bigr], \qquad U_\xi(\theta) = \theta + \alpha \nabla_\theta J_{M_\xi}(\pi_\theta) \ \ \text{(MAML inner step)} \]
Methods 6, 7, 8 are one idea at three levels: adapt in activations (recurrence), in an explicit latent (\(\hat z_t\)), or in weights (\(\theta\)). All approximate the Bayes-adaptive policy under the DR prior \(p(\xi)\).
The gap also lives in the emission map: \(\hat q(o \mid x) \ne q(o \mid x)\) — rendered pixels are not camera pixels. Align the observation spaces, not the physics:
\[ \min_{G}\ \mathbb E\bigl[ \mathcal L_{\text{task}}\bigl(\pi(G(o))\bigr) \bigr] + \lambda\, \mathcal L_{\text{GAN}}(G) \qquad \text{map both domains into one canonical space} \]
Methods 1–8 estimates \(P\); this fixes observation kernel \(q(o\mid x)\). A full stack needs both — they fail independently.
Spend real data last, where it is worth the most — on the policy itself:
\[ a_t = \underbrace{\pi_{\text{sim}}(x_t)}_{\text{frozen prior}} + \underbrace{\pi^{\text{res}}_\theta(x_t)}_{\text{trained on robot}} \qquad\text{or}\qquad \theta_{\text{real}} \leftarrow \text{RL fine-tune}(\theta_{\text{sim}};\ \text{on-robot rollouts}) \]
| # | Method | Core mathematics | Key references |
|---|---|---|---|
| 1 | Domain randomization | stochastic program over \(p(\xi)\) | Tobin ’17; Peng ’18 |
| 2 | Robust / adversarial RL | minimax, robust Bellman, CVaR | Pinto ’17; Iyengar ’05; Rajeswaran ’17 |
| 3 | System ID + actuator nets | nonlinear least squares in the loop | Tan ’18; Hwangbo ’19 |
| 4 | Adaptive / Bayesian DR | bilevel opt., simulation-based inference | Chebotar ’19; Ramos ’19; OpenAI ’19 |
| 5 | Grounded sim / residual dynamics | residual regression on \(\hat P\) | Hanna–Stone ’17; Golemo ’18 |
| 6 | Teacher–student distillation | KL projection onto info pattern | Lee ’20; Miki ’22; Chen ’19 |
| 7 | Online estimation (RMA/OSI) | latent regression, two-timescale | Yu ’17; Kumar ’21 |
| 8 | Meta-RL | bilevel opt. over adaptation map | Finn ’17; Rakelly ’19; Nagabandi ’19 |
| 9 | Observation alignment | GAN / adversarial invariance | James ’19; Bousmalis ’18 |
| 10 | Real fine-tuning / residual policy | warm-started RL, offline-to-online | Johannink ’19; Silver ’18; Smith ’22 |
A modern humanoid stack composes: 3 + 1 (calibrate, then randomize) + 6/7 (adaptive policy) + 9 (visual alignment) + 10 (final on-robot polish).
The Problem: The standard Simulation Lemma gives a bound of the form: \[ \bigl| J_{\hat M}(\pi) - J_M(\pi) \bigr| \le \frac{\gamma}{(1-\gamma)^2} \sup_{x,a} \lVert \hat P - P \rVert \] For \(\gamma \approx 0.99\) (e.g., \(100\) Hz control), the coefficient \((1-\gamma)^{-2} \approx 10000\). The bound is astronomically loose and predicts zero transfer.
Mathematical Frontier: Identify structural properties of the closed-loop operator \(T^\pi_M\) that collapse the effective horizon. If the policy induces geometric ergodicity or the system is incrementally strictly dissipative, the sensitivity should decouple from \((1-\gamma)^{-1}\): \[ \lVert V^\pi_{\hat M} - V^\pi_M \rVert \le C(\pi) \sup_{x,a} d(\hat P, P) \quad \text{where } C(\pi) \ll \frac{1}{(1-\gamma)^2} \] Challenge: Characterize the function class of \(C(\pi)\) for underactuated, contact-rich robotics.
The Problem: For continuous control bounds, we rely on \(P_\xi\) being Lipschitz in \(W_1\) with respect to domain parameters \(\xi\). However, rigid-body contact models cause discontinuous state jumps at impact: \[ \lim_{\epsilon \to 0} W_1\bigl( P_{\xi}(\cdot \mid x,a), P_{\xi+\epsilon}(\cdot \mid x,a) \bigr) \not\to 0 \] A tiny parameter error \(\epsilon\) shifts the time of impact by \(\delta t\), throwing the trajectory into an orthogonal mode.
Mathematical Frontier: Develop a perturbation theory for hybrid and measure-driven dynamics. We need a weakened topology (e.g., Skorokhod \(J_1\) metric or occupation-measure distances) under which the value function remains continuous across contact boundaries. \[ \sup_{\pi} \bigl| J_{M_\xi}(\pi) - J_{M_{\xi'}}(\pi) \bigr| \le L \cdot d_{\text{hybrid}}(\xi, \xi') \]
The Problem: Standard Domain Randomization iterates \(V_{k+1} = \hat T_{\xi_k} V_k\) with i.i.d. \(\xi_k \sim p(\xi)\). Adaptive DR (Method 4) moves the distribution \(p_k\) itself based on real data, creating a two-timescale stochastic recursion: \[ V_{k+1} = \hat T_{\xi_k} V_k, \qquad \xi_k \sim p_k \] \[ p_{k+1} = \text{Update}(p_k, \tau_{\text{real}}, V_k) \]
Mathematical Frontier: Prove the stability of time-inhomogeneous iterated random operators. Does the sequence of invariant measures \(\mu_{p_k}\) track the varying distribution smoothly? \[ W_2(\mu_{p_{k+1}}, \mu_{p_k}) \le \alpha_k \lVert p_{k+1} - p_k \rVert \] Challenge: Establishing probabilistic contraction when the operator distribution is adapted to the operator’s own history.
The Problem: Sim-trained policies fail unpredictably when the real-world deployment distribution \(M_{\text{deploy}}\) drifts outside the training support \(\Xi_{\text{train}}\).
Mathematical Frontier: Construct a statistical safety case that triggers a fallback behavior before failure. We need to couple Markov-chain concentration inequalities with sequential change-point detection: \[ \mathbb P\left( \sup_{t} \; d\bigl( \hat P_{t}, P_{\text{train}} \bigr) > \rho \;\Big|\; o_{1:t} \right) \le \delta \] Challenge: Formulating finite-sample Hoeffding-type bounds for non-asymptotic Markov chains without requiring exact knowledge of the mixing time of the highly complex closed-loop system.
The Problem: Teacher-student distillation (Method 6) works by matching a deployable policy \(\pi^S(o_{1:t})\) to a privileged teacher \(\pi^T(x_t, \xi)\). Why is it empirically better than training \(\pi^S\) directly with RL?
Mathematical Frontier: Formalize the gap as a stochastic team theory problem. The value of privileged information is the performance gap between the fully centralized information structure \(\mathcal I_T\) and the decentralized structure \(\mathcal I_S\): \[ \text{VoI} \;=\; \max_{\pi^T \in \Pi(\mathcal I_T)} J(\pi^T) \;-\; \max_{\pi^S \in \Pi(\mathcal I_S)} J(\pi^S) \] Challenge: Characterizing the loss of the KL-projection distillation step. When does the proxy loss \(\min_{\psi} \mathbb E [ \text{KL}(\pi^T \parallel \pi^S_\psi) ]\) strictly bound the transfer regret \(\mathcal R\)?
The Problem: Modern stacks compose 4+ methods simultaneously (e.g., ID + DR + Adaptation + Residual RL). However, their error bounds are currently analyzed entirely in isolation.
Mathematical Frontier: Develop an interface theory for sim-to-real pipelines. If Module A has error \(\epsilon_A\) in metric \(d_A\), and Module B has error \(\epsilon_B\) in metric \(d_B\), how do they compose end-to-end? \[ \Delta_{\text{total}} \;\le\; C_1 \epsilon_{\text{ID}} + C_2 \epsilon_{\text{DR}} + C_3 \epsilon_{\text{Adaptation}} \] Challenge: Many methods solve orthogonal errors (e.g., visual alignment vs dynamics residuals), but others interfere (e.g., conservative robust RL fighting with an adaptive latent). We need a unified algebra for cascaded MDP approximations.
Sim-to-real is where stochastic control, robust optimization, and statistical inference meet contact-rich mechanics — a theory-hungry field.
Close the gap with mathematics, not hope.
Abhishek Gupta · The Ohio State University & Ensemble Control Inc. · The Sim-to-Real Gap