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

Latent-state dynamics and representation learningWorld-model policy learning vocabulary
1

Read

In this order, only the parts listed

0 of 3 done

  1. 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)

  2. 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)

  3. 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.

2

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.
3

Try it yourself

Closed-book, before checking anything

Closed-book, write the four maps with their inputs and outputs, the two KL losses (dynamics and representation, each clipped at 1 nat of free bits), and the three Dreamer networks (world model, critic, actor) with what each consumes and produces. Then explain in two sentences why the decoder exists.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 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. 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. 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. 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/chapterNN folders do not follow the site chapter numbers.

Also in this section