What Should a World Model Predict?
Reconstruction, value equivalence and self-predictive representations compared.
A world model has to be trained to predict something. Pixels? Then it spends capacity on every leaf in the background. Rewards and values? Then it learns little until rewards arrive, and only about one task. Its own next latent state? Then predicting a constant is a perfect score. This lesson states the three answers as conditions on a representation and proves which imply which, proves why a stop-gradient keeps self-prediction from collapsing, and weighs what the controlled comparisons actually show.
What you’ll learn
- Define reward-predictive, self-predictive and observation-predictive representations as conditions on an encoder of histories, and prove that reward prediction plus self-prediction preserves optimal values.
- Prove that self-prediction with a stop-gradient target and an optimal predictor conserves the representation's Gram matrix, and characterize its stationary points.
- Explain why squared-error self-prediction learns only the expected next latent, and why a gradient through the target pulls toward collapse.
- Interpret the ablations of SPR, EfficientZero, TD-MPC and Dreamer and the controlled comparison of Ni et al. (2024), and state what remains open.
Three answers to one question
Every model-based agent with rich observations learns an encoder that maps a history to a latent , a latent transition, and heads for rewards and values. The encoder is shaped by whatever the model is trained to predict, and three answers dominate.
| Target | Typical loss | Used by | Strength | Weakness |
|---|---|---|---|---|
| Observations (reconstruction) | or a pixel error | World Models, Dreamer, IRIS, DIAMOND | Dense, task-independent signal; predictions can be inspected | Pays for every pixel, relevant or not; a small task-relevant object can be lost |
| Rewards, values, policies (value equivalence) | Errors of predicted rewards, values and search policies along action sequences | MuZero | Only what planning needs | Sparse, task-specific signal; latents mean nothing outside the task |
| Own future latents (self-prediction) | , or a cosine version | SPR, EfficientZero, TD-MPC | Dense, no decoder, may ignore unpredictable detail | A constant encoder predicts itself perfectly (collapse); random targets get averaged |
(a) Define the latent Bellman operator and run value iteration from on histories and on latents. Suppose for all and . Using RP for the reward and ZP for the law of :
By induction the identity holds for every , and both iterations converge because the Bellman operators are -contractions, so : the latent MDP has the environment's optimal values, and its greedy policy is optimal. (b) If and OP holds, then is a fixed function of , and given depends on only through ; hence so does , which is ZP.
An encoder satisfies ZP but not RP. What can you conclude about it?
- Its latent MDP has the environment's optimal values
- Nothing useful: a constant encoder satisfies ZP, so ZP alone does not rule out discarding everything
- It must be able to reconstruct observations
- It defines a bisimulation
Show the answer
B. Nothing useful: a constant encoder satisfies ZP, so ZP alone does not rule out discarding everything
Self-prediction is satisfied trivially by a representation that says nothing, because a constant predicts itself. It becomes meaningful together with RP or with a value loss, which force the latent to carry reward-relevant information; then (a) and (c) apply.
Why a stop-gradient prevents collapse
If a constant encoder satisfies the self-prediction condition, why does training not find one? Tang et al. (2023) answered in a setting simple enough to solve. States are one-hot vectors drawn from a distribution , the next state follows the policy's transition matrix , the representation is a matrix with latent , and a linear predictor predicts the next latent:
Write . Since , the loss is a weighted matrix norm plus the variance of the target, and that variance passes no gradient through the stop-gradient:
The semi-gradient differentiates only the prediction . Together with the optimality condition for :
Differentiate the Gram matrix. Each term contains or its transpose, which the optimal predictor sets to zero:
Both ingredients are needed. A gradient through the target adds a term to that does not vanish against , and the flow can slide toward . A slow, suboptimal predictor leaves . In Tang et al.'s simulations on random MDPs, removing either ingredient made the columns collapse toward one another.
What does the flow converge to? With uniform and orthonormal , the optimal predictor is and the flow becomes . When is invertible, is stationary exactly when , that is, when the span of is invariant under (for example, spanned by eigenvectors); when is singular other stationary points exist. For symmetric , Tang et al. prove that the flow never decreases , which is maximized by the eigenvectors with the largest : self-prediction behaves like principal component analysis of the transition matrix, although convergence to the top eigenvectors is not guaranteed.
A two-column representation starts with columns of length 1 at 60° to each other and is trained by semi-gradient self-prediction with an optimal predictor, as in the theorem. What is the angle between the columns after training, in degrees?
Show the answer
60
Still 60°. The Gram matrix holds the columns' lengths and their inner product, and the theorem says it is constant in time: the columns can rotate together through , but not toward each other.
From the linear theory to working agents
Working agents use the ingredients the theory isolates, plus a few more. SPR (Schwarzer et al., 2021) attached self-prediction to a Rainbow-style Q-learner on the Atari 100k benchmark as an auxiliary loss. An online encoder and a transition model predict the latents steps ahead along the actions actually taken; the targets come from a target encoder that is an exponential moving average (EMA) of the online one (decay 0.99 without data augmentation, a detached copy with decay 0 when augmentation is on); both sides pass through projection heads and the online side through an extra predictor; and the loss is the cosine distance. SPR reached a median human-normalized score of 0.415 (mean 0.704), a 55% relative improvement over the previous best, and beat human scores on 7 of 26 games.
| SPR variant (all with augmentation) | Median human-normalized score |
|---|---|
| Full SPR | 0.415 |
| Targets from the online encoder, no stop-gradient | 0.278 |
| Predicting only 1 step ahead | 0.301 |
| No transition model (no temporal prediction) | 0.271 |
| Unnormalized squared loss instead of cosine | 0.040 |
| No projection heads | 0.171 |
| Rainbow with augmentation, no SPR | 0.346 |
SPR's best target was a detached copy (decay 0) when augmentation was on, although BYOL, the image-representation method it builds on, had reported poor results without a moving average. The authors' hypothesis is that the reinforcement learning loss trained alongside supplies a gradient that discourages collapse, an ingredient outside the linear theory.
EfficientZero (Ye et al., 2021) added a SimSiam-style temporal consistency loss to MuZero's value-equivalent model. On Atari 100k, removing it cut the median human-normalized score from 1.090 to 0.340 (mean 1.943 to 0.881), the largest drop among the paper's three ablations. A probe shows why. A decoder trained to read observations from latent states could reconstruct the states the dynamics model unrolled only when the consistency loss was used; without it, the unrolled states drifted away from the encoder's, and value equivalence alone left the dynamics under-supervised.
TD-MPC (Hansen, Wang & Su, 2022) trains its latent dynamics with a consistency loss against an EMA target encoder, alongside reward and TD-value losses and with no decoder. In its ablation over 15 control tasks, reconstruction and contrastive losses both improved on no regularization, and latent consistency gave the most consistent results (Planning with Learned Values: TD-MPC).
What the comparisons show
Fix a history and an action, and let be random through the environment's stochasticity. For any prediction the squared error splits into a bias term and a variance term:
The minimizer is , so an self-prediction loss can enforce only the expected next latent (the condition Ni et al. call EZP), not its distribution (ZP). The two coincide in deterministic environments; Ni et al. show that the practical and -divergence losses upper-bound the ideal ones, with equality when transitions are deterministic.
The variance term is where collapse comes from. It does not depend on , only on the encoder, and it vanishes when the encoder maps every possible next history to one point. With a gradient through the target, the encoder is rewarded for shrinking that spread; the stop-gradient removes exactly this pull. Ni et al. prove that with stopped targets the stationary points of the objective satisfy EZP, a guarantee that online targets lack.
The controlled comparisons point in different directions depending on the task.
- Reconstruction carries Dreamer. In Dreamer, pixel reconstruction beat contrastive estimation on most tasks, and reward prediction alone was not sufficient. In DreamerV2, blocking image gradients hurt 51 of 55 Atari games, while blocking reward gradients was mixed (better on 15, worse on 22, tied on 18). DreamerV3 "rests predominantly" on its unsupervised world-model objective.
- Self-prediction carries sample-efficient Atari and control agents: SPR, EfficientZero and TD-MPC, above.
- A head-to-head test. Ni et al. (2024) trained one minimal agent, model-free RL plus a single auxiliary loss, with latent self-prediction (ZP) or observation prediction (OP). With 16 to 256 dimensions of i.i.d. Gaussian noise added to MuJoCo states, OP degraded much faster than ZP. In 20 sparse-reward, partially observed MiniGrid tasks both beat a model-free recurrent baseline, and OP beat ZP. Moving-average targets kept the representation's rank, while detached and online targets lost rank during training.
| Situation | Suggested target (Ni et al., 2024) |
|---|---|
| Noisy or distracting observations | Latent self-prediction |
| Sparse rewards | Observation prediction |
| Deterministic dynamics | objectives suffice |
| A first implementation | self-prediction with a moving-average target, as an auxiliary loss on a model-free agent |
Open problems
Think first If self-prediction avoids pixels and value equivalence is all that planning needs, why does DreamerV3 still reconstruct its inputs?
Reconstruction supplies a dense signal from every observation even when rewards are rare, cannot collapse, and needs no target networks or projection heads to tune, which matters for one configuration across many domains. Its costs are capacity spent on irrelevant detail and fragility under distractors. Which target is best depends on the task, and the evidence above does not single out a winner.
Key takeaways
- Three training targets shape a world model's latent: observations (dense and task-free, but paying for every pixel), rewards and values (only what planning needs, but sparse), and the model's own future latents (dense and decoder-free, but collapsible).
- Reward prediction plus latent self-prediction preserves optimal values (by value iteration in the latent MDP), while self-prediction alone is satisfied by a constant encoder.
- With a stop-gradient target and an optimal predictor, linear self-prediction conserves and so cannot collapse; with an invertible predictor its stationary points span -invariant subspaces, and for symmetric it acts like PCA of the transition matrix.
- self-prediction learns expected next latents, and the variance term that would pull the encoder toward collapse is exactly what the stop-gradient removes.
- The evidence is task-dependent: reconstruction carries Dreamer, self-prediction carries SPR, EfficientZero and TD-MPC, and in a controlled test self-prediction resisted distractors while observation prediction did better under sparse rewards.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Which conditions on an encoder guarantee that its latent MDP has the same optimal action values as the environment?
- ZP alone
- OP alone, with an encoder that cannot be updated recursively
- RP and ZP together
- Accurate reconstruction of the current observation
Show the answer
C. RP and ZP together
Value iteration on histories and on latents produces identical iterates when the latent predicts the expected reward (RP) and the law of the next latent (ZP); the limits are and its latent counterpart.
In the linear self-predictive model, what happens if the gradient also flows through the target ?
- The Gram matrix is still conserved
- The loss loses its trivial minimum
- Nothing changes as long as the predictor is optimal
- The conservation law breaks, and , which attains zero loss, becomes a possible destination: the representation can collapse
Show the answer
D. The conservation law breaks, and , which attains zero loss, becomes a possible destination: the representation can collapse
Conservation of relies on the update containing only the prediction's gradient, which the optimal predictor makes orthogonal to . A gradient through the target adds a term without that property, and the trivial solution has zero loss.
In a stochastic environment, what does an self-prediction loss with stopped targets drive the predictor toward?
- The expected next latent,
- A random sample from the distribution of next latents
- The most likely next latent
- The next observation
Show the answer
A. The expected next latent,
The squared error splits into the distance to the conditional mean plus a variance that does not depend on the prediction, so the minimizer is the mean. That enforces the expected-latent condition (EZP), which equals ZP only when transitions are deterministic.
An agent's state vectors include many dimensions of pure noise unrelated to the task. In Ni et al.'s comparison, which auxiliary target degraded least as the noise dimensions grew?
- Observation prediction, because it models everything
- Latent self-prediction, because the encoder can discard what it cannot predict
- Neither; both were unaffected
- Reconstruction with a larger decoder
Show the answer
B. Latent self-prediction, because the encoder can discard what it cannot predict
Observation prediction must model the noise, so its performance fell much faster as distractor dimensions were added; self-prediction lets the encoder drop unpredictable inputs. With sparse rewards in MiniGrid the order reversed: observation prediction did better.
Further reading
- M. Schwarzer, A. Anand, R. Goel, R. D. Hjelm, A. Courville & P. Bachman, "Data-efficient reinforcement learning with self-predictive representations," ICLR (2021).
- Y. Tang, Z. D. Guo, P. H. Richemond, B. Ávila Pires, Y. Chandak, R. Munos, M. Rowland, M. G. Azar, C. Le Lan, C. Lyle, A. György, S. Thakoor, W. Dabney, B. Piot, D. Calandriello & M. Valko, "Understanding self-predictive learning for reinforcement learning," ICML (2023).
- T. Ni, B. Eysenbach, E. Seyedsalehi, M. Ma, C. Gehring, A. Mahajan & P.-L. Bacon, "Bridging state and history representations: understanding self-predictive RL," ICLR (2024).
- W. Ye, S. Liu, T. Kurutach, P. Abbeel & Y. Gao, "Mastering Atari games with limited data," NeurIPS (2021).
- L. Li, T. J. Walsh & M. L. Littman, "Towards a unified theory of state abstraction for MDPs," International Symposium on Artificial Intelligence and Mathematics (2006).