Training the Real-World Inverse Model Where It Will Be Used: Joint Forward–Inverse Learning for Sim-to-Real Transfer

A robot policy trained in a physics simulator usually fails on real hardware because the real machine behaves differently. It may have friction the simulator never modeled, elastic cables, backlash in the gears, or delays in the motors. One simple and effective fix, from Christiano et al., keeps the simulator's plan and relearns only the low-level execution. The simulated policy says "the arm should be here next." An inverse dynamics model, meaning a network that takes the current state and a desired next state and returns the motor command that produces that transition, is trained on real robot data to make it happen. That paper reports reaching high transfer performance on a MuJoCo humanoid with about 16,000 target-environment samples, against roughly 70 million for training from scratch.

The approach has a structural weakness that we think can be fixed cheaply. The inverse model is trained on transitions the real robot actually made while exploring. At deployment it is queried on transitions the simulator wants, and some of those are unusual or impossible for the real machine. Nothing tells the inverse model when a request is out of reach, and nothing trains it on the requests it will actually receive. We propose to learn a real-world forward model alongside the inverse model. The forward model is a residual correction on top of the simulator's own step function, and it predicts what the real robot will do after a given command. With it, the inverse model can be trained by gradient on exactly the simulator-proposed targets it will face. The same forward model detects unreachable targets and replaces them with the nearest reachable ones. The claim is specific: coupling the two models across the sim-to-real boundary should cut the real data needed for transfer and should rescue cases where the naive transfer starts at zero success.

Core Claim

Let $s_t$ be the robot's proprioceptive state (joint angles and velocities), $a_t$ the command, and $\mathrm{sim}(s,a)$ the simulator's one-step prediction. We learn a real forward model $f_\theta(s,a) = \mathrm{sim}(s,a) + r_\theta(s,a)$, where $r_\theta$ is a small network absorbing whatever the simulator gets wrong. We also learn an inverse model $g_\phi(s, s^*)$. Both are fit to the real transitions $\mathcal{D}_{real}$. The inverse model receives an additional term evaluated on the targets $s^*$ proposed by the simulated policy, drawn from the states visited during real deployment:

$$ \mathcal{L}(\phi) = \mathbb{E}_{\mathcal{D}_{real}}\big\|g_\phi(s_t,s_{t+1}) - a_t\big\|^2 + \lambda\, \mathbb{E}_{s,\,s^*\sim \pi_{sim}}\big\|f_\theta(s, g_\phi(s,s^*)) - s^*\big\|^2 . $$

The second term trains the inverse model through the forward model, on the query distribution rather than the exploration distribution. The weight $\lambda$ trades it off against the supervised term. When the residual $\min_a \|f_\theta(s,a)-s^*\|$ is large, the target is flagged as unreachable. The executed target is then shrunk toward the current state along the simulator's intended direction, to the largest step the forward model predicts can be achieved. Training a controller through a learned forward model is an old idea in control. What is new here is using it to close the gap between where a sim-to-real inverse model is trained and where it is queried, and anchoring the forward model to the simulator so it needs far less real data than learning physics from scratch.

Relation to Prior Work

Christiano et al. supply the base method and the motivating gap. Their own limitations are that forward predictions come only from the simulator, so there is no real-world forward model, and that miscalibrated simulator targets can fall outside what the robot can physically reach. We keep their decomposition and add exactly those two missing pieces.

The joint forward–inverse literature supplies the reason to expect that coupling helps. Agrawal et al. show on real Baxter poking data that joint training keeps learned features from collapsing and makes them predictive of physical consequences. Lutter et al. train a physics-structured model on both torques and accelerations and reach 90% swing-up on a real Furuta pendulum, where classical system identification got 0%. Shaj et al. show that an action-conditioned recurrent Kalman model captures hydraulic hysteresis far better than an LSTM (RMSE 0.0144 versus 0.2067 on the BROKK-40). All three learn on hardware from scratch, and none uses a simulator as the prior that a residual corrects. Shaj et al.'s model is a candidate drop-in for $r_\theta$ when sensor noise is severe.

DeFI constrains the design. It finds that forcing one representation to forecast pixels and predict actions causes interference, and that separately pretrained modules work better. We take this seriously in two ways. First, our forward model predicts low-dimensional state, not pixels. Second, the two networks share no parameters and are coupled only through the loss above, so the capacity conflict DeFI describes should not arise. One ablation tests coupling through a shared encoder directly, to see whether DeFI's effect appears even here.

The sim-to-real methods differ in what they correct. Peng et al. randomize simulator physics and let a recurrent policy infer the dynamics implicitly. TuneNet and CAPTURE adjust scalar simulator parameters. SPARR learns a model-free action residual with reward-driven reinforcement learning on the real robot. None of these learns a non-parametric correction that is then used to train the controller. Zhang et al. show that forward-model likelihood on real trajectories predicts transfer success. We borrow that forward-only metric as a secondary comparison point for our forward–inverse residual.

Research Program

The program has three parts. First, we build the residual forward model and the jointly trained inverse model on top of Christiano et al.'s pipeline, keeping their exploration procedure for collecting $\mathcal{D}_{real}$ so the only change is the learning objective.

