Mathematical and Dynamical Foundations › States, Transitions, and Trajectories

Michael BrenndoerferJune 6, 20269 min read
World Models HandbookAll chapters
Part 1 of 12The World-Model Idea
Chapter 6Mathematical and Dynamical Foundations › States, Transitions, and Trajectories
Reading section 3 of 11 · States, Transitions, and Trajectories · 9 minSection 3 of 11 · 9 min

Book contents

Section 3 of 11 · 9 min read

Mathematical and Dynamical Foundations › States, Transitions, and TrajectoriesOne section · Sections in this chapter3 / 11 ↓
Reading tools Definitions & inline links

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

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 tt, written oto_t. 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 sts_t. 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 ata_t. 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 (st,at)(s_t, a_t) or (ot,at)(o_t, a_t) 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:

st+1=f(st,at).s_{t+1} = f(s_t, a_t).

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:

st+1∼p(⋅∣st,at).s_{t+1} \sim p(\cdot \mid s_t, a_t).

The deterministic case is the special case where this distribution puts all its mass on one point. A useful mental model is that f(st,at)f(s_t, a_t) 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.

The Markov Property

A transition law is Markov if the future is conditionally independent of the past given the present state and action:

p(st+1∣st,at,st−1,at−1,… )=p(st+1∣st,at).p(s_{t+1} \mid s_t, a_t, s_{t-1}, a_{t-1}, \dots) = p(s_{t+1} \mid s_t, a_t).

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 s0s_0 and a rule for choosing actions, such as a policy π(at∣st)\pi(a_t \mid s_t), the chain rule factors the distribution over a full trajectory:

p(s0:T,a0:T)=p(s0)∏t=0T−1π(at∣st) p(st+1∣st,at).p(s_{0:T}, a_{0:T}) = p(s_0) \prod_{t=0}^{T-1} \pi(a_t \mid s_t)\, p(s_{t+1} \mid s_t, a_t).

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 ϵ\epsilon per step. If errors merely added, a hundred-step rollout would be off by 100ϵ100\epsilon. In reality they typically compound multiplicatively, because the model's predicted state at step tt is the input to its prediction at step t+1t+1: 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, st+1=0.9 st+wts_{t+1} = 0.9\,s_t + w_t with wt∼N(0,0.152)w_t \sim \mathcal{N}(0, 0.15^2), 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.

In[7]:
Code
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)
Out[8]:
Console
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 (∣0.9∣<1|0.9| < 1), 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 0.150.15 while contraction shrinks accumulated spread by a factor of 0.90.9, 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.

Out[9]:
Visualization
Fan chart of trajectory quantiles widening then leveling off around the mean path.
Ensemble of 300 rollouts of a stable stochastic transition. Uncertainty grows from zero, then saturates at the stationary spread because the dynamics are contractive.

To make the contrast with unstable dynamics concrete, compare the same noise injected into a contractive map (a=0.9a = 0.9) against an expansive one (a=1.05a = 1.05). 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.

In[10]:
Code
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)
Out[11]:
Visualization
Log-scale line chart of ensemble standard deviation, one curve leveling off and one rising exponentially.
Ensemble spread over rollout time for a contractive transition (a = 0.9) versus an expansive one (a = 1.05). Stable dynamics saturate; unstable dynamics grow geometrically.