Worked examples — World models and embodied AI
This page takes the machinery from the parent note — the forward model , planning with it, and the V-M-C dream architecture — and drives it through every kind of input you can hit. Before we start, one promise from the contract: no symbol appears before we say what it means in words and show it in a picture.
Words we will use, each earned here:
- state — a full snapshot of the situation at time step (the little subscript just means "at time step number "; is now, is one tick later).
- action — the choice the agent makes at step .
- reward — a single number saying "how good was that." Bigger is better.
- latent — a compressed state: instead of a whole 64×64 picture, a short list of numbers that keeps only what matters.
- rollout — running the dream machine forward several steps, feeding its own output back into itself.
The scenario matrix
Every world-model problem is one of these cells. The 8 examples below hit all of them.
| Cell | What is stressed | Degenerate / limiting question it answers |
|---|---|---|
| C1 Deterministic dynamics | model is a plain function, no randomness | what happens when ? |
| C2 Stochastic single mode | one bell-curve of futures | how does uncertainty grow per step? |
| C3 Multimodal future | future forks (left OR right) | why one Gaussian fails |
| C4 Zero / no-op action | action does nothing | does the model leave the state alone? |
| C5 Planning horizon | choosing an action sequence by return | short vs long horizon trade-off |
| C6 Compounding model error | dream drifts from reality | why -step rollouts, not -step |
| C7 Dyna real+sim mixing | weighting simulated data | the trust knob |
| C8 Real-world word problem | robot arm, sim-to-real | grounding + Sim-to-Real-Transfer |

The building blocks, in plain words
Worked examples
Example 1 — Cell C1: deterministic dynamics ()
Forecast: guess and whether is near zero or very negative.
- Roll the model forward. Why this step? With the bell curve collapses to a spike at , so the "distribution" is really a plain function — no averaging needed.
- Collect rewards at . Why this step? uses steps , i.e. the states before each action lands.
- Sum.
Verify: every is an exact integer because there is no noise — that is the signature of a deterministic model (). , . Units: reward is unitless "points", summed → still points. ✔
Example 2 — Cell C2: single-mode stochastic, uncertainty growth
Forecast: does uncertainty stay at , grow to , or grow to ?
- Write each step as start + noise. Why? Independent noises add, and for independent randoms the variances add (not the 's directly).
- Add variances. Why this rule and not adding ? Because is a length and variances are the thing that superimposes for independent noise — like combining independent wobbles by Pythagoras, not by simple addition.
- So the spread is .
Verify: at step variance was ; at step it is ; it grows linearly with steps. This is exactly why long dream-rollouts get untrustworthy (foreshadows C6). ✔

Example 3 — Cell C3: multimodal future (why one Gaussian fails)
Forecast: will the single Gaussian sensibly predict "left or right", or predict something nonsensical?
- A single Gaussian's mean is the average of the data. Why? Maximum likelihood for one Gaussian sets to the sample mean — that is what minimising does.
- Interpret . The car predicts it will drive straight into the wall between the roads — a state that never actually happens.
- The fix: a mixture with two components . Now the model puts probability mass on the real outcomes, none in the middle. This is precisely why the M-network in the parent uses a Mixture Density Network over a plain RNN regressor.
Verify: the mixture assigns while the single Gaussian peaks there — the single model is confidently wrong. . ✔

Example 4 — Cell C4: zero / no-op action (degenerate input)
Forecast: guess whether a tiny is harmless.
- What SHOULD happen? Why check this? A correct model must satisfy: do nothing → state unchanged, i.e. . This is the degenerate anchor every dynamics model must pass.
- What DOES happen? Each step adds . Over steps the drift is .
- Judge. A one-unit phantom drift with zero action means the model hallucinates motion. In a dream-trained controller this is catastrophic: the policy "learns" to counter a force that does not exist.
Verify: ideal drift ; observed → model fails the no-op test. The number is the accumulated bias . ✔
Example 5 — Cell C5: planning over a horizon (MPC)
Forecast: can the agent reach and stay rewarded within 3 steps?
- Enumerate — it's cheap for small . Why brute force? With sequences we can afford exact search; this is "shooting" MPC in its simplest form.
- Score two candidates.
- : states visited at are → rewards → .
- : states → rewards → also (the reward is checked at before moves it, so step-2's scores).
- Best return. No sequence beats because you cannot reach before from (minimum two steps), so at most one rewarded step fits in the window.
Verify: minimum steps to reach is ; window has steps , so exactly one visit to is possible → . Lengthening would allow lingering and higher return — the horizon caps achievable return. ✔
Example 6 — Cell C6: compounding error → short rollouts
Forecast: guess the -step predicted value — is per step "small"?
- Model the compounding. Why multiply not add? Errors in an autoregressive model feed back into the next input, so a fractional bias compounds geometrically: predicted .
- Evaluate. (error ). (error ).
- Decision. Short -step rollouts keep dream error tiny; long rollouts explode. This is the exact reason Dyna uses short simulated rollouts, established in the parent's Step 3.
Verify: so a modest step bias becomes a blowup in ten steps — dream is untrustworthy long-range. ✔

Example 7 — Cell C7: Dyna real + sim weighting ()
Forecast: guess the update, and whether cutting to throws away useful data.
- Plug in. Why the multiplier? It scales how much we believe the dream; a poor model → shrink so its bias barely moves us.
- Limit . — we fall back to pure model-free RL: only real experience counts. Safe but sample-hungry.
- Limit . The (possibly wrong) dream dominates — fast but can diverge.
Verify: with , ; with , . The knob smoothly trades speed for safety. ✔
Example 8 — Cell C8: real-world word problem (robot + sim-to-real)
Forecast: will the transfer succeed or slip?
- Dream target. Controller aims for reading (dream's grip threshold). Why ? It was trained to hit the minimum successful force in simulation.
- Apply the reality gap. Why multiply by ? The real sensor under-reports; the effective real force is .
- Compare to the true threshold . → the grip fails (slips). This is a textbook Sim-to-Real-Transfer failure: the dream was internally consistent but ungrounded.
- Fix. Domain randomisation / calibration so the model's latent matches real physics — the grounding argument from the parent's Embodied-AI section.
Verify: real force → fails. If instead the controller over-commands to reading , real force → succeeds. The gap is exactly the factor. ✔
Recall Self-test
Model with behaves like what? ::: A plain deterministic function (bell collapses to a spike). Two independent noise steps of give what variance after two steps? ::: (variances add). Why a mixture, not one Gaussian, for a car at a fork? ::: One Gaussian predicts the average (straight into the wall); a mixture keeps mass on the real left/right outcomes. What must a correct model output for a no-op action? ::: The unchanged state, . Why does Dyna prefer short -step rollouts? ::: Model error compounds geometrically over steps. What does reduce Dyna to? ::: Pure model-free RL (only real experience). A sensor gap turns a dream force of into what real force? ::: — below threshold, grasp fails.