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 core insight

The central insight is that planning is just optimization over an imagined future: if you possess a sufficiently accurate model p^(st+1∣st,at)\hat{p}(s_{t+1} \mid s_t, a_t) and reward signal r^(st,at)\hat{r}(s_t, a_t), 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) (S,A,O,T,R,Ω,γ)(\mathcal{S}, \mathcal{A}, \mathcal{O}, T, R, \Omega, \gamma) where T(s′∣s,a)T(s' \mid s, a) is the true transition kernel, R(s,a)R(s,a) the reward function, and Ω(o∣s)\Omega(o \mid s) the observation emission. A world model learns approximate counterparts (T^θ,R^θ,Ω^θ)(\hat{T}_\theta, \hat{R}_\theta, \hat{\Omega}_\theta) jointly with an encoder qϕ(zt∣o≤t,a<t)q_\phi(z_t \mid o_{\leq t}, a_{< t}) mapping histories to latent states. The Recurrent State Space Model (RSSM) factorizes the latent state into deterministic hth_t and stochastic ztz_t components:

1
ht=fθ(ht−1, zt−1, at−1),zt∼pθ(zt∣ht)\quad h_t = f_\theta(h_{t-1},\, z_{t-1},\, a_{t-1}), \qquad z_t \sim p_\theta(z_t \mid h_t)

Explanation: The deterministic recurrent state hth_t carries long-horizon memory through the sequence, while the stochastic component ztz_t captures aleatoric uncertainty at each step, enabling the model to represent distributions over futures rather than point predictions.

Symbols: ht∈Rdhh_t \in \mathbb{R}^{d_h} — deterministic hidden state (GRU output); ztz_t — categorical or Gaussian stochastic latent; fθf_\theta — recurrent cell; at−1a_{t-1} — previous action; pθp_\theta — 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:

2
L(θ,ϕ)=Eqϕ ⁣[∑t=1Tln⁡Ω^θ(ot∣ht,zt)⏟reconstruction−β DKL ⁣(qϕ(zt∣ht,ot) ∥ pθ(zt∣ht))⏟representation regularization]\quad \mathcal{L}(\theta, \phi) = \mathbb{E}_{q_\phi}\!\left[\sum_{t=1}^{T} \underbrace{\ln \hat{\Omega}_\theta(o_t \mid h_t, z_t)}_{\text{reconstruction}} - \underbrace{\beta\, D_{\mathrm{KL}}\!\bigl(q_\phi(z_t \mid h_t, o_t)\,\|\, p_\theta(z_t \mid h_t)\bigr)}_{\text{representation regularization}}\right]

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: qϕ(zt∣ht,ot)q_\phi(z_t \mid h_t, o_t) — posterior encoder (uses current observation); pθ(zt∣ht)p_\theta(z_t \mid h_t) — prior (observation-free, used during imagination); β\beta — KL weight balancing reconstruction vs. regularization; DKLD_{\mathrm{KL}} — 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 z0z_0:

3
z^t+1∼pθ(z^t+1∣ht+1),ht+1=fθ(ht,z^t,at),at∼πψ(at∣ht,z^t)\quad \hat{z}_{t+1} \sim p_\theta(\hat{z}_{t+1} \mid h_{t+1}),\quad h_{t+1} = f_\theta(h_t, \hat{z}_t, a_t),\quad a_t \sim \pi_\psi(a_t \mid h_t, \hat{z}_t)

Explanation: The agent unrolls imagined trajectories of length HH 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 πψ\pi_\psi is optimized using λ\lambda-returns computed over imagined rollouts. For differentiable world models, gradients flow through time back to ψ\psi:

4
J(ψ)=Eπψ,pθ ⁣[∑t=0H−1γtR^θ(ht,z^t,at)+γHVξ(hH,z^H)]\quad \mathcal{J}(\psi) = \mathbb{E}_{\pi_\psi, p_\theta}\!\left[\sum_{t=0}^{H-1} \gamma^t \hat{R}_\theta(h_t, \hat{z}_t, a_t) + \gamma^H V_\xi(h_H, \hat{z}_H)\right]

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 ψ\psi via the reparameterization trick when ztz_t is continuous or straight-through estimators when categorical.

Symbols: HH — imagination horizon; γ\gamma — discount factor; VξV_\xi — learned value function; R^θ\hat{R}_\theta — world model's reward head; πψ\pi_\psi — policy with parameters ψ\psi.

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:

5
a0:H∗=arg⁡max⁡a0:HEpθ ⁣[∑t=0HγtR^θ(ht,z^t,at)]\quad a^*_{0:H} = \arg\max_{a_{0:H}} \mathbb{E}_{p_\theta}\!\left[\sum_{t=0}^{H} \gamma^t \hat{R}_\theta(h_t, \hat{z}_t, a_t)\right]

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.

researcher · Richard S. Sutton | b. 1949 | Dyna Architecture and Model-Based RL Foundations

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.

researcher · David Ha | b. 1980 | World Models Paper and Latent-Space Planning

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.

researcher · Danijar Hafner | b. 1993 | DreamerV1/V2/V3 and RSSM Design

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.

Figure
World Model Planning Architecture
World Model Planning — RSSM Latent Imagination REAL WORLD Observation o_t Encoder q_φ(z|h,o) RSSM h_t = f_θ(h_{t-1}, z_{t-1}, a_{t-1}) z_t ~ p_θ(z_t | h_t) det. + stoch. state Reward Head R̂_θ(h,z) Decoder Ω̂_θ(o|h,z) LATENT IMAGINATION (Planning) ẑ_0, h_0 from real encoder π_ψ(a|h,z) ẑ_1, h_1 R̂_θ → r̂_0 π_ψ(a|h,z) ẑ_2, h_2 R̂_θ → r̂_1 π_ψ(a|h,z) ··· ẑ_H, h_H V_ξ(h,z) bootstrap Policy Update ∇_ψ J(ψ) via BPTT through model gradient flows back through imagined trajectory
Figure
Comparison: Model-Free vs. World Model Planning
Sample Efficiency: Model-Free vs. World Model MODEL-FREE RL Environment Policy π o_t, r_t a_t (real env step) Every gradient step requires a real environment interaction. 10⁸ – 10⁹ steps typical. WORLD MODEL PLANNING Real Env World Model p_θ(z'|z,a) R̂_θ(z,a) Policy π few o_t imagine H imagined steps, no real env Real env steps: 10⁵ – 10⁶ 10–100× more sample efficient. Planning cost: compute, not data.

Intuition

The Mental Model

Think of a grandmaster chess player versus a beginner. Both can look at the board — the analogue of observing oto_t — 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.

Historical Development

Origins · 1 minhow this was discovered
History
1989
Sutton introduces the Dyna architecture — the first algorithmic framework explicitly interleaving model-generated experience with real transitions during Q-learning, establishing the theoretical basis for model-based RL.
1990
Schmidhuber proposes "A possibility for implementing curiosity and boredom" — using a learned world model's prediction error as an intrinsic reward signal, anticipating modern curiosity-driven exploration.
2002
: