Part of World Models Handbook
Covers math behind world models: conditional distributions, Markov transitions, stability, attractors, and information theory for sufficient states.
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Mathematical and Dynamical Foundations
In Chapter 2 we described a world model informally: an encoder that turns observations into a state, a dynamics model that predicts how that state evolves, and a way of reading rewards or outcomes back out. Every one of those pieces rests on a small body of mathematics that this chapter puts in place. You do not need years of control theory to follow the rest of this handbook, but you do need four ideas to be solid: how we represent uncertainty with random variables and conditional distributions, how states evolve through transitions to form trajectories, how those trajectories settle onto fixed points and attractors, and how information theory tells us which parts of the past a state actually needs to carry.
It is worth pausing on why precisely these four. The first idea supplies the language: without conditional distributions you cannot even state what a world model claims about the future. The second supplies the object: trajectories built from local transition laws are what a world model produces and what training data consist of. The third supplies the diagnostic: long-horizon behavior is governed by stability and attractors, and ignoring them is the single most common way a technically competent model fails in deployment. The fourth supplies the design principle: a finite state cannot hold an infinite past, so every practical world model is an exercise in principled forgetting, and information theory is what turns "forgetting" from a euphemism into a measurable quantity.
We will lean on one running example throughout: a thermostat controlling the temperature of a room. It is almost embarrassingly simple, yet it contains a stochastic transition law, a limit-cycle attractor, a hidden state variable that temperature alone cannot capture, and a sharp lesson about the difference between predicting well one step ahead and reproducing the behavior of a system over long horizons. By the end of the chapter you will have simulated it, fit models to it, and watched a model with excellent one-step accuracy fail in closed loop for reasons that are purely dynamical. The thermostat earns its place precisely because nothing about it is exotic: if these failure modes appear in a system with one hidden bit, they will appear with interest in robotics, finance, and language.
If you have seen probability and linear algebra before, treat this chapter as a calibration pass: the goal is not novelty but shared vocabulary, stated assumptions, and a few intuitions, especially about stability and compounding error, that most machine-learning curricula skip entirely. Readers encountering the material for the first time should work through the code cells rather than skimming them; each one is short, and each one demonstrates a claim that would otherwise remain an assertion.
Random Variables and Conditional Distributions
A world model is fundamentally a device for answering questions of the form "what might happen next, and with what probabilities?" Before we can talk about transitions and trajectories, we need a precise language for that kind of question. That language is probability theory, and its central objects are random variables and the conditional distributions that connect them. Everything else in this chapter, and most of what follows in this handbook, is built by composing these objects in time.
Random variables are bookkeeping for uncertainty
A random variable is not a variable in the programming sense. It is a formal device for attaching numbers to the outcomes of something uncertain, together with a distribution that says which numbers are more or less likely. The distinction matters because programmers routinely conflate the two: a Python variable holds one value at a time, while a random variable holds a whole space of possible values at once, weighted by belief. When we say a room's temperature tomorrow is a random variable, we are not saying the temperature is fuzzy or ill-defined; we are saying that our knowledge of it is incomplete, and the distribution is a complete accounting of that incompleteness.
A random variable is a function from the outcomes of an uncertain process to a set of values, equipped with a distribution that assigns probabilities to those values. For discrete , is a probability mass function with . For continuous , is a probability density with .
When we write later in this chapter, the tilde means "drawn from," and the whole expression says: the next state is a random variable whose distribution depends on the current state and action. Nothing more mysterious than that. The dot inside the distribution is a placeholder for the value being drawn, and the part after the bar lists everything the draw is conditioned on. Learning to parse such expressions fluently pays off immediately, because nearly every formula in this handbook is a statement about who is conditioned on whom.
Two habits worth building now. First, always ask what a distribution is over: temperatures, pixel intensities, latent vectors, actions. Distributions over different spaces behave differently, support different operations, and demand different estimators, and many modeling bugs amount to silently mixing up which space a distribution lives in. Second, always ask what a distribution is conditioned on: a predictive distribution conditioned on the wrong information is worse than useless, because it feels principled while answering the wrong question. A weather model conditioned only on the season will produce confident seasonal averages; conditioned on today's pressure field, it produces something you would actually act on. The difference between those two conditionings is, in miniature, the difference between a bad world model and a good one.
Joints, marginals, and conditionals
Suppose and are two random quantities, for example today's soil moisture and tomorrow's plant growth. Their joint distribution describes them together: it assigns a probability, or probability density, to every combination of values, and thereby encodes not just how each quantity varies on its own but how they co-vary. Summing or integrating one out gives the marginal:
The marginal answers questions about alone, deliberately ignoring whatever might have told us. It is the distribution you are stuck with when you have no access to , and its spread is typically wider than what conditioning would leave you.
The conditional distribution reverses the direction of reasoning. It answers: if I have already observed , what should I now believe about ?
defined whenever . Read as a rule, it says: restrict attention to the slice of the joint where takes the observed value, then renormalize so the slice sums to one. Conditioning is the mathematical core of every world model. An encoder maps an observation to a state; a dynamics model produces ; a reward head produces . All of these are conditional distributions, and the quality of a world model is largely the quality of its conditionals. When this handbook later speaks of calibration, uncertainty quantification, or model exploitation by planners, it is always asking the same underlying question: are these conditionals honest?
Conditioning changes shapes, not just centers. If with , then knowing does not merely shift your belief about toward ; it also shrinks its spread from the marginal spread of down to . Both effects follow from the same algebra: once is known, the only remaining randomness is the noise term, so the conditional distribution is the noise distribution relocated to the regression line. Let's see both effects empirically.
import numpy as np
rng = np.random.default_rng(20250601)
n_samples = 4000
true_slope = 0.8
true_noise_sd = 0.5
x = rng.normal(loc=0.0, scale=1.0, size=n_samples)
y = true_slope * x + rng.normal(loc=0.0, scale=true_noise_sd, size=n_samples)
## Grid for the theoretical conditional mean E[Y | X = x] = 0.8x
x_line = np.linspace(-3.0, 3.0, 200)
y_line = true_slope * x_line
## Empirical conditional statistics in a narrow band around x = 1
band = np.abs(x - 1.0) <= 0.1
cond_mean = y[band].mean()
cond_std = y[band].std()
## Histograms of the marginal distribution of Y and the conditional given X near 1
counts_all, edges_all = np.histogram(y, bins=40, range=(-4.0, 4.0))
counts_band, edges_band = np.histogram(y[band], bins=40, range=(-4.0, 4.0))
centers_all = 0.5 * (edges_all[:-1] + edges_all[1:])
centers_band = 0.5 * (edges_band[:-1] + edges_band[1:])
width_all = edges_all[1] - edges_all[0]
width_band = edges_band[1] - edges_band[0]
density_all = counts_all / (n_samples * width_all)
density_band = counts_band / (band.sum() * width_band)Empirical E[Y | X near 1]: 0.835 (theory: 0.800) Empirical sd[Y | X near 1]: 0.484 (theory: 0.500) Marginal sd of Y: 0.935
The conditional mean lands right on the theoretical value, and the conditional spread is much narrower than the marginal spread. Both facts matter for world modeling: a model that only predicts conditional means throws away the uncertainty, and a model that reports uncertainty without conditioning on enough context reports spread that the evidence does not support. The first failure makes planning reckless, because the planner never sees the risk; the second makes planning timid, because the planner hedges against variation that better use of available context would have explained away. Notice that both failures can coexist in the same model, and neither is visible from a loss curve alone.


