Visual walkthrough — Model-based RL overview
We build one idea per step. Look at the coloured arrows in each figure — the text points at them.
Step 1 — What is a "model" doing, as a picture?
WHAT. A model is a machine that takes where you are now and what you do, and guesses where you end up next. We write your current situation as (a state — think "the full snapshot of the world right now": the ball's position, the robot's joint angles). We write your choice as (an action — a button you press, a push you apply). The true world has a rule that turns into the real next state, written (read "s-prime", meaning "the next s"). Our learned copy of that rule is written (read "f-hat"; the little hat always means "our estimate of", not the real thing).
WHY. Before we can talk about errors, we must see clearly that there are two arrows leaving every point: the true one and our guessed one. The gap between their tips is the whole story.
PICTURE. In the figure, a single state is a dot. The blue arrow is the truth . The pink arrow is our model . The short yellow segment between the two arrowheads is the one-step error — we will name it in the next step.
Step 2 — Name the one-step error
WHAT. The yellow gap from Step 1 deserves a name. Call its length (the Greek letter "epsilon", by long tradition the symbol for "a small error"). In general the gap is different at different places and choices, so it really depends on ; to get a single number that covers the whole rollout we take the worst case over all states and actions (the symbol below means "the largest value of", read "supremum"):
Term by term: the two vertical-bar pairs mean "the length of" (the norm — how far apart two points are, measured with an ordinary ruler). Inside, we subtract the true next state from the predicted one. The out front says "take the biggest such gap anywhere". The result is a single non-negative number: the largest a single prediction can be off by.
WHY. We need one number we can carry through the whole derivation, not a value that silently changes at every state. Using the worst case makes every later inequality a safe upper bound. Regression training (the parent's least-squares fit) makes this small — but it is never exactly zero on new inputs.
PICTURE. The figure zooms into one dot and draws the two arrowheads close together, with the yellow ruler measuring the gap. A tiny looks harmless here — that is the trap the next steps spring.
Step 3 — Imagining means feeding the guess back in (with the SAME actions)
WHAT. To plan, we don't stop at one step. We take our predicted next state and feed it back into the same model to get , then , and so on. This is a rollout: a chain of imagined states. We index time with a subscript , so is "the imagined state steps into the future", and is the real starting point (both agree, because we start from a real observation).
There are two chains, and they use the same fixed action sequence — the actions we plan to actually take. The true world evolves by its true rule , and our imagination evolves by our learned rule :
Notice the same appears in both lines. This matters: we are comparing "what really happens if I take this plan" against "what my model thinks happens if I take this plan". If the actions differed, the two trajectories would drift apart for a boring reason (different choices) instead of the interesting reason (model error). Keeping identical isolates the model's mistake.
The dangerous word is back in: at step we no longer feed the true into the model — we feed our already-wrong . So the model is now guessing about a place the real world never even visited.
WHY. This feedback is exactly what makes imagination cheap (no real environment steps). But it is also why errors don't just sit there — they feed each other.
PICTURE. Two parallel chains march to the right under one shared action tape : the blue true trajectory and the pink imagined trajectory . They start on the same dot; the yellow gaps between corresponding dots get visibly wider each step.
Step 4 — Why the error grows: the two sources add
WHAT. Let be the total gap after imagined steps (capital for the accumulated error, to distinguish it from the single-step ). Here is the true state from the true recursion of Step 3, and is the imagined state from — same actions, so measures only the model's fault.
Now watch one step. Compare against . Insert the true rule applied to the wrong input, , as a stepping stone (we add and subtract the same quantity, which changes nothing). Now the gap is split by the triangle inequality — the plain fact that "the straight distance from A to C is never more than going via a detour point B", written . With , , :
The first piece is a one-step model error (same into both rules), so it is at most (Step 2). The second piece asks: if I feed the true dynamics two inputs that differ by , how far apart are the outputs? That is exactly a question about whether stretches or shrinks distances.
WHY. The triangle inequality is what lets us separate the model's fresh mistake from the inherited one — without it we could not bound a two-cause error by two nameable pieces. Now we must name how much can stretch a gap, because that factor decides everything. Call it (the Lipschitz constant — the largest amount can multiply any input distance by):
If , never magnifies distances (it is 1-Lipschitz, "non-expansive"); if it shrinks gaps (contractive, stable); if it amplifies them (chaotic, sensitive). Putting the two pieces together gives the honest recursion:
PICTURE. A bar for is shown; the next bar is the old bar scaled by (blue, inherited-and-stretched) with a fresh yellow block () placed on top. When the blue bar keeps its height and we just stack yellow blocks — the simple case we draw next.
Step 5 — Sum the pile: three growth regimes
WHAT. Unroll the recursion from , adding one per step and stretching everything inherited by :
That parenthesis is a geometric series — a sum where each term is the previous one times . Here is why it has the tidy closed form: call the sum . Multiply by : . Subtract the two — every middle term cancels, leaving , so and therefore (when ):
Now read off three cases, straight from the sum:
-
Non-expansive, (the friendly case). The closed form is , so use the raw sum instead: each term is , so it is just copies: This is the parent note's "grows roughly like " — now derived, and the middle case.
-
Contractive, (the best case, stable dynamics). Now as the horizon grows, so the bound stops rising and settles at a ceiling: The error is bounded for all horizons — the inherited gap shrinks faster than fresh error piles on. Stable systems forgive long imagination.
-
Expanding, (chaotic/sensitive systems). The power blows up, so grows geometrically — far worse than linear. This is why "or worse" appears in the parent.
Every symbol: = horizon (steps imagined); = worst-case per-step error; = stretch factor. The product is the drift; is the contractive ceiling; is the exploding one.
WHY. It converts a scary phrase ("errors compound") into three curves you can draw: a bounded curve that flattens (), a straight line (), and an exploding curve (). This is what justifies short horizons except on provably contractive systems.
PICTURE. A graph: horizontal axis is horizon , vertical axis is total error . The contractive bound () is a blue curve that flattens to a ceiling ; the linear bound () is a straight rising pink line; the geometric bound () is a yellow curve bending sharply upward. A dashed line marks the "trust budget"; where a curve crosses it, trust ends.
Step 6 — Edge case: (a perfect / given model)
WHAT. What if the model is exact, ? Then the recursion gives , and starting from we get for every horizon and every — even a chaotic , because there is no fresh error for to amplify. The two chains in Step 3 stay glued together forever; imagination equals reality.
WHY. This is exactly the "model given" case from the parent (chess, Go, AlphaZero): the rules are known perfectly, so you may imagine as far as you like — the only hard part left is searching well, not error. Showing this case proves the compounding problem is a property of learning the model (), not of planning itself.
PICTURE. The two trajectories overlap into one line — no yellow gaps at all. The error graph is flat on the axis.
Recall Two extreme cases side by side
Perfect model (): imagine forever, no drift ::: given-model case (AlphaZero-style), only search is hard — true for any . Learned model (): bounded at if , drift if , geometric if ::: only the last two force small .
Step 7 — The fix, drawn: short horizon + re-plan (MPC)
WHAT. Since error grows with (bounded if , linear if , geometric if ), on the non-contractive systems keep small. Imagine only a few steps, pick the best first action , execute just that one action in the real world, observe the true new state, and then imagine again from there. This is Model Predictive Control (MPC): plan a short window, do one step, re-plan.
WHY. Executing one real action resets the gap to zero ( again) because you land on a genuinely observed state. You never let grow large, so neither nor the geometric term grows large. Re-planning is the mechanism that repeatedly snaps the pink chain back onto the blue chain.
PICTURE. The imagined pink chain runs only a short window (say 3 steps) before the yellow gap would matter; a blue "snap-back" arrow drops the plan back onto the true state, and a fresh short pink window starts. Saw-tooth of small errors instead of one runaway error.
Step 8 — Two more real fixes (why they work here)
WHAT. Beyond short horizons, the parent lists two more defences; both attack terms in .
- Ensembles (Uncertainty and Ensembles in RL): train several models on the same data. Where they agree, the true is small; where they disagree, is effectively large and now visible to us, because the spread of the ensemble's predictions is a measurable stand-in for the invisible true error. A plan that wanders into a high-disagreement region is penalised, so the agent steers away from exactly the places where the term would explode. In short: ensembles turn the unknown into a quantity the planner can see and avoid.
- Value-aware / latent models (MuZero and Dreamer): don't shrink , shrink what counts as error. Instead of measuring as "how wrong is the full next state (every pixel)", measure it as "how wrong is the next state in the features that change the reward and the decision". Predicting only decision-relevant quantities makes the per-step in our bound smaller, because irrelevant pixel noise no longer inflates it. Same , smaller , smaller .
WHY. Each is a knob on the same formula : MPC lowers ; ensembles detect large so the plan avoids it; latent/value-aware models lower the that actually matters. Same enemy, three levers.
PICTURE. The error curve from Step 5 with three labelled arrows pushing it down: one arrow shortening (MPC), one arrow lowering the whole curve via smaller (latent/value-aware), and a shaded high- region that the ensemble flags and the plan routes around.
The one-picture summary
WHAT. Everything on this page in one frame: a true (blue) trajectory and an imagined (pink) one starting together under the same actions; the yellow gap per step, stretched by and summing to (bounded at when , just when , exploding when ); the blue trust-budget line; and the blue snap-back arrow (MPC) that keeps the window short. If , the pink line lies on the blue line for any and no snap-back is ever needed.
Recall Feynman: tell the whole walkthrough in plain words
You're planning a road trip using a hand-drawn map you made yourself. Step 1: reality has a true road (blue) and your map has a drawn road (pink) — they start at your house together. Step 2: your map is a little off at each intersection; the biggest possible miss anywhere is . Step 3: to plan ahead you follow your map's road, not the real one, taking the same turns you'd really take, so from the second turn on you're navigating from a spot the real road never reached. Step 4: each turn adds one more fresh miss () on top of the old error — and the "detour never longer than straight" rule (triangle inequality) lets us count those two misses separately; the true roads can keep gaps the same (), shrink them (), or fan them out wider (). Step 5: if roads shrink gaps your error hits a ceiling and stops growing; if they keep gaps you're off by about times ; if they fan out the error explodes. Step 6: if your map were perfect () you could dream to the end with zero error no matter what — that's chess, where the rules are exact. Step 7: since your map isn't perfect, only trust it for a few turns, actually drive one real turn (which puts you back on a known real spot and erases all built-up error), then re-plan — that's MPC. Step 8: you can also carry several maps and distrust spots where they disagree (ensembles), or only bother drawing the route-deciding parts of the map (latent models). One enemy — drift that grows like (or worse) — several ways to keep it small.
Recall Self-check
Why does imagined error grow at least linearly in the horizon when ? ::: Because with adds one fresh per step, summing to . What tool lets us split the one-step error into "fresh model error" plus "inherited-and-stretched" error? ::: The triangle inequality, , with . What happens to the accumulated error when the dynamics are contractive ()? ::: It is bounded for all horizons and converges to the ceiling , because . What happens to the growth when the true dynamics have ? ::: The recursion unrolls to , which grows geometrically — much faster than linear. What does executing one real action do to the accumulated error? ::: Resets it to zero — you land on a truly observed state, so again. That's why MPC re-plans every step. When can you safely imagine over a long horizon? ::: When (a perfect/given model, any ), or when the dynamics are contractive (, error stays bounded).