World Models for Planning
A world model is a learned internal representation of an environment's transition dynamics, reward structure, and observation distribution, enabling an agent to perform mental simulation — planning action sequences by rolling out imagined trajectories without interacting with the real environment. World models matter because they offer sample efficiency gains that purely model-free methods cannot achieve, decoupling policy improvement from costly real-world experience. Remarkably, the same latent-space dynamics models that enable planning in pixel-space environments are structurally equivalent to the predictive coding hierarchies proposed by neuroscientists decades before deep learning existed.
The central insight is that planning is just optimization over an imagined future: if you possess a sufficiently accurate model and reward signal , you can find high-return action sequences by backpropagating through the model's rollouts — effectively turning a sequential decision problem into a differentiable program. The power lies in where you represent states: modern world models operate in a compressed latent space, not in raw observation space, so the dynamics are smoother, lower-dimensional, and far cheaper to simulate. The aha moment is recognizing that a world model is not a side module that assists planning — it is the substrate in which planning becomes tractable. This reframing unifies model predictive control, Dyna-style architectures, and latent imagination under a single principle.
How It Works
Formal Setup
Let the environment be a partially observable Markov decision process (POMDP) where is the true transition kernel, the reward function, and the observation emission. A world model learns approximate counterparts jointly with an encoder mapping histories to latent states. The Recurrent State Space Model (RSSM) factorizes the latent state into deterministic and stochastic components:
Explanation: The deterministic recurrent state carries long-horizon memory through the sequence, while the stochastic component captures aleatoric uncertainty at each step, enabling the model to represent distributions over futures rather than point predictions.
Symbols: — deterministic hidden state (GRU output); — categorical or Gaussian stochastic latent; — recurrent cell; — previous action; — prior over stochastic latent given history.
Variational Training Objective
The world model is trained by maximizing a sequence-level Evidence Lower BOund (ELBO) over observed trajectories:
Explanation: The reconstruction term forces the latent state to encode information sufficient to explain observations, while the KL term aligns the posterior with the model's own prior, ensuring the prior can generate coherent imagined rollouts at plan time without access to future observations.
Symbols: — posterior encoder (uses current observation); — prior (observation-free, used during imagination); — KL weight balancing reconstruction vs. regularization; — Kullback-Leibler divergence.
Latent Imagination and Policy Optimization
With the world model fixed, imagined trajectories are generated entirely in latent space starting from an encoded real state :
Explanation: The agent unrolls imagined trajectories of length by alternating between the learned prior transition and the current policy, collecting a synthetic dataset on which any RL algorithm can operate without touching the real environment. The policy is optimized using -returns computed over imagined rollouts. For differentiable world models, gradients flow through time back to :
Explanation: The policy objective is the discounted sum of predicted rewards along an imagined horizon plus a bootstrapped value estimate at the terminal imagined state, all of which are differentiable with respect to via the reparameterization trick when is continuous or straight-through estimators when categorical.
Symbols: — imagination horizon; — discount factor; — learned value function; — world model's reward head; — policy with parameters .
Model Predictive Control Variant
For systems where a differentiable policy is undesirable, planning proceeds via sampling-based MPC using the Cross-Entropy Method (CEM) or MPPI:
Explanation: Rather than learning a parametric policy, this formulation treats planning as an online optimization problem at each decision step — the world model serves as a surrogate objective over action sequences, and CEM iteratively refits a Gaussian proposal toward high-return candidates.
Sutton trained under Andrew Barto at UMass Amherst and developed much of the foundational theory of temporal-difference learning and policy gradient methods. His 1991 Dyna paper introduced the landmark insight that model-generated ("imagined") transitions can be interleaved with real experience during Q-learning, prefiguring all modern latent-imagination approaches by three decades. Sutton later formalized the deadly triad problem — the instability arising from combining function approximation, bootstrapping, and off-policy learning — which remains the central challenge in stabilizing world model training today.
Ha worked as a researcher at Google Brain and later as Chief Scientist at Stability AI, bridging generative modeling and reinforcement learning. His 2018 "World Models" paper with Jürgen Schmidhuber demonstrated that a compressed VAE+MDN-RNN model of a visual environment could support policy training entirely within the dream, achieving competitive performance on Car Racing and VizDoom without any real-environment policy gradient steps. The surprising personal fact: Ha originally trained as a traditional artist and composer before transitioning to ML, and explicitly draws on aesthetic intuitions about compression and representation when designing latent architectures.
Hafner completed his PhD at UC Berkeley and conducted postdoctoral work at Google DeepMind, where he developed the Dreamer series of world model agents. His Recurrent State Space Model (RSSM) — separating deterministic and stochastic latent components — became the dominant architecture for latent-imagination planning, and DreamerV3 (2023) achieved human-level performance on the majority of Atari games while simultaneously solving continuous locomotion and Minecraft diamond collection, with a single fixed hyperparameter set across all domains. Remarkably, DreamerV3 was the first algorithm to collect a diamond in Minecraft from scratch without human demonstrations or task-specific reward shaping.
Intuition
Think of a grandmaster chess player versus a beginner. Both can look at the board — the analogue of observing — but the grandmaster has an internalized mental model of chess dynamics: they can rapidly simulate dozens of future board states in their head, prune implausible lines, and identify the move that leads to a favorable position five steps later. The beginner must "try it and see," relying purely on reactive pattern matching. A learned world model is exactly this internalized chess engine — compressed, approximate, but sufficiently accurate over a planning horizon to guide good decisions. The critical subtlety: the grandmaster doesn't simulate the full board with pixel-perfect fidelity. They think in terms of piece relationships, pawn structure, king safety — an abstract latent space that captures what matters for planning while discarding irrelevant details (exact piece color saturation, board grain texture). This is why world models learned in latent space outperform those that try to predict raw observations step by step: the right level of abstraction makes futures predictable enough to be useful without requiring the impossible precision of full sensory reconstruction.