Model-based reinforcement learning
Dyna, MPC/CEM, compounding model error, Dreamer, MuZero, and world models for LM agents.
Why a model
Optional depth: the rest of the course only needs the idea of a world model. Model-free methods (Q-learning, DQN, PPO) never ask what an untaken action would do. That is general and expensive — tens of millions of frames per Atari game. A model keeps transition structure, turns computation into extra experience, and can serve a new reward in the same world.
Dyna
Key idea. Learning and planning are the same update on different data. Dyna after each real step: one direct RL update, a model update, then planning updates that replay remembered transitions. In the maze the first episode is long for everyone (~800 steps) until the goal is found; with the agent then walks about steps from episode five, versus dozens of episodes without planning. A stale model can miss a newly opened shortcut (blocking maze).
MPC and CEM
In continuous control fit by regression, then MPC: optimize an action sequence under the model (random shooting or CEM), execute the first action, replan from the real next state. On the pendulum, CEM with a feature model nearly matches planning with the true dynamics (return vs ); a plain linear model fails to swing up (). PETS adds ensembles so plans respect uncertainty and need far fewer samples than PPO on some tasks.
Compounding error
One-step error with Lipschitz yields
When the bound grows geometrically. The linear pendulum model is off by rad in one step but after ten — more than five times . Remedies: short horizons and replanning, rollouts branched from real states (MBPO), ensembles, and not letting the planner exploit the model.
Dreamer and MuZero
World models learn latent dynamics instead of pixels. Dreamer trains actor and critic on imagined latent rollouts () with -returns; DreamerV3 used one setup across tasks including diamonds in Minecraft from scratch. MuZero predicts only rewards, values and policies for tree search — value equivalence, not screen reconstruction — and matched AlphaZero without being given the rules.
World models and LMs
For LM agents, irreversible actions and costly steps make one- or two-step lookahead before acting natural — with the same compounding-error caveat. Learned simulators train agents offline; the sim-to-real gap is model error by another name. Next on the main line: treat the language model itself as the policy — tokens as actions, the prompt as state.
Check your understanding
The same questions as in Pulse. Answers are shared between modes.
Answers are saved on the server and tied to this browser until you sign in.