The Sim-to-Real Gap: Why Simulated Humanoids Fail in the Real World
A humanoid can walk perfectly in a physics simulator and fall over in the first second on real hardware. This difference is called the sim-to-real gap, and closing it is a central task in modern robotics.
Training a robot in simulation is attractive. It is fast, cheap and safe. Thousands of virtual robots can practice in parallel, and nobody has to repair a broken leg after a bad attempt. Many of the recent advances in humanoid walking and manipulation came from policies trained this way.
The catch is that a simulator is a model, and every model leaves things out. When a policy learned in simulation meets the real world, those missing details can matter a lot.
Where the gap comes from
Several differences add up. Contact is the biggest. Simulators approximate how a foot meets the floor or how fingers press an object, and real contact is messier, with friction that changes and surfaces that flex. Motors are another source. Real motors have delay, backlash, limited torque and heat effects that simple models ignore.
Sensing adds more. Real cameras have noise, blur and lighting changes, and real joint sensors have small errors. Finally, the robot itself differs from its model. Masses, lengths and cable routing are never exactly as drawn.
Domain randomization
The most common remedy is domain randomization. Instead of training in one perfect world, the simulator is varied on every run. Friction, masses, motor strength, delays, sensor noise and even the floor slope are drawn at random from ranges. The policy learns to work across all of them, so the real world looks like just another variation.
The ranges need care. If they are too narrow, the real robot falls outside them. If they are too wide, the policy becomes overly cautious and performs poorly. Choosing ranges often takes several rounds of testing on hardware.
System identification
The opposite approach is to make the simulator more accurate. System identification measures the real robot, for example by commanding motions and recording the response, and then tunes the simulation parameters to match. This can shrink the gap for motors and body dynamics.
In practice the two methods are combined. A reasonably accurate model is built first, and randomization is added around it to cover what is still unknown. Some teams also learn a correction to the simulator from real data, so that it improves as more experiments are run.
Adapting on the robot
Another idea is to let the policy adapt while it runs. The policy can estimate hidden properties, such as the load it is carrying or the slipperiness of the floor, from recent sensor history, and adjust its actions. Fine-tuning with a small amount of real experience is also common, done carefully to protect the hardware.
Safety limits remain essential during real testing. Torque limits, soft stops and a harness or gantry protect the robot while the policy is still being tested. See our article on humanoid robot safety for related practices.
Measuring the gap
The gap can be measured. Run the same behavior in simulation and on hardware with matched starting conditions and compare outcomes: success rate, tracking error, time to complete and the way failures happen. A large difference points to what the simulator misses.
This is where reproducibility matters. Fixed seeds, recorded environment settings and stored results make it possible to rerun an experiment and see whether a change really helped. These are the habits behind reproducible embodied AI experiments and MuJoCo-based evaluation.
A practical checklist
Teams that bridge the gap well tend to follow a similar routine. They measure the real robot early, so the simulator starts close to reality. They randomize the parameters they are least sure about. They test on hardware in small steps, from standing to stepping to walking, with safety limits in place. They record every run with its settings, so a surprising result can be traced.
Most important, they keep a list of the differences they know about and revisit it after each round. The gap rarely closes in one step. It shrinks as each known difference is measured and either modeled or covered by randomization.
What simulation is still good for
Even with a gap, simulation remains valuable. It is the best way to compare many versions of a behavior quickly, to test dangerous scenarios without risk and to catch obvious bugs before hardware time is spent. The right habit is to treat simulation results as strong hints, not final proof, and to confirm important claims on the real machine.
When reading any claim about a humanoid skill, ask where it was tested, how many times and under what conditions. A result in simulation alone says little about how the robot will behave in a kitchen or a warehouse.
Keep reading
MuJoCo for robotics evaluation · Reproducible embodied AI experiments · How Humanoid Robots Balance and Walk · Teaching Humanoid Robots by Demonstration · Experiment Lab