The chain rule: building trajectories from local steps
The reason conditional distributions deserve this much attention is that they compose. Any joint distribution over a sequence can be factored into a product of conditionals, a fact called the chain rule of probability:
This identity looks innocuous and is anything but. It says that a full distribution over an entire trajectory can be built from nothing but a sequence of local predictive distributions, each conditioned on the past. There is no additional assumption hiding in it: the chain rule is an identity, true for every joint distribution whatsoever. All of the modeling content enters through the choices we make about what each conditional may depend on, which is exactly where assumptions like Markovianity will enter shortly. Every autoregressive language model, every recurrent dynamics model, and every rollout-based planner in this handbook is an application of the chain rule. When a world model rolls out a prediction for a hundred steps, it is multiplying a hundred conditional distributions together, and the failure modes of that multiplication, which we will quantify shortly, are among the central practical problems of the field.
Expectation is the other workhorse. For a distribution , the expected value is or : the probability-weighted average of the random variable, the single number that summarizes where the distribution's mass sits. Two properties carry most of the weight in practice. The law of iterated expectations, , says that averaging conditional predictions reproduces the marginal prediction, which is why a simulator's average behavior can be correct even when no individual rollout is. This is simultaneously reassuring and dangerous: reassuring because aggregate statistics computed from simulations can be trusted even when individual runs look strange, and dangerous because it means average-case validation can hide pathologies that only appear trajectory by trajectory. And linearity of expectation, , holds even when and are dependent, which is why error budgets can often be added component-wise even when error sources interact. That linearity holds without independence is what keeps many applied probability calculations tractable.
States, Transitions, and Trajectories
With the probabilistic vocabulary in place, we can now define the object a world model maintains: a state that evolves through time according to a transition law, generating trajectories. The definitions in this section look elementary, but each one embeds a modeling decision that practitioners get wrong constantly, so we will be explicit about what each term commits us to.
What makes something a state
Throughout this handbook we keep four concepts strictly separate, and it pays to fix them now:
- Observation: what the agent's sensors deliver at time , written . Observations may be incomplete, delayed, noisy, or redundant. A camera sees surfaces but not velocities; a thermometer reports temperature but not the heater's switch position.
- State: the information used to summarize the past for purposes of predicting the future, written . The state may be observed directly, constructed by an encoder, or inferred as a belief. The state is defined by its predictive job, not by its physical interpretation.
- Action: the input the agent chooses, written . Actions are the handle by which the agent influences the transition law, and their presence is what separates prediction from control.
- Environment: the external process that consumes or and produces the next observation, along with any reward. The environment is the ground truth against which every model in this handbook is ultimately judged.
A state is good not because it resembles the world internally but because it is useful for prediction. This pragmatic attitude, which goes back to the cybernetic tradition discussed in Chapter 5, lets us sidestep philosophical questions about what the "real" state of the world is. A thermostat's state can be two numbers and a switch position; it does not need to contain the position of every air molecule in the room. The molecular detail is real, but it is irrelevant to the predictive question the controller faces, and carrying it would be pure overhead. This criterion, usefulness for prediction, is the thread that connects the state concept to the sufficient statistics of the final section: a good state is precisely a summary that keeps what matters and discards what does not.
Transition functions and transition kernels
A transition law specifies how the state evolves. In the simplest case it is a deterministic function:
Deterministic transitions are an idealization. Real systems are buffeted by unmodeled influences: sensor noise, discretization error, and genuine randomness. The general treatment is a transition kernel, a conditional distribution over next states:
The deterministic case is the special case where this distribution puts all its mass on one point. A useful mental model is that predicts the center of the next-state distribution while the kernel also carries its spread. Models that track only the center, which is what most neural network dynamics models do by default, silently assume the spread does not matter. Over long horizons, it always does: spread is what tells a planner whether a risky maneuver has a five percent or a fifty percent chance of failure, and a model blind to spread answers that question with confident nonsense.
A transition law is Markov if the future is conditionally independent of the past given the present state and action:
Equivalently, the current state is a sufficient statistic for the entire history, a phrase we will make precise in the information-theory section below. The Markov property is an assumption about the state representation, not about the world: with a bad state, even a simple world looks non-Markovian.
The Markov property deserves emphasis because it is the hinge between this chapter and nearly everything that follows. It is what allows a world model to be a recurrence rather than a function of ever-growing histories, and it is what makes dynamic programming, filtering, and reinforcement learning tractable at all. Without it, every prediction problem would require re-processing the entire history from scratch, and the computational cost of planning would grow without bound as experience accumulates. With it, the entire past is compressed into a fixed-size object, and all reasoning proceeds forward from there. When we reach Part II: Inference, Decisions, and Control, the Markov decision process will formalize exactly this structure with actions and rewards attached. When the state you have is not Markov, the fixes are either to enrich the state, which is the subject of state abstraction in Part III, or to carry an explicit belief over hidden states, which is the subject of Bayesian filtering. The thermostat later in this chapter gives a concrete taste of the first remedy: adding a single bit to the state restores Markovianity completely.
Trajectories and rollouts
Given an initial state and a rule for choosing actions, such as a policy , the chain rule factors the distribution over a full trajectory:
Reading this from right to left is exactly what a rollout does: sample an action, sample a next state, repeat. Reading it left to right is what a dataset of experience is: one or more draws from this trajectory distribution. This dual reading is worth internalizing, because it explains why training and evaluation can disagree so sharply. Training sees draws from the trajectory distribution generated by the data-collecting policy; evaluation asks the model to generate trajectories under a different policy, often one chosen by a planner that steers toward states the collecting policy rarely visited. The factorization is the same, but the regions of state space it explores are not.
The key quantitative phenomenon in rollouts is compounding error. Suppose your one-step model has a small error per step. If errors merely added, a hundred-step rollout would be off by . In reality they typically compound multiplicatively, because the model's predicted state at step is the input to its prediction at step : mistakes change the inputs to future predictions, which changes the predictions, which changes the inputs further. The feedback loop is the decisive difference between open-loop fitting and closed-loop deployment, and no property of the training loss accounts for it. For stable systems the growth saturates; for unstable or chaotic ones it explodes exponentially. We will see both regimes concretely in the next section.
Let's watch uncertainty evolve under a simple stochastic transition, with , started from many identical initial conditions. Because every trajectory starts from exactly the same point, all spread in the ensemble is uncertainty the model itself would have to invent: none of it comes from the initial condition.
n_traj = 300
horizon = 40
a_coef = 0.9
sigma_w = 0.15
trajectories = np.zeros((n_traj, horizon + 1))
trajectories[:, 0] = 1.0
noise = rng.normal(0.0, sigma_w, size=(n_traj, horizon))
for t in range(horizon):
trajectories[:, t + 1] = a_coef * trajectories[:, t] + noise[:, t]
mean_path = trajectories.mean(axis=0)
q05 = np.quantile(trajectories, 0.05, axis=0)
q25 = np.quantile(trajectories, 0.25, axis=0)
q75 = np.quantile(trajectories, 0.75, axis=0)
q95 = np.quantile(trajectories, 0.95, axis=0)
terminal_sd = trajectories[:, -1].std()
stationary_sd = sigma_w / np.sqrt(1.0 - a_coef**2)Spread (sd) at t=0: 0.0000 Spread (sd) at t=10: 0.3297 Spread (sd) at t=40: 0.3409 Theoretical stationary sd: 0.3441
Because the transition is contractive (), the ensemble spread grows quickly at first and then saturates at the stationary level, matching the theoretical value. The saturation is not an accident: each step injects fresh noise of standard deviation while contraction shrinks accumulated spread by a factor of , and the balance point between injection and shrinkage is exactly the stationary standard deviation printed above. A perfect probabilistic model would reproduce exactly this fan; a model that tracks only the mean would collapse it to a single line and be blind to the risk that matters for planning. Note also what the fan implies for multi-step validation: the appropriate yardstick for a ten-step-ahead prediction is wider than for a one-step prediction, and comparing a model's long-horizon errors against its short-horizon errors without widening the yardstick systematically punishes honest models.

