← Back to blogs

World Models and Latent Imagination: PlaNet, Dreamer, and DreamerV2

Recurrent state-space models, latent planning, imagined actor-critic

A world-model agent replaces the environment with a learned simulator, and the sharpest way to compare the designs on offer is to ask what each one purchases and what it costs, not which paper came first. Three papers from the same research group, using the same latent-dynamics substrate, disagree about two things: how an action gets chosen once a model exists, and what objective should shape the latent that the model reasons in. Because the group held one variable fixed while changing the other, the sequence reads less like a lineage and more like an ablation study conducted across four years and three publications.

The shared substrate is the Recurrent State-Space Model (RSSM), introduced with PlaNet (Hafner et al. 2019). Its claim is that a single latent variable cannot do two jobs at once: remember reliably across many steps, and represent more than one plausible future at the next step. The RSSM splits the state into a deterministic path hth_t that carries information forward without injecting noise, and a stochastic path sts_t that samples a new hypothesis about the present observation at every step. (Hafner et al. 2019) ablates both halves separately and reports that removing either breaks planning: a purely deterministic recurrent network commits to one trajectory and has nothing left to search over, while a purely stochastic state-space model resamples away the very information a plan needs to hold onto. That split is inherited unchanged by Dreamer (Hafner et al. 2020) and by DreamerV2 (Hafner et al. 2022), and it is the one component none of the three papers touches.

What does change, and changes exactly once between the first two papers, is how the model gets turned into a decision. PlaNet has no policy network at all: at every environment step it samples a thousand candidate action sequences, rolls each one forward through the RSSM for twelve steps, keeps the hundred that scored best, refits the sampling distribution, and repeats the whole search ten times before executing only the first action of the refitted mean (Algorithm 2). Dreamer deletes that search entirely and replaces it with an actor and a critic, both trained on trajectories that are imagined rather than executed, using a value gradient that is computed by backpropagating through the model rather than estimated from environment returns. The two papers report scores of 332 and 823 respectively on the same twenty-task DeepMind Control benchmark at the same five-million-step budget (Hafner et al. 2019, 2020). Since the world model contributing those states is unchanged, the entire gap between 332 and 823 is attributable to the substitution of a critic that reasons past a fixed horizon for a planner that reasons only up to one.

The second axis, orthogonal to the first, is what objective trains the latent. All three papers train it by pixel reconstruction: the RSSM is fit to predict the observation, not only the reward. DreamerV2 reports the sharpest documented instance of what this costs. On Atari's Video Pinball the object that determines the score, the ball, occupies roughly one pixel of the frame, and a reconstruction loss allocates its gradient by area rather than by relevance, so the model is barely pressed to represent the one thing that matters. A separate lineage rejects the reconstruction objective outright: MuZero (Schrittwieser et al. 2020) trains its latent against predicted reward, value and policy targets only, and never reconstructs a pixel. Chapter 4 works through that design in detail; the point to carry from here is that MuZero's reward-only supervision is not obviously cheaper, since it is bootstrapped from a tree search whose visit-count distribution is a far richer training signal than a scalar reward, and MuZero is trained on orders of magnitude more environment frames than any Dreamer variant. Dreamer's own representation ablation is consistent with this trade: reward prediction alone, with no reconstruction and no contrastive term, was not sufficient to learn a usable representation in its experiments (Hafner et al. 2020).

Table 1. The latent-imagination line, sorted by year. The headline column quotes each paper's own reported figure on its own benchmark and the benchmarks differ down the column, so the numbers rank nothing across rows: PlaNet and Dreamer report DeepMind Control Suite returns at 5e6 steps, DreamerV2 reports a gamer-normalized Atari median at 200M frames, and World Models reports a single CarRacing score. Read the column as what each paper claimed to have shown. Action selection and latent objective are the two axes this Related Work is organised around: the first changes between PlaNet and Dreamer while the world model stays fixed, the second changes between Dreamer and DreamerV2 while the actor-critic stays fixed.
Method Year World model Action selection Latent Headline result as reported
World Models (Ha and Schmidhuber 2018) 2018 VAE plus MDN-RNN, trained on random rollouts CMA-ES over a tiny linear controller Gaussian, 32-dim CarRacing-v0 at 906 plus or minus 21, above the prior 591 to 838 range
PlaNet (Hafner et al. 2019) 2019 RSSM, deterministic plus stochastic path CEM replanning at every step, no policy network Gaussian, 30-dim diagonal six DMC tasks at model-free level using 40 to 500 times fewer episodes than D4PG
Dreamer (Hafner et al. 2020) 2020 RSSM, unchanged from PlaNet learned actor, analytic value gradients through imagination Gaussian, as PlaNet 823 average over 20 DMC tasks at 5e6 steps, against D4PG's 786 at 1e8
DreamerV2 (Hafner et al. 2022) 2021 RSSM with categorical posterior learned actor, Reinforce on Atari and dynamics backprop on continuous control 32 categoricals of 32 classes Atari gamer-normalized median 2.15 at 200M frames, against Rainbow's 1.47
DreamerV3 (Hafner et al. 2023) 2023 RSSM plus symlog transforms learned actor, as DreamerV2 categorical, as DreamerV2 one fixed hyperparameter set across more than 150 tasks in the paper's domains

The honest summary of the two toggles is that they do not have equal weight. The action-selection toggle, PlaNet to Dreamer, buys a factor of roughly 2.5 in score and a factor of roughly 3.7 in wall clock, eleven hours down to three per million steps, for zero change to the world model. The latent-objective toggle, Dreamer to DreamerV2, buys human-level Atari, but the paper's own ablation attributes more of that gain to a regularisation change, KL balancing, than to the categorical latent that gives the paper its title: 0.25 down to 0.19 without the categoricals, 0.25 down to 0.16 without the balancing (Hafner et al. 2022). Neither number should be read as validating world models against model-free alternatives in general; a footnote below takes up the separate question of how fragile a single aggregate benchmark statistic is to the choice of normalisation and to outlier tasks (Agarwal et al. 2021).1

References

Agarwal, Rishabh, Max Schwarzer, Pablo Samuel Castro, Aaron Courville, and Marc G. Bellemare. 2021. "Deep Reinforcement Learning at the Edge of the Statistical Precipice." Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/2108.13264.
Ha, David, and Jürgen Schmidhuber. 2018. "Recurrent World Models Facilitate Policy Evolution." Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/1809.01999.
Hafner, Danijar, Timothy Lillicrap, Jimmy Ba, and Mohammad Norouzi. 2020. "Dream to Control: Learning Behaviors by Latent Imagination." International Conference on Learning Representations (ICLR). https://arxiv.org/abs/1912.01603.
Hafner, Danijar, Timothy Lillicrap, Ian Fischer, et al. 2019. "Learning Latent Dynamics for Planning from Pixels." Proceedings of the 36th International Conference on Machine Learning (ICML), Proceedings of machine learning research, vol. 97. https://arxiv.org/abs/1811.04551.
Hafner, Danijar, Timothy Lillicrap, Mohammad Norouzi, and Jimmy Ba. 2022. Mastering Atari with Discrete World Models. arXiv. http://arxiv.org/abs/2010.02193.
Hafner, Danijar, Jurgis Pasukonis, Jimmy Ba, and Timothy Lillicrap. 2023. Mastering Diverse Domains Through World Models. arXiv. http://arxiv.org/abs/2301.04104.
Schrittwieser, Julian, Ioannis Antonoglou, Thomas Hubert, et al. 2020. "Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model." Nature 588 (7839): 604-9. https://doi.org/10.1038/s41586-020-03051-4.