A gripper must reach a goal behind a wall. A policy that only reacts walks into the wall. A planner that imagines 20 steps ahead walks around it, but only while its model is right.
Learn what a robot world model predicts, how to fit one, and two ways to use it: plan with it, or train a policy in it.
Pick Policy, then Planner. Slide the horizon from 8 to 20. Then raise the model error and watch the imagined path part from the real one. After that we build, piece by piece, the interface, the dynamics model, MPC, imagined training and SuperMimic.
You need a little Python and the idea of a derivative. We build the rest from zero.
Based on Lecture 17 of Penn CIS 6280: World Models (Fall 2026), taught by Jiatao Gu. Lecture slides. Every idea is re-taught here in our own words and devices. It follows Lecture 16, Learning 3D and 4D World Models in this series.
Illustrative toy: a 1 by 1 world with a step of 0.05 and 24 headings. The planner scores two-heading plans in its model: heading A for half the horizon, heading B for the rest. It replans every step and executes the first step. Its model knows the wall but adds a downward drift of 0.02 times the error each step. A plan scores its closest approach to the goal, plus 0.004 per step. The policy heads straight for the goal. No number is from the lecture.
Chapter 0
See why a robot needs a prediction of its own future, and the two ways to use one
A robot arm reaches for a mug. It sends a motor command. The arm moves, the camera sees a new image, and the next command depends on that image. Then the loop runs again.
That is a closed loop: the robot's action changes what it will sense next. A world model is a function that predicts the result of an action before the robot takes it. The same lecture asks what the robot should do with that prediction.
| Use | What it optimizes | When it runs |
|---|---|---|
| Planning | the action sequence for the situation now | on the robot, at every decision |
| Policy learning | one function πθ(observation, goal), shared by all situations | during training; the robot may run only the policy |
The hero at the top uses both ideas. Its planner imagines rollouts in a model. Its policy is a plain function with no model at run time.
Chapter 1
Separate what the robot senses, what it commands and what physically happens
You tell a robot joint to go to 1.0 radian. A moment later it reads 0.4. Did the command fail? No. The motor needs time to get there.
Proprioception is sensing the robot's own body: joint angles q from encoders, and joint velocities. The actual angles are state. Their measured values are observations. An IMU (inertial measurement unit) reads body rotation and acceleration. It does not read position, so you must estimate tilt and velocity from joints, IMU and contact together.
Forward kinematics turns current joint angles and link lengths into a gripper pose. It predicts nothing about the future. Dynamics does: it maps the current state and a command to the next state.
| Action | What executes it | Result to predict |
|---|---|---|
| Joint angle target | a joint controller tracks it | actual angles and velocities |
| Joint torque | actuators apply it | actual angles and velocities |
| Gripper pose target | inverse kinematics, then joint control | actual gripper and joint motion |
Inverse kinematics (IK) finds joint angles for a wanted gripper pose. It may have several answers or none, because joint limits and collisions constrain it. It is geometry before any motion.
Purple: the command. Blue: the joint's real angle. Warm: the model's prediction. Choose what the model assumes, then change the lag.
Illustrative: each control interval the joint closes a fraction of its gap to the command. The fraction is the lag. It starts at q = 0 with a command of 1.0 rad. Real joints also have inertia and velocity.
With lag 0.4 the joint reads 0.4, then 0.64, then 0.784. A model that copies the command predicts 1.0 each time. At step 3 it is off by 0.216 rad.
The failure: symptom, a planner picks aggressive moves that never arrive. Measurement: compare the commanded target with the measured angle at step 3. Fix: train the model on the executed command and the measured response, not on the target alone.
Chapter 2
Find the push where nothing moves, and the push where the object slides
A hand pushes a 1 kg block on a table. At a gentle push, nothing happens. Push harder and the block slides. The same command gives two different worlds.
Before contact, no hand force reaches the object. The command moves only the arm. During contact, forces decide the response: the hand pushes, and friction from the table pushes back.
The bar compares your push with the friction limit. The block shows where it is after 1 second.
Illustrative: m = 1 kg, g = 9.8 m/s², one friction coefficient for sticking and sliding, a level table, 1 second of constant push.
Friction can supply at most μ m g. With μ = 0.4 that is 0.4 × 1 × 9.8 = 3.92 N.
A simulator is also a world model. It has two separate operations. Step applies a command and advances the physical state: body pose, joints, velocities and contacts. Render makes the camera view.
The response jumps at the friction limit. A model that predicts smooth motion for every push gets the stay case wrong. A manipulation model must predict the object's response as well as the robot's motion.
The failure: symptom, the model slides the block for every push. Measurement: score predictions on small pushes alone. Fix: collect data below and above the limit, and keep the object's state in the model's input.
Chapter 3
Watch a small one-step error grow into a large multi-step error
You fit a model that predicts the next state with a tiny error. You then feed its own output back in, 10 times. The error is no longer tiny.
A transition has three parts: the state before, the executed action with its duration, and the state after. The model predicts the last from the first two. The loss compares prediction and record.
A rollout feeds each prediction into the next step. A multi-step fit replays the recorded actions from the same start. It compares every predicted state with the record, then updates ω from the combined loss.
Blue: the real state. Warm: the model fed its own output. Red: the gap. Raise the error, then lengthen the horizon.
Illustrative: st+1 = ρ st + 0.1 a with a = 1 each step and s = 0 at the start. The real ρ is 0.95. The model's ρ is 0.95 plus the error.
Take the error 0.05, so the model's ρ is 1.00. The real state climbs to 0.28525 at step 3. The model reaches 0.3. The gap is 0.015.
Many supervised steps in one sequence is teacher forcing: every prediction starts from the recorded past. At rollout time the model starts from its own past. The mismatch is where the growth comes from. Self Forcing (Huang et al., 2025) trains on the model's own rollouts.
The failure: symptom, good one-step scores and bad 10-step rollouts. Measurement: plot error against the horizon. Fix: add a multi-step loss, or train on the model's own rollouts.
Chapter 4
See why a mean prediction can name an outcome that never happens
A robot pushes an object near a table edge. Half the time the object sticks. Half the time it slides 0.6 m. What single answer is right?
A model trained to minimize squared error predicts the average outcome. Here that is 0.3 m. The object never lands at 0.3 m. Unobserved contact details and friction decide the outcome, so the model needs a distribution.
The strip is the object's final position. Blue dots: what happens. Warm: what the model says. Slide the chance of sliding.
Illustrative: two outcomes, 0 m (sticks) and 0.6 m (slides). The sampled model draws 20 predictions from the same two outcomes.
At 50% the mean is 0.5 × 0 + 0.5 × 0.6 = 0.3 m. It is 0.3 m from either real outcome. A planner that trusts it picks actions for a future that cannot occur.
| Model | Prediction | What you fit |
|---|---|---|
| Physics | fphysics(s, a) | physical parameters, or nothing |
| Learned | fω(s, a) | the whole state update |
| Residual | fphysics(s, a) + Δω(s, a) | a correction to the physics |
The residual form adds in compatible coordinates. Rotations need a proper update rule. The output can also be a different representation: physical state, latent features, 3D points, or video. Each must capture the command's consequences. The lecture cites PETS (Chua et al., 2018) for predicting a distribution.
A distribution model can also train on whole rollouts. DMD (Yin et al., 2024) matches the distribution of generated trajectories to a teacher's, not one paired path. For robotics the teacher must model the consequences of the same commands.
The failure: symptom, plans that push a mean object that never exists. Measurement: sample many outcomes and count the modes. Fix: predict a distribution, or add the missing information to the input.
Chapter 5
Trade tracking error against effort, then act on only the first step of the plan
A quadruped robot gallops. Each leg can push on the ground. Which foot forces keep the body at the wanted height and tilt? Model predictive control (MPC) answers with a model and a search.
The lecture's example is convex MPC for MIT Cheetah 3 (Di Carlo et al., 2018). Given the wanted body motion and the gait, it predicts how the body moves under candidate foot forces. It chooses the forces that follow the command and keep the body balanced.
Blue: tracking cost. Yellow: force cost. Teal: the total. The mark shows the cheapest force. Slide the force, then change λ.
Illustrative: the predicted height error is 0.3 − 0.01 × force in metres, for force 0 to 30 N. Cost = error² + λ × force². Not Cheetah numbers.
Take λ = 0.0001. At 15 N the error is 0.15, so cost = 0.0225 + 0.0225 = 0.045. At 10 N: 0.04 + 0.01 = 0.05. At 20 N: 0.01 + 0.04 = 0.05. At 30 N: 0 + 0.09 = 0.09. The minimum is 15 N.
Real feet cannot push arbitrarily. A foot on the ground can push but not pull. Its sideways push is limited, or it slips. A foot in the air gives zero force, and the gait schedule says which feet are down.
Every plan starts from what the robot did. A learned model fills the same role. In PointWorld it takes scene points and candidate robot-point motion, and returns how object points move. The objective scores that motion against the target.
| Part | MIT Cheetah 3 | PointWorld-style |
|---|---|---|
| Model | simplified body physics | learned scene-point dynamics |
| Candidate action | forces at the feet | robot motion commands |
| Goal | follow the body motion | move the object to its target |
The failure: symptom, a plan that looks perfect and a robot that drifts. Measurement: log predicted against measured state after each executed step. Fix: replan more often, and plan from the measured state. The hero shows what a long horizon does to a biased model.
Chapter 6
Estimate long-term return from a short rollout plus a value model
MPC solves a new search at every step. Could the robot instead learn the answer ahead of time, as a function? That function is a policy: at = πθ(ot, gt). It reads observations o and a goal g, and returns a command. The same θ serves every state and control step.
The model gives the policy practice. It predicts a state. From that state we compute an observation (what the sensors would read) and a reward (how well the state matches the goal). Then the policy acts on the imagined observation.
The return G is the sum of future rewards. The discount γ makes far rewards count less. An imagined rollout is short, so the reward after its last step is missing.
The critic learns from a target: the next reward plus the discounted value of the next state. The value in that target stays fixed (a stop-gradient). At termination there is no tail, so the target is the reward alone.
Bars: imagined rewards. The last bar is the critic's tail. The line marks the true return. Change the horizon, then the two error sources.
Illustrative: the true reward is 1 every step and γ = 0.9, so the true return is 10. The critic reports 10 times (1 plus the bias). The model's reward at step k is 1 plus the drift times k.
Take horizon 3 and a critic that is 30% high, so it says 13. The estimate is 1 + 0.9 + 0.81 + 0.729 × 13 = 2.71 + 9.477 = 12.19. The error is 2.19.
At horizon 8 the tail weight is 0.98 = 0.43. The estimate is 5.695 + 0.43 × 13 = 11.29. The error is 1.29. A longer rollout trusts the critic less. Add model drift, and each extra step also adds model error.
The failure: symptom, the policy chases a return that is not real. Measurement: compare the imagined return with the return in the real world. Fix: pick the horizon where the two error sources balance.
Chapter 7
Follow the chain rule from return back to the policy, and see what a wrong slope does
The estimated return depends on the policy weights θ. How should we change θ to raise it? The lecture gives two routes.
| Route | Policy | Uses derivatives through the dynamics? |
|---|---|---|
| Score function | stochastic: a ~ πθ(· | o, g) | No. Raise the probability of actions with above-baseline return. |
| Differentiate the prediction | differentiable: a = πθ(o, g) | Yes. Trace return back through the model to θ. |
Both routes can sample rollouts. The difference is how the update uses the dynamics. In the score-function route, an advantage compares each return with a baseline, and the update raises the probability of better actions. The second route needs the model's slopes to be right.
During this update the model weights are fixed. The simulator is outside the derivative path. The same θ appears at every policy call in the rollout, so each call adds to the gradient.
Blue: the real return. Warm: the return the model believes. Slide the policy weight, then set the model's slope.
Illustrative: observation o = 2 and a = θ × 2. The real next state is s = 0.5 × a. The return is J = −(s − 3)², so the best s is 3. The model uses its own slope.
Take θ = 0.5 and the right slope 0.5.
Now give the model a slope of 1.0. The state it predicts is 1.0, and the gradient is 4 × 1.0 × 2 = 8, not 5. Trained to convergence, it picks θ = 1.5. Reality then reaches s = 1.5, not 3.
The failure: symptom, a policy that is perfect in imagination and weak on the robot. Measurement: compare the model's slopes with finite differences on the simulator. Fix: refit the model on states the new policy visits.
Chapter 8
Follow three training stages and see which weights move in each
A Unitree G1 humanoid must copy a reference motion. Most of its policy training used predicted rollouts, and the deployed controller contains no world model. This is the lecture's complete example (SuperMimic, Liao et al., 2026).
In motion tracking the reference is a desired body configuration over time. The goal gt is the desired motion. The observation ot is the current joint and body measurement. The command at is a set of normalized joint setpoints. The reward compares pose and motion at the same time. A reference is not a motor command: the actor must compensate for the gap between desired and actual motion.
| Benefit | Meaning |
|---|---|
| Fast rollouts | batch many predicted transitions on the GPU |
| Differentiable dynamics | use the slope of predicted motion to improve the actor |
| Simulator evidence | the simulator still supplies the recorded targets |
Warm outline: weights that change. Dashed outline: weights that stay fixed. Grey: not used in this stage. Pick a stage.
A schematic of the lecture's description of the SuperMimic training figure. It shows which parts run and which weights change. It carries no numbers.
The actor update uses the derivative path from the last chapter: command, then predicted body motion, then return. The policy acts on sensor-like inputs built from the predicted state.
Information differs by stage. The deployed actor sees joint motion, inertial signals, observation history and the goal. During training the model and critic may also use simulator state and the physical context.
It reports two benefits separately. One is rollout throughput: the world model against MuJoCo Warp on an H100. The other is policy-update efficiency, with a 64 times annotation on imagined steps needed for comparable return. The baseline SONIC is a PPO-based humanoid motion tracker. The compared runs use different GPU hardware and training data. The plot does not show performance on arbitrary new motions.
The failure: symptom, a policy that exploits model errors. Measurement: evaluate each new policy in the simulator, which stays the source of truth. Fix: recollect with the new policy and refit.
Chapter 9
Choose a training range for friction and see where the policy holds
A policy trained on a simulated floor with friction 0.4 meets a real floor with friction 0.55. Does it still walk? The answer depends on two separate gaps.
| Gap | Compares |
|---|---|
| Model fitting error | the learned prediction with the simulator |
| Sim-to-real mismatch | the simulator with the hardware |
Two tools close them. System identification replays the same recorded commands on hardware and adjusts physical parameters (mass, inertia, friction, actuator response, delay) to match the measured response. The motions must reveal the parameters you want to estimate. Domain randomization trains one policy across a range of plausible systems (Peng et al., 2018).
The curve shows success against test friction. Yellow: your training range. Blue: the real floor, which the actor does not know. Calibrate the centre, then widen the range.
Illustrative: the real friction is 0.55. Success is the peak inside the range and falls off outside it. The peak is 1 minus 1.2 times the half-width, because a wider range makes the policy more cautious. The lecture gives no numbers here.
Take centre 0.4 and half-width 0.05. The range is 0.35 to 0.45. The real 0.55 lies 0.10 outside, so success is near zero.
That is the lecture's rule: calibrate the centre of the range, then randomize the remaining uncertainty. Calibrating costs hardware data. Widening costs peak performance.
The deployed actor usually receives observations, not the true parameters. It can use feedback or history to infer how the current system behaves. Robustness across conditions and adaptation from experience are different abilities.
The failure: symptom, a policy that works at every training value and falls on one real surface. Measurement: test on unseen parameter combinations and real trajectories. Fix: widen toward the missing value, or calibrate. A wide range is not a guarantee.
Chapter 10
Keep the lecture on one page
| Planning | Policy learning | |
|---|---|---|
| Optimize | a current action sequence | a reusable policy |
| Model provides | predicted candidate outcomes | experience or policy gradients |
| Typical deployment | online prediction and search | policy inference, optionally planning |
| Connection | policies can propose actions | values can extend a planning horizon |
Every figure below comes from a worked example in this lesson. Toy numbers say toy.
| Idea | Number | Chapter |
|---|---|---|
| Command against response (toy) | lag 0.4: 0.4, 0.64, 0.784 against a command of 1.0 | 1 |
| Friction limit (toy) | 0.4 × 1 × 9.8 = 3.92 N; 5 N gives 0.54 m in 1 s | 2 |
| Rollout error (toy) | 0.015 at step 3, 0.197 at step 10 | 3 |
| Mean of two outcomes (toy) | 0.3 m, 0.3 m from both | 4 |
| Cheapest foot force (toy) | 15 N, cost 0.045 | 5 |
| Return, horizon 3 and 8 (toy) | 12.19 and 11.29 against a true 10 | 6 |
| Wrong model slope (toy) | gradient 8 not 5; policy ends at s = 1.5, not 3 | 7 |
| SuperMimic imagined steps | 64 times annotation, per the lecture's plot | 8 |
| Training range (toy) | peak 0.76 at ±0.20; 0.94 calibrated at ±0.05 | 9 |
| Term | Plain meaning | Chapter |
|---|---|---|
| Proprioception | sensing the robot's own joints and body | 1 |
| Forward, inverse kinematics | joints to gripper pose, and back | 1 |
| Teacher forcing | every prediction starts from the recorded past | 3 |
| Rollout | a model fed its own outputs | 3 |
| MPC | plan, execute the first part, replan | 5 |
| Critic, value model | estimates the remaining return | 6 |
| System identification | fit physical parameters to real responses | 9 |
| Domain randomization | train over a range of conditions | 9 |
python import numpy as np def rollout(f, s0, actions): # Ch 3: feed the model its own output s, out = s0, [s0] for a in actions: s = f(s, a); out.append(s) return np.array(out) def multistep_loss(f, s_rec, a_rec, W): # Ch 3: replay recorded actions, compare every step pred = rollout(f, s_rec[0], a_rec) d = pred[1:] - s_rec[1:] return np.mean(np.einsum('ti,ij,tj->t', d, W, d)) def mpc_step(f, s, candidates, cost): # Ch 5: predict, score, keep the first action scores = [cost(rollout(f, s, a)) for a in candidates] return candidates[int(np.argmin(scores))][0] # execute it, measure, call again def imagined_return(r, V, s_end, gamma): # Ch 6: short rollout plus a critic tail H = len(r) return sum(gamma**k * r[k] for k in range(H)) + gamma**H * V(s_end) def pathwise_grad(dJ_ds, ds_da, da_dtheta): # Ch 7: chain rule through the model return dJ_ds * ds_da * da_dtheta # 5 * 0.5 * 2 = 5
Run imagined_return with rewards 1, 1, 1, γ = 0.9 and a critic value of 13. You get 12.187. Call pathwise_grad with 5, 0.5 and 2 and you get 5.
Lecture 9 gave planning and control. Lecture 10 and Lecture 11 gave policies, values and Dreamer. This lecture puts them on a robot body. The last slide points ahead: controlling robots from visual and language inputs with action-conditioned models.
This lesson follows Lecture 17 of Penn CIS 6280: World Models (Fall 2026), taught by Jiatao Gu. Read the lecture on the course site and in the lecture slides. The lecture cites PointWorld, SuperMimic, Convex MPC for MIT Cheetah 3, Dreamer, PETS, Self Forcing, DMD and Dynamics Randomization. It also cites texts by Hauser, Tedrake and Hartley et al. All explanations, devices and toy numbers here are our own, built to teach the lecture's ideas.
Now press Teach and explain, from memory, why a robot executes only the first step of its plan. Then go back to the react-or-imagine instrument at the top and push the horizon and the model error once more.