To make the contrast with unstable dynamics concrete, compare the same noise injected into a contractive map () against an expansive one (). The stable system's perturbation growth flattens; the unstable system's grows geometrically, which is exactly the closed-loop signature of a learned model whose Jacobian eigenvalues sit outside the unit circle.
unstable_coef = 1.05
traj_unstable = np.zeros((n_traj, horizon + 1))
traj_unstable[:, 0] = 1.0
for t in range(horizon):
traj_unstable[:, t + 1] = unstable_coef * traj_unstable[:, t] + noise[:, t]
sd_stable = trajectories.std(axis=0)
sd_unstable = traj_unstable.std(axis=0)
Fixed Points, Stability, and Attractors
Prediction alone does not characterize a dynamical system. Ask where trajectories end up if you let them run, and you are asking about fixed points, stability, and attractors. These concepts are not optional decoration for world modelers: they determine whether a learned model's long-horizon rollouts look like the real system or like garbage, and they explain why one-step validation can be dangerously misleading. The shift in perspective is from local to global: a transition law tells you what happens in the next instant, while attractor structure tells you what happens in the long run, and the two can come apart in ways that matter enormously.
Fixed points
A fixed point of a transition function is a state satisfying : once the system is there, it stays there in the absence of noise. For a stochastic kernel, the analogous notion is a stationary distribution, which the transition leaves unchanged.
Fixed points matter because they organize the long-term behavior of everything around them. They act as the destinations toward which nearby trajectories drift or the sources from which they flee, and the inventory of a system's fixed points is therefore a rough sketch of its entire long-run personality. A trained world model whose rollouts converge to a spurious fixed point, for example a video model that predicts the blurry mean of all plausible futures, has failed in a specifically dynamical way, even if each individual one-step prediction looked plausible. The failure is invisible to one-step metrics because the spurious fixed point is approached gradually, one defensible step at a time.
Stability by linearization
Not all fixed points are equal. Some pull nearby trajectories in; others fling them away. The distinction is captured by stability. Consider a one-dimensional discrete-time system with fixed point . Nudge the state slightly: . A Taylor expansion gives
so the perturbation evolves as . The nudge shrinks if and grows if . Linearization therefore sorts fixed points into stable (perturbations decay) and unstable (perturbations grow) ones. The intuition is geometric: the derivative measures how strongly the map stretches or compresses small intervals, and repeated application multiplies that stretch factor, so anything less than one in magnitude decays geometrically while anything greater explodes geometrically.
The same idea in higher dimensions replaces the derivative with the Jacobian matrix evaluated at the fixed point, and the condition becomes: all eigenvalues of must lie strictly inside the unit circle of the complex plane. Each eigenvalue governs perturbations along its own eigendirection, so a system can be stable along one direction and unstable along another, which is why the worst eigenvalue decides. For continuous-time systems , the condition is that all eigenvalues of the Jacobian have negative real part. If you take one piece of classical control mathematics into the rest of this handbook, make it this one, because it is exactly the diagnostic you will run, knowingly or not, whenever a learned model's rollouts blow up, oscillate, or collapse. A learned dynamics network is a function like any other; it has Jacobians at its fixed points, and its eigenvalues decide whether its imagined futures settle down or spiral apart.
Linearization is a local tool. It tells you what happens in an infinitesimal neighborhood of the fixed point and says nothing about which initial conditions eventually arrive there. That second question brings us to basins and attractors.
Attractors and basins
An attractor is a set that trajectories converge to and stay near. The main species, in increasing order of complexity:
- Fixed-point attractors: convergence to a single state, like a cup of coffee cooling to room temperature. All memory of the initial condition is eventually lost.
- Limit cycles: convergence to a repeating orbit, like a heartbeat or, as we will see shortly, a thermostat. The system forgets when it started but remembers a rhythm.
- Quasi-periodic tori: motion on two or more incommensurate frequencies, common in coupled oscillators. The motion never exactly repeats, yet remains regular and predictable over moderate horizons.
- Strange attractors: bounded but aperiodic behavior with sensitive dependence on initial conditions, the signature of chaos. The system stays in a recognizable region forever yet becomes unpredictable in detail.
Each attractor comes with a basin of attraction: the set of initial conditions that converge to it. Systems with several attractors partition their state space into basins, and which basin a trajectory starts in can matter more than any local detail of its motion. Basins introduce a discrete, qualitative sensitivity into otherwise smooth dynamics: nudge an initial condition across a basin boundary and its destiny changes completely, even though its immediate next steps barely change. Learned world models routinely distort basin boundaries, which is one reason a model can behave well in the data distribution yet fail catastrophically for the states a planner steers it toward. A planner that believes a boundary sits one place, when it actually sits somewhere else, will confidently steer across it and discover a different regime than its model promised.
The logistic map: one equation, every kind of behavior
The cleanest laboratory for these ideas is the logistic map,
a one-dimensional, deterministic, nonlinear system studied extensively by Robert May in the 1970s as a model of a self-limited population. Despite its simplicity, as the parameter increases it exhibits a fixed point, a cascade of periodic oscillations, and finally chaos. One quadratic term, one parameter, and every phenomenon in the attractor taxonomy above: this economy is why the map remains the standard first example four decades on.
We can analyze it exactly. The fixed points are and . Since , the derivative at the nonzero fixed point is , which is stable precisely when , that is, for . At the fixed point loses stability and a stable period-two cycle is born. That cycle itself loses stability at , giving way to period four, then eight, in a period-doubling cascade with remarkably universal spacing (Feigenbaum's constant ), until chaos sets in near . Each doubling is a bifurcation: a stable attractor splits in two, and the system's long-run behavior acquires one more alternating phase.
## Bifurcation diagram data: for each r, iterate the map and keep late samples
r_values = np.linspace(2.5, 4.0, 1400)
n_warmup = 400
n_keep = 220
orbit = np.full(len(r_values), 0.31)
for _ in range(n_warmup):
orbit = r_values * orbit * (1.0 - orbit)
samples = np.empty((n_keep, len(r_values)))
for j in range(n_keep):
orbit = r_values * orbit * (1.0 - orbit)
samples[j] = orbit
## Time series in three qualitatively different regimes
regime_params = {
"Stable fixed point (r = 2.8)": 2.8,
"Period-2 cycle (r = 3.2)": 3.2,
"Chaos (r = 3.9)": 3.9,
}
regime_series = {}
for name, r in regime_params.items():
v = 0.31
seq = []
for _ in range(60):
v = r * v * (1.0 - v)
seq.append(v)
regime_series[name] = np.array(seq)
## Cobweb diagram data: trace the iteration graphically in two regimes
def cobweb(r, x0, n_iter=14):
xs = [x0]
ys = [0.0]
v = x0
for _ in range(n_iter):
nxt = r * v * (1.0 - v)
xs.extend([v, v])
ys.extend([v, nxt])
xs.append(nxt)
ys.append(nxt)
v = nxt
return np.array(xs), np.array(ys)
grid_cobweb = np.linspace(0.0, 1.0, 200)
cobweb_stable_x, cobweb_stable_y = cobweb(2.8, 0.15)
cobweb_chaos_x, cobweb_chaos_y = cobweb(3.9, 0.15)
The diagram compresses the entire story into one picture: a single attracting value, then a fork into alternating values, then forks upon forks, then dense bands where the orbit never repeats. Now look at the raw time series in the three regimes, because this is what a forecaster faces.



The cobweb picture makes the linearization argument visible. At the staircase steps shrink toward the crossing of the parabola with the diagonal, because the parabola's slope there is shallower than one in magnitude. At the same construction never settles: each bounce amplifies the deviation, and the orbit wanders forever inside the unit square.


In the chaotic regime, neighboring initial conditions separate exponentially fast, with rate given by the largest Lyapunov exponent. No model, however accurate, can predict individual long-horizon outcomes there: the information about the initial condition is irrecoverably lost. What a good world model can and should reproduce is the statistical behavior, the attractor, the invariant distribution, the autocorrelation structure. This fixes the evaluation principle for chaotic systems: judge models on distributional fidelity over long horizons, not on point-prediction error, which saturates at the level of chance regardless of model quality.
There is a second lesson here for anyone training learned dynamics. A model fitted to minimize one-step squared error has no term in its objective that rewards getting the attractor right. It can achieve excellent one-step accuracy while its autonomous rollouts drift to a wrong fixed point, oscillate at the wrong frequency, or diverge entirely. The objective measures fidelity of the map; the deployment requirement is fidelity of the orbits, and the two coincide only when the map is accurate everywhere the orbit goes, which is precisely what a finite dataset cannot guarantee. We will demonstrate this failure concretely with the thermostat at the end of the chapter, and we will return to mitigation strategies, such as multi-step training objectives and rollout-based validation, repeatedly in Part VI and Part XI.
Information, Compression, and Sufficient Statistics
Probability tells us how to represent belief; dynamics tells us how belief evolves. Information theory tells us what is worth remembering. For world models this is not an abstract luxury: the central engineering question of the field is which aspects of a potentially infinite history must be carried forward in a finite state, and information theory is the discipline that answers such questions. Every architecture choice in latent world modeling, from bottleneck widths to memory mechanisms, is implicitly a bet about which information is dispensable, and the tools in this section make those bets explicit and checkable.
Entropy: measuring uncertainty
The entropy of a discrete random variable measures its uncertainty in bits:
A fair coin has bit; a certain outcome has ; a uniform draw from eight options has bits. Entropy is also the answer to a compression question: is the expected number of bits per symbol needed to encode draws from without loss, a result due to Shannon that anchors the deep connection between prediction and compression. Any system that predicts well can be turned into a compressor and vice versa, a duality that resurfaces in modern world models trained with likelihood objectives and in the coding-inspired analyses we will encounter in Part III. The intuition behind the coding theorem is worth holding onto: symbols you can predict need few bits, because the decoder can guess them, while surprising symbols need many. Prediction quality and code length are two views of the same quantity.
Conditioning reduces uncertainty on average. The conditional entropy measures the uncertainty remaining in after observing , and it satisfies , with equality exactly when and are independent. Observing something can never hurt, on average, though it can fail to help if it carries no relevant information. One technical caution: for continuous variables the direct analogue, differential entropy, can be negative and is not directly a bit count. In continuous settings, work with relative quantities such as mutual information, defined next, which behave cleanly.
Mutual information and the data processing inequality
Mutual information measures how much knowing one variable reduces uncertainty about another:
It is symmetric, nonnegative, and zero exactly when and are independent. Unlike correlation, it detects nonlinear dependence: if , correlation is zero but mutual information is large. This matters for world models because the dependencies that carry predictive signal, resonances, thresholds, switching regimes, are typically nonlinear, and a team that audits its representations with correlations alone will certify as "uninformative" exactly the features doing the heavy lifting.
The single most consequential fact for our purposes is the data processing inequality: if , , and form a chain in which is produced from without further access to , then
No transformation of the data, however clever, can increase the information it carries about the source. Deterministic processing can only preserve or destroy information. Stochastic processing destroys information in expectation as well, since randomness injected downstream cannot retroactively clarify the upstream signal. This innocent-looking inequality governs what encoders, bottlenecks, and abstractions are allowed to do, and it is the reason "compression" and "information loss" are precise engineering terms rather than metaphors. Whenever an encoder maps a rich observation history into a compact latent, the inequality certifies that whatever the latent fails to capture about the source is gone for good, no matter how deep the networks stacked on top of it.
Let's verify the inequality empirically on a simple communication channel: a source drawn uniformly from eight symbols passes through unchanged to , then degrades into by additive noise.
def mutual_information(counts):
"""Mutual information in bits from a contingency table of counts."""
pxy = counts / counts.sum()
px = pxy.sum(axis=1, keepdims=True)
py = pxy.sum(axis=0, keepdims=True)
mask = pxy > 0
return float(np.sum(pxy[mask] * np.log2(pxy[mask] / (px * py)[mask])))
def count_pairs(x_vals, z_vals, x_card, z_card):
counts = np.zeros((x_card, z_card))
np.add.at(counts.ravel(), x_vals * z_card + z_vals, 1)
return counts
n_channel = 200_000
source_entropy_bits = float(np.log2(8))
x_source = rng.integers(0, 8, size=n_channel) # 3 bits of source entropy
y_clean = x_source # perfect first channel
mi_xy = mutual_information(count_pairs(x_source, y_clean, 8, 8))
noise_levels = range(0, 7)
mi_curve = []
for half_width in noise_levels:
noise = rng.integers(-half_width, half_width + 1, size=n_channel)
z_noisy = np.clip(x_source + noise, 0, 15)
mi_curve.append(mutual_information(count_pairs(x_source, z_noisy, 8, 16)))
mi_curve = np.array(mi_curve)I(X ; Y) with a clean channel: 3.000 bits (source entropy = 3) I(X ; Z) with noise in [-+0, +0]: 3.000 bits I(X ; Z) with noise in [-+1, +1]: 1.613 bits I(X ; Z) with noise in [-+2, +2]: 1.053 bits I(X ; Z) with noise in [-+3, +3]: 0.735 bits I(X ; Z) with noise in [-+4, +4]: 0.543 bits I(X ; Z) with noise in [-+5, +5]: 0.414 bits I(X ; Z) with noise in [-+6, +6]: 0.319 bits
The clean channel preserves all three bits. Every noisy variant destroys some, and the loss grows monotonically with the noise width, exactly as the data processing inequality demands. Notice also what the numbers encode: with moderate noise, retains a bit or two about , meaning a receiver can still partially infer the source, but no downstream processing of can recover the missing bits. Partial preservation is the realistic regime for world models: a lossy encoder leaves the latent partially informative about the past, and the art lies in ensuring the surviving fraction covers what the future will ask about.

Sufficient statistics
The data processing inequality tells us compression loses information in general. Sufficiency characterizes the compression that loses nothing relevant.
A function of data is a sufficient statistic for a parameter if the data add no information about beyond :
Equivalently, in information terms, : the compressed summary preserves all information relevant to the question being asked, while discarding everything irrelevant.
The classic example: to estimate the mean of a Gaussian, the sample mean is sufficient; the individual orderings and deviations of the data points carry no additional information about that particular question. Sufficiency is always relative to a purpose. A summary sufficient for one question is usually wildly insufficient for another. The sample mean of a Gaussian tells you nothing about its variance; the running maximum of a river gauge is sufficient for flood risk but nearly useless for predicting next week's level. This relativity is not a weakness but the entire point: it converts the vague demand "keep everything important" into the precise demand "keep everything important for the specified question", and for world models the specified question is always prediction of the future.
From sufficient statistics to sufficient states
Now assemble the pieces, because they snap together into the defining property of a good world-model state. Recall the Markov property from earlier: the future is conditionally independent of the past given the present state. Restate that in information-theoretic language:
The state is a sufficient statistic of the history for the purpose of predicting the future. Everything in the past that matters has been routed through the state; everything discarded was irrelevant. This single sentence connects three threads of this handbook:
- Filtering: when observations are partial, the belief state maintained by a Bayesian filter is designed to be exactly such a sufficient summary, and we will construct it in Part II: Inference, Decisions, and Control.
- State abstraction: when we search for compact states that preserve decision-relevant information while discarding the rest, we are searching for approximate sufficient statistics, the topic of Part III's treatment of state abstraction and sufficient statistics.
- Representation learning: when a latent-variable model is trained so that predictions depend on the past only through the latent, the data processing inequality certifies what the encoder is allowed to forget, a constraint we exploit in Part III's treatment of latent representations.
Approximation enters inevitably. Exact sufficiency usually requires carrying enormous state; practical world models trade a controlled amount of predictive information for a large reduction in state size. Much of the art of world modeling is choosing where along that trade-off curve to sit, and we will develop tools for judging that choice in Part XI. The thermostat below offers a rare treat: a system where the sufficient state is exactly one bit larger than the obvious choice, so we can see the cost of insufficiency in closed form rather than in vague degradation.
Worked Example: A Thermostat with Memory
It is time to make the running example concrete. The system is a room with a heater, governed by a discrete-time transition:
where is room temperature, is the heater command, is the heating rate, is the cooling coefficient, degrees is the outside temperature, and is small thermal noise. The physics is deliberately minimal: linear heat flow with a constant outside sink, a constant heater input, and additive noise. Nothing here is hard to simulate, which is exactly why any modeling failure we observe later will be attributable to representation and dynamics rather than to simulation complexity.
The controller uses a hysteresis rule: turn the heater on when the temperature falls below 19.5 degrees, turn it off above 20.5 degrees, and otherwise keep the previous command.
Hysteresis is the interesting ingredient. Without it, the controller would flicker on and off at the threshold. With it, the controller's decision at the intermediate temperatures depends not only on the current temperature but on which side the system approached from, that is, on the past. Watch what this does to the dynamics.
ALPHA = 0.6
KAPPA = 0.02
T_OUT = 8.0
NOISE_SD = 0.05
LOW, HIGH = 19.5, 20.5
def controller(temp, mode, low=LOW, high=HIGH):
"""Hysteresis control: 1 = heat, 0 = off. Keeps previous command in the deadband."""
if temp < low:
return 1
if temp > high:
return 0
return int(mode)
n_steps = 2000
temps, modes = [], []
temp, mode = 20.0, 0
for t in range(n_steps):
cmd = controller(temp, mode)
temp = (
temp + ALPHA * cmd - KAPPA * (temp - T_OUT) + rng.normal(0.0, NOISE_SD)
)
mode = cmd
temps.append(temp)
modes.append(mode)
temps = np.array(temps)
modes = np.array(modes, dtype=float)
n_switches = int(np.sum(np.diff(modes) != 0))
mean_period = 2.0 * n_steps / max(n_switches, 1)Heater duty cycle (fraction on): 0.402 Number of on/off switches: 450 Mean cycle period: 8.9 steps Temperature range: [19.16, 20.96] degrees
The system does not settle to a fixed point. Instead it locks into a repeating oscillation between the two thresholds: a limit cycle attractor created by the interaction between the linear thermal dynamics and the nonlinear switching controller. Neither component alone would oscillate: the thermal dynamics alone relax exponentially to a steady temperature, and the switching logic alone is just a lookup table. The oscillation lives in their coupling, which is typical of limit cycles in engineered systems. The measured period and duty cycle match what the physics suggests: heating near 20 degrees proceeds at roughly degrees per step, cooling at roughly degrees per step, so each half-cycle takes a handful of steps. The asymmetry between those rates is why the sawtooth below leans: fast climbs, slower descents.


Now the punchline about state. Suppose you try to predict from alone. During the deadband between the thresholds, the same temperature can be approached with the heater on or off, and the two cases lead to next-step temperatures differing by the full heating increment degrees. Temperature alone is not a sufficient state: the pair is, because given both, the next temperature is fully determined up to noise. The hidden variable here is the heater mode, a one-bit memory that the hysteresis rule makes unpredictable from temperature alone. Note how economical the fix is: infinitely much history collapses into a single bit, because the hysteresis rule ensures the mode is fully determined by the recent past and fully determines the relevant future. Not every hidden state is so cooperative, but the pattern, find the small object that summarizes the past, is universal.
We can see the insufficiency directly in the data. Collect all logged steps whose current temperature falls in a narrow band inside the deadband, and split them by heater mode. Conditioned on temperature alone, the next temperature is bimodal, with the two modes separated by roughly the heating increment; conditioned on temperature and mode, each half collapses to a tight unimodal cloud sitting at the noise floor. This is exactly what a missing hidden state looks like in a conditional distribution.
current_temps = temps[:-1]
next_temps = temps[1:]
transition_modes = modes[1:]
deadband = (current_temps >= LOW + 0.1) & (current_temps <= HIGH - 0.1)
on_mask = deadband & (transition_modes == 1.0)
off_mask = deadband & (transition_modes == 0.0)
hist_edges = np.linspace(19.4, 21.4, 45)
hist_centers = 0.5 * (hist_edges[:-1] + hist_edges[1:])
hist_width = hist_edges[1] - hist_edges[0]
dens_mixed = np.histogram(next_temps[deadband], bins=hist_edges, density=True)[
0
]
dens_on = np.histogram(next_temps[on_mask], bins=hist_edges, density=True)[0]
dens_off = np.histogram(next_temps[off_mask], bins=hist_edges, density=True)[0]

This is the smallest possible instance of a problem that pervades the field. Partially observable systems hide state variables inside their histories, and agents that ignore the hidden component see a world that appears to violate the Markov property even when the underlying world is perfectly Markovian. The remedies, carrying beliefs over hidden states or learning memory-based representations, are major subjects of Part II and Part III. Here, we can simply measure the damage.
Implementation: Learning a Transition Model and Stress-Testing Its Dynamics
Let's play the role of a practitioner who has logged thermostat data and wants a world model. We will fit two one-step regression models to the same dataset: a full model that receives the current temperature and the heater command applied during that transition, and a baseline that receives temperature only. We will then evaluate both the way practitioners usually do, with one-step error, and the way that actually matters for a world model, by rolling each model out in closed loop and comparing against the true system's attractor. The experimental design is intentionally austere: linear models, least squares, no tuning. If the dynamical failure appears even here, it is not an artifact of deep learning.
First, build the training data and fit both models by least squares. We fit on the first 1,500 steps of the log and reserve the remaining 500 as held-out data, so the closed-loop stress test below is scored against temperatures the models never saw.
n_train = 1500
T_prev = temps[: n_train - 1]
T_next = temps[1:n_train]
M_applied = modes[1:n_train]
ones = np.ones_like(T_prev)
X_full = np.column_stack([T_prev, M_applied, ones])
X_base = np.column_stack([T_prev, ones])
theta_full, *_ = np.linalg.lstsq(X_full, T_next, rcond=None)
theta_base, *_ = np.linalg.lstsq(X_base, T_next, rcond=None)
resid_full = T_next - X_full @ theta_full
resid_base = T_next - X_base @ theta_base
rmse_full = float(np.sqrt(np.mean(resid_full**2)))
rmse_base = float(np.sqrt(np.mean(resid_base**2)))Full model T' = a*T + b*m + c: a = +0.978 b = +0.602 c = +0.195 one-step RMSE = 0.050 (noise floor is 0.050) Baseline T' = a*T + c: a = +0.721 c = +5.595 one-step RMSE = 0.281
The action-aligned full model estimates the temperature and heater coefficients close to their true values, and , and its one-step RMSE on the training data sits near the noise floor. Both printed errors are in-sample residuals over the 1,499 fitted transitions — we deliberately spend the held-out window on the closed-loop stress test below rather than on a second one-step score. The intercept is less precisely estimated because temperature, heater command, and the constant column are strongly correlated over a narrow limit cycle. The baseline's one-step error is more than three times larger in this run, which is the price of ignoring the hidden mode. Note the baseline's fitted slope: because the heater tends to be on when the temperature is low and off when it is high, temperature and mode are correlated in the data, and the least-squares fit absorbs part of the heater's effect into a distorted temperature coefficient. This is a miniature version of confounding, and it will matter in a moment. The baseline is not merely missing a feature; it has actively misattributed the missing feature's effect onto the feature it does have, so its errors are structured, not random.
Now the closed-loop test. We let each fitted model drive the same hysteresis controller from the same initial condition for 300 steps, feeding each prediction back in as the next input, and compare against the true system over the same window.
def rollout_model(theta, use_mode, horizon=300, temp0=20.0):
"""Closed-loop rollout: model predictions feed back as inputs."""
out = [temp0]
cur, mode = temp0, 0
for _ in range(horizon):
cmd = controller(cur, mode)
feats = np.array([cur, cmd, 1.0]) if use_mode else np.array([cur, 1.0])
cur = float(feats @ theta)
mode = cmd
out.append(cur)
return np.array(out)
eval_start = 1650
true_window = temps[eval_start : eval_start + 301]
roll_full = rollout_model(
theta_full, use_mode=True, temp0=float(true_window[0])
)
roll_base = rollout_model(
theta_base, use_mode=False, temp0=float(true_window[0])
)
final_gap_full = abs(roll_full[-1] - true_window[-1])
final_gap_base = abs(roll_base[-1] - true_window[-1])Closed-loop gap after 300 steps, full model: 0.833 degrees Closed-loop gap after 300 steps, baseline: 0.498 degrees True system temperature std over window: 0.410 Full-model rollout temperature std: 0.426 Baseline rollout temperature std: 0.026

Read the figure alongside the printed numbers, because together they make the chapter's central practical argument. The full model, fitted with the command aligned to the transition it caused, reproduces the true system's limit-cycle regime. Its deterministic trajectory need not remain pointwise synchronized with a noisy held-out trajectory, so the terminal gap is not by itself a fidelity certificate. The baseline does noticeably worse on one-step error, but nothing about that error signals the scale of the failure to come: in closed loop, its distorted coefficients translate into a rollout that never oscillates at all. The fitted temperature coefficient, about 0.72, makes the learned map a contraction, so the rollout converges within roughly forty steps to a spurious fixed point near 20.03 degrees, comfortably inside the controller deadband, where the hysteresis rule keeps the heater permanently off. The model has averaged over the two heater regimes instead of representing them, and the result is systematic dynamical distortion: a constant erroneous temperature rather than the true limit cycle. A planner consuming this model would misjudge both how hot the room gets and how quickly it cycles, and it would do so with total confidence, because the model reports no uncertainty about its own distortion.
This is why the qualification test from Chapter 3 insists on separating open-loop prediction quality from closed-loop decision usefulness. A model can pass every one-step metric and still be useless, or actively harmful, as the substrate for planning. Whenever you train a world model, reserve part of your evaluation for autonomous rollouts compared against held-out true trajectories, and pay attention to whether the model reproduces the character of the system's attractors, not just its short-range accuracy. Concretely: compare oscillation periods, duty cycles, variance levels, and occupancy of state space, the statistical fingerprints introduced in the chaos discussion above. The thermostat needed only one hidden bit to break a naive pipeline; production environments hide far more, and far less legibly.
Key Parameters
The key parameters for the transition-model experiment are:
- n_train: Number of logged steps used to fit both regression models. The rest of the log is held out, so closed-loop rollouts are compared against data the models never saw. Larger values reduce estimation noise in the fitted coefficients but shrink the held-out window available for the stress test, so the split embodies a direct trade-off between fit quality and evaluation power.
- rcond: Cutoff for small singular values passed to
np.linalg.lstsq. Design directions whose singular values fall below this fraction of the largest are treated as zero, which keeps the least-squares solve stable when design columns are nearly collinear. In this experiment the design is benign, but in richer feature spaces the same knob controls how aggressively the solver refuses to fit noise directions. - horizon: Number of closed-loop feedback steps in the stress-test rollout. Longer horizons give compounding error more room to separate a dynamically faithful model from one that is merely accurate one step ahead. Choose it relative to the system's natural timescale: here, a few dozen steps span several full limit cycles, which is enough for amplitude and rhythm errors to become unmistakable.
- temp0: Initial temperature handed to every closed-loop rollout. Matching it to the start of the true evaluation window keeps the gap measurements comparable across models. Because the system's limit cycle erases initial conditions within a handful of steps, this choice matters little for the full model, which is itself a small demonstration of attractor behavior.
Limitations and Impact
The machinery in this chapter is powerful, but each piece carries assumptions that fail in instructive ways, and knowing the failure modes is as valuable as knowing the tools.
The Markov property is the assumption everything else rests on, and it is an assumption about representation, not about reality. Real environments routinely violate it for any state an agent can actually hold: other agents adapt, exogenous processes drift, and sensors alias distinct situations onto identical readings. When Markovianity fails, every technique built on it, from dynamic programming to latent rollouts, inherits a bias that no amount of data removes. More data collected under the same insufficient state reproduces the same aliasing more precisely, not less. The honest responses are to enlarge the state, to carry explicit beliefs over what is hidden, or to accept approximation and bound its cost, and each response defines a research lineage we follow in Part II and Part III.
Linearization, our main stability tool, is a local instrument applied to global questions. It correctly classifies hyperbolic fixed points (at non-hyperbolic equilibria the linear terms are inconclusive and higher-order analysis decides) but says nothing about basin boundaries, transient behavior far from equilibria, or systems whose interesting dynamics, like the logistic map's chaos, live nowhere near any fixed point. Estimating Jacobians and Lyapunov exponents from learned models compounds the model's own errors: a slightly biased model can report confidently that a fixed point is stable when it is not, or vice versa. Treat stability diagnostics of learned models as hypotheses to be checked by direct rollout experiments, not as certificates. The diagnostic and the rollout are complementary: the former explains a failure after the latter reveals it.
Information theory brings its own practical gaps. Entropy and mutual information are easy to define and notoriously hard to estimate in high dimensions; plug-in estimators are badly biased with finite samples, and the estimators that work well, such as variational bounds and contrastive methods, optimize surrogates whose tightness is rarely known. When this chapter says a good state satisfies , treat it as a design ideal that guides architecture and evaluation, not as a quantity you will compute exactly outside of small discrete problems. The channel experiment above was trustworthy because eight symbols and two hundred thousand samples make estimation trivial; a latent of a few thousand dimensions offers no such comfort.
What the chapter provides, despite these caveats, is a shared language in which every subsequent debate becomes precise. Questions like "is this representation adequate?", "will rollouts diverge?", "how much memory does this task require?", and "is this model exploitable by a planner?" all reduce to statements about conditional distributions, transition stability, sufficient statistics, and compounding error. Practitioners who internalize this vocabulary consistently diagnose world-model failures faster, because most failures are instances of a handful of dynamical pathologies rather than novel mysteries.
Summary
- Random variables and conditional distributions are the substrate of world modeling. A world model is a stack of conditionals, and the chain rule composes them into full trajectory distributions. Conditioning both shifts and sharpens belief; models that report only conditional means discard the spread that planning needs.
- States, transitions, and trajectories formalize prediction. The transition kernel generalizes the deterministic map, and the Markov property, an assumption about the state representation, licenses recurrences instead of ever-growing histories. Rollout uncertainty compounds, saturating for stable systems and exploding for unstable ones.
- Fixed points, stability, and attractors characterize long-run behavior. Linearization classifies fixed points via Jacobian eigenvalues, and attractors range from fixed points through limit cycles to chaos. Judge models of chaotic systems on statistical fidelity, not long-horizon point accuracy.
- Information, compression, and sufficient statistics say what a state must remember. The data processing inequality bounds what encoding can preserve, and a Markov state is exactly a sufficient statistic of the past for predicting the future, the ideal that state abstraction and latent representations approximate.
- The thermostat tied it all together: a limit-cycle attractor, a hidden one-bit state that temperature alone misses, and a vivid demonstration that one-step accuracy does not imply correct closed-loop dynamics.
With these foundations in place, the next chapter can do what this one deliberately deferred: attach actions, rewards, and optimality to the transition structure, arriving at the Markov decision process, the formal arena in which nearly all of Part II takes place.
Quiz
Ready to test your understanding? Take this quick quiz to reinforce what you've learned about the mathematical and dynamical foundations of world models.
Reference
Citation details
Cite or share this article.
Continue with the full handbook
This chapter is part of World Models Handbook. Use the handbook page to browse the complete table of contents and continue reading in sequence.
Explore World Models HandbookStay up to date
Get articles, book updates, and news delivered to your inbox.
No spam, unsubscribe anytime.
Join the community
Sign in to remove popups, track your reading progress, and join the discussion.

Comments
No comments yet. Be the first to share your thoughts!