Unit 9 of 11 · about 4 hours · explain
Latent-state dynamics and world-model policy learning
Pixels are too high-dimensional to roll forward directly. A compact latent dynamics turns image control into a plannable problem.
You'll be able to
- Explain the latent world-model factorization: encoder posterior, dynamics prior, decoder, and reward predictor.
- State why the recurrent model state is Markovian while a single observation need not be.
- Trace the Dreamer loop: encode real sequences, imagine trajectories, train actor-critic on imagination.
Covers
Read
In this order, only the parts listed
0 of 3 done
- Lecture 16: Model-Based RL Part 2, latent-model slidesBerkeley CS 185/285 Deep Reinforcement Learning (Spring 2026) - Model-Based RL
Part 3 (Representing the model: latent state-space models, prior versus encoder versus decoder, single-step encoder limits, actor-critic with learned representations)
- DreamerV3: world model and behavior learningMastering Diverse Domains through World Models
arXiv:2301.04104v2, Learning algorithm section with Figure 3 (RSSM encoder, recurrent state and stochastic representation, actor-critic from imagined trajectories) and Figure 1 (fixed hyperparameters across 150 plus tasks, Minecraft diamonds)
- Search and World Models: Dreamer V3Hands-on Modern RL - Model-Based and World-Model Sections
Dreamer V3 and a New Generation of World Models: RSSM sketch, actor-critic in imagination, generality claims (page read 2026-10-14)
Use as a concept map only. Its code sketches are teaching illustrations, and benchmark claims (150 plus tasks, outperforming SAC and PPO) are the paper's results, not learner targets; no large reproduction belongs in the exit gate.
Focus on
- The model has four learnable maps: posterior infers the stochastic state from the observation, prior predicts it without the observation, the decoder reconstructs inputs from , and predictors emit reward and continuation flags.
- Training matches prior to posterior (KL with free bits) while the decoder keeps representations informative. The pair is the Markovian imagination state even when one image is not.
- The actor-critic never sees real transitions directly: it trains on trajectories dreamed from replayed states. Representation quality therefore bounds policy quality.
Common mistakes · 3
- Planning or dreaming on raw pixels. The whole point is that dynamics live in the compact state; pixel prediction is a training signal, not the planning space.
- Using a deterministic single-step encoder and calling it a world model. Without a stochastic state and a prior to match, imagination collapses to the mean trajectory.
- Reading representation loss as task progress. It measures predictability of the latent state, not reward; a tidy model of a useless representation still fails.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.What do the prior and posterior each condition on, and why must both exist?Answer
The posterior conditions on history and the current observation; the prior on history alone. Imagination has no future observations, so it must roll the prior; training matches the prior to the better-informed posterior.
2.Why is Markovian when one observation is not?Answer
The recurrent state summarizes the observation history and the stochastic state captures residual uncertainty, so the next pair depends only on the current pair and action by construction.
3.What breaks if the decoder is removed?Answer
Nothing forces representations to carry observation content. The dynamics losses alone admit trivially predictable but uninformative states.
4.What do free bits do in one sentence?Answer
Each KL loss becomes , so once a term is below 1 nat it stops pulling and learning focuses on the prediction loss.
You're done when
You can write the four maps, both KL losses and the dream loop from memory, and explain what each part would break if removed.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 5 more in the section
- Berkeley CS 185/285 Deep Reinforcement Learning (Spring 2026) - Model-Based RLUC Berkeley · primary
Slides are public at https://rail.eecs.berkeley.edu/deeprlcourse/static/slides/lec-N.pdf; current videos are not, and the public Fall 2023 playlist numbers lectures differently. Study Lectures 15 and 16 (model-based RL: learned dynamics, open-loop and closed-loop planning, random shooting and CEM, MPC, model-based policy learning). There is no model-based homework, so build the planner yourself on a small environment with known dynamics first.
- Mastering Diverse Domains through World ModelsDeepMind · depth
Read DreamerV3 only after the small explicit dynamics and planning path passes. Trace representation, latent dynamics, imagination and actor-critic state, but do not make a large benchmark reproduction part of the exit gate.
- Hands-on Modern RL - Model-Based and World-Model SectionsWalking Labs · support
Use Sections 9.3 and 9.4 as concept maps for model-based RL, search and world models. No runnable dynamics or planner script exists, so reproduce its error-recursion numbers by hand and verify algorithm claims against the original papers. Pin commit 9231bab of walkinglabs/hands-on-modern-rl; its
code/chapterNNfolders do not follow the site chapter numbers.
Also in this section
- Reinforcement Learning: An Introduction (2nd ed.) - Chapter 8Richard Sutton and Andrew Barto · required
The authors post the full second edition free at incompleteideas.net; cite the printed page numbers. Study Sections 8.1 to 8.3 (models, Dyna-Q, when the model is wrong) and Sections 8.8 to 8.11 (decision-time planning, rollout algorithms and Monte Carlo Tree Search). Reproduce the Dyna-Q versus Dyna-Q+ ranking on the blocking or shortcut maze.
- Stanford CS224R Spring 2026 - Model-Based RLStanford University · support
Use Lecture 11 (model-based RL) and its MBPO reading as a second treatment of model error, uncertainty and short model rollouts.
- When to Trust Your Model: Model-Based Policy OptimizationJanner et al. · required
Study the model-error analysis and short model-rollout design. Reproduce a reduced real-plus-imagined-data comparison and retain the horizon where model bias reverses the gain.
- Deep Reinforcement Learning in a Handful of Trials using Probabilistic Dynamics Models (PETS)Chua et al. (NeurIPS 2018) · support
Read the split between aleatoric uncertainty (probabilistic networks) and epistemic uncertainty (ensembles) and the trajectory-sampling planner. Implement an ensemble on a small task and show where the members disagree.
- Reinforcement Learning Control Laboratory - Model-Based StretchRoadmap-Final · support
Add a learned-dynamics stretch with a known-dynamics sanity case, prediction and planning tests, horizon sweeps, model-exploitation failure and matched model-free comparison.