Second, we alternate data collection and training. The robot executes the sim policy through the current inverse model and target projection. Every executed transition is added to $\mathcal{D}_{real}$. The visited states supply fresh $(s, s^*)$ queries for the second loss term.

Third, we study the regime where transfer starts from nothing, the cold-start failure that both Christiano et al. and SPARR acknowledge. Here target projection is what keeps the robot moving usefully while the residual is still poor.

We deliberately exclude vision. Christiano et al. note that their method assumes matched observation spaces, and extending to pixels would reintroduce the entanglement problem DeFI documents. A visual version is a follow-up only if the proprioceptive result holds.

Baselines

The naive reference is the simulator policy's actions executed open-loop on the target system. Next to it we run a hand-tuned proportional-derivative controller that tracks the simulator's target states, which is the controller Christiano et al. beat on their bungee-cord Fetch arm. Beating both is necessary but not interesting.

The strongest direct competitor is the inverse-only model of Christiano et al.. It is the method we modify, and on the humanoid it is the strongest transfer-efficiency result reported in the file, about 16,000 target samples versus about 70 million from scratch. For the physical bungee-cord Fetch experiment the file gives no number; no reported result was found on Lacuna for a numeric Fetch success rate. We run it with the identical real-data budget, network size, and hyperparameter search budget as our method, sweeping budgets from a few thousand to tens of thousands of transitions. Beating it means reaching the same fraction of source-policy return with at least a factor of two fewer real transitions, or reaching clearly higher final return at equal budget.

The zero-shot robustness competitor is dynamics randomization with a recurrent policy, following Peng et al., who report 0.89 ± 0.06 success on real Fetch puck pushing. We train it with the same simulator compute used for the source policy and randomization ranges that cover the parametric part of the gap. It serves as a floor our method must exceed once any real data is used, and as the main threat when the perturbation is purely parametric.

The parametric system-identification competitor follows TuneNet. We fit simulator parameters on the same real data, then retrain or re-execute the sim policy.

Three ablations isolate the key ingredient. The first removes the deployment-distribution term ($\lambda=0$), leaving joint training that shares nothing but data. The second removes target projection. The third replaces the simulator-anchored forward model with a network learned from scratch. Finally, a shared-encoder variant tests DeFI's entanglement claim in this setting.

Why not just…?

Why not just collect more real data for the inverse-only model? This is the most serious alternative. If the only problem were too few samples, more exploration data would close it. Our argument is that the problem is a mismatch of distribution: exploration data rarely covers the specific transitions the sim policy requests. The data-budget sweep settles this directly. If inverse-only catches up at a modest multiple of our budget, the contribution is small and we will say so. If it plateaus below our method at every budget, the query-distribution loss is doing real work.

Why not just randomize the simulator more broadly? Randomization has two known problems. Broad ranges produce sluggish, conservative policies, a limitation noted by both CAPTURE and TuneNet. Peng et al. also state that their policy cannot handle physics outside the randomized bounds. We test this with perturbations that have no simulator parameter at all, such as an added elastic force like Christiano et al.'s bungee cord, backlash, and latency jitter. On purely parametric shifts, randomization may well match us, and we will report that honestly.

Why not just tune the simulator's parameters? TuneNet and CAPTURE converge quickly when the gap is a wrong mass, friction coefficient, or center of mass. The file's own summary of these methods says they fail when the real phenomenon has no counterpart in the simulator's equations. Our perturbation suite separates parametric from non-parametric gaps, so the comparison will show where tuning suffices and where a learned residual is needed.

Why not just learn an action residual with reinforcement learning, as SPARR does? SPARR achieves 95–100% on its assembly tasks. It needs an automated reward signal and a base policy with non-zero real success to seed its buffer. Our method needs neither reward nor initial success. The cold-start experiment, run under a matched real-interaction budget, is where SPARR-style bootstrapping should stall and ours should not.

Proposed Experiments

The main test bed is sim-to-sim, which allows many seeds. We use the MuJoCo tasks of Christiano et al., including the humanoid under altered gravity and motor noise. We add non-parametric target-side perturbations: a spring force between a limb and the world, gear backlash, and random actuation delay. Severity is graded until the naive transfer reaches zero return.

Metrics are:

  • real transitions needed to reach 90% of source-policy return;
  • final return at fixed budgets;
  • the fraction of sim targets flagged unreachable;
  • whether projected targets preserve task progress.

A secondary analysis asks whether the cycle residual $\|f_\theta(s,g_\phi(s,s^*))-s^*\|$ on held-out real snippets predicts final transfer return better than forward-model likelihood alone. This is the comparison Zhang et al. did not make, whose forward metric correlated at $R^2=-0.99$ with success in their sim-to-sim study.

Physical validation repeats the bungee-cord arm setup of Christiano et al. on a 7-DOF arm. If hardware allows, we add the Quanser Furuta pendulum used by Lutter et al., where friction and stiction make the reachability issue acute.

The decisive checks are three. First, at matched real-data budgets, our method must beat inverse-only on the non-parametric perturbations; if it does not, the idea fails. Second, the $\lambda=0$ ablation must lose most of that gain; otherwise the benefit comes from something other than training on the query distribution. Third, in the cold-start regime, target projection must turn zero naive success into non-zero success within the first few thousand real transitions, which is where inverse-only and bootstrapped residual reinforcement learning are expected to stall.