Antivision · Latent Rehearsal
05

The rudder
and the world model

The central piece in three versions — the one that only pointed, the one that points better, and the one that imagines — with what each one cost and bought. The empty cells wait for runs that are in the queue; none will be filled in from the head.

Chapter 05 Prerequisite: 03 (geometry) and 09 (the architecture)

1 Three versions of the same question

The question is a single one: does the model know where it is going before it goes? Each version answers in its own way, and each was measured against the previous one under the same protocol (chapter 06): same frozen data, 700 steps, seed 1337, best checkpoint, control = cosine 1.0 with validation 5.2706.

The three versions. "Gain" is always over the identity floor — copying the current state — and not over chance.
VersionWhat it predictsKnows the action?FlagStatus
v1 · shallow rudderthe embedding of the next token, from ztno--latentmeasured
v2 · deep rudderthe next hidden state zt+1, from ztno--latent --latent-target ocultomeasured
v3 · world modelzt+1 from (zt, at[, ζ, m])yes--world --sigreg-zfirst run measured; the rest in the queue
Why v3 exists

A predictor that does not know which action was taken can only predict the average of the possible futures. It is the blur of the talk — "the system predicts the average of everything that can happen" — and it is what v1 measured: cosine 0.534 with the target, against 0.46 for copying the state. Gain of 0.07. The world model receives the action: "if I emit this token, where will I end up?". It is that question, and not the previous one, that makes planning possible.

2 What v1 and v2 measured

"Duel" round. The rudder column is the cosine between prediction and target on validation, with the identity floor beside it.
Runvalidationvs controlrudder (floor)Reading
control reg15.2706——
v1 reg1-lat15.3447+1.41%0.534 (0.46)gain +0.07 over the floor; costs quality
v2 reg1-lat1o5.2233−0.90%0.716 (0.48)improves the generator; PPL 185.55, the best of all
v2 + Barlow reg1-lat1o-bar0.55.2442−0.50%—second to beat the control
v2 + DINO reg1-lat1o-dino15.3804+2.08%0.703 (0.48)EMA teacher, centering, sharpening: the rudder is accurate, the generator gets worse (chapter 04)
v2 on SigReg sig1-lat1o5.3856+2.18%0.719 (0.48)the weak base contaminates the piece: that is why the clean test is on the control

The result that organizes the chapter: predicting the next state in the latent helps the generator (−0.90%, one seed), and predicting the token's embedding does not help (+1.41%). The difference between the two is the target: the hidden state carries context; the row of the embedding table does not. It is DINO's self-distillation with stop-gradient in place of the EMA teacher — and the run with the real teacher has answered: the EMA buys nothing — it costs 3 points against stop-gradient, on one seed (chapter 04).

The additive term at generation: a clean negative result

The first idea for using the rudder was to add to the logits a term α · cos(E[v], Pred(h)). The test (evaluate_compass.py --only-alpha) measured the validation loss with three directions in place of Pred: the predictor's, the identity (h itself) and a random direction. The predictor was worse than the identity, and the identity worse than random. Adding a direction to the logits makes things worse, whatever the direction — because it distorts a calibrated distribution. That is what condemned additive inference and motivated the energy (chapter 09): the predicted direction serves to choose among candidates, not to reweight all of them.

3 The world model, piece by piece

Each piece of v3, the flag that switches it on and the run that tests it. All additive; the control for each one is the row above.
PieceWhat it doesFlagRun
Action-conditioned predictorPred(zt, at) → zt+1, end to end, no EMA--world 1wm1-sz1
SigReg on the statesthe anti-collapse: the z cannot become constants--sigreg-z 1same; control wm1det (stop-grad, without SigReg-z)
Hierarchylevel 2 over blocks of 8: abstrair() + mundo2--world-levels 2wm1n2-sz1
Learned level-2 encoderblock mean + residual correction--world-enc2wm1n2e-sz1
Latent variable ζmultiple futures; narrow channel regularized to N(0, I)--world-latent 16wm1n2z16-sz1
Persistent memoryvector m folded in from what leaves the window--world-memorywm1n2mem-sz1
Two stages (DINO-WM)world model on top of the self-distilled encoder, frozen--base … --freeze-encoderwm-sobre-dino

The table the queue will fill

World model, best checkpoint of each run. "wm gain" = floor − MSE (positive: predicting with the action hits more than copying the state). "n2" is the same at level 2. "cost" is validation against the control: the world model may help or hinder the generator.
Runcost (vs ctrl)wm gainwm gain n2memReading
wm1-sz1+9.59%+0.80——the map predicts (MSE 0.150 against floor 0.948; cos 0.93 against 0.58) and the generator pays dearly
wm1det (control)+1.11%+0.87——stop-grad, without SigReg-z: MSE 0.535 against floor 1.406, cos 0.79 against 0.51 — almost the same map for eight points less
wm0.1-sz1 (weight 0.1)+3.25%+1.17——the weight explains most of the cost: from +9.59% to +3.25%, with the map at MSE 0.670 against floor 1.842 (cos 0.71 against 0.33); still two points above the stop-grad
wm0.1n2-sz1-lat1o (the combination)+3.05%+1.17+0.15—deep rudder (gain +0.29 over the floor) + hierarchical world model with weight 0.1: the three heads learn together, but the generator stays at +3.05% — the rudder alone gave −0.90%; the world model, even light, does not give back what the rudder was buying
wm1n2-sz1+8.78%+0.94+0.07—level 2 predicts the next block: MSE 0.089 against floor 0.160 — and predicts further than level 1 rolled out (chapter 11)
wm1n2e-sz1+6.93%+0.87+0.006 (floor 0.013)—scale collapse at level 2: the learned encoder shrank the abstract states 13× (block floor 0.160 → 0.013) and the hit became trivial — the risk predicted in chapter 09, realized
wm1n2e-sz1-ss1 (+ SigReg on the abstract states)+11.32%+0.84+0.035 (floor 0.068)—the block floor rose from 0.013 to 0.068 (the raw mean gives 0.160), but consecutive blocks became almost orthogonal (cos 0.07) and the generator paid the worst cost of all: Gaussianizing the abstract states is not the right anti-collapse for level 2
wm1n2en-sz1 (+ scale-only anti-collapse)+6.22%+0.82+0.004 (floor 0.009)—collapse through the other door: with the norm fixed, the encoder sent every block to the same direction (cosine 1.000 between consecutive blocks). The learned level-2 encoder collapses in scale, in direction, or loses continuity — the raw mean is the honest abstraction on this budget
wm1n2z16-sz1+7.00%+1.66 (with ζ from the target)+0.24 (same)—the channel leaked: with ζ inferred from the target the map errs 0.038 (cos 0.98); with ζ sampled, as at inference, 1.258 (cos 0.28) — almost the floor of 1.671
wm1n2z16zd0.5-sz1 (ζ-dropout)+7.60%+0.96——the channel closed: with ζ sampled the map errs 0.222 (cos 0.88) against floor 1.110 — the map comes to exist at inference
wm1n2mem-sz1+7.77%+0.93+0.07+0.014the right memory predicts better than another text's, and the one that crossed a whole window is worth as much as the recent one (chapter 11)
wm-sobre-dino (two stages)= base
(+2.08%)
+0.80+0.024 (floor 0.062)—world model on top of the frozen DINO encoder, 11 min of training: MSE 0.665 against floor 1.462 (cos 0.73 against 0.49). Predicts less than the end-to-end one (0.15) and costs the generator nothing — the cost is the base's, by construction

The first run, read

wm1-sz1 closed with both sides of the coin. The world model works: error 0.150 against 0.948 for copying the state, cosine 0.93 against 0.58 — and it understands sequence, as the violation of expectation below shows. But validation went to 5.7761, +9.59% over the control: the worst quality cost of all the runs. The hypothesis, written before the control closes: with weight 1.0 and end-to-end training, the encoder shapes the states to be predictable from the action — a shortcut — and loses what the cross-entropy needs. wm1det (target with stop-gradient, without SigReg-z) separates the two things; at step 99 it was already 0.63 nats below wm1-sz1 at the same step. By the house rule, the answer is not to discard: two runs with weight 0.1 (wm0.1-sz1 and wm0.1n2-sz1-lat1o, the combination with the deep rudder) entered the queue.

Violation of expectation (surprise.py), wm1-sz1: 48 sequences of 128 tokens, the violation starts at token 64; world-model error only on the second half. The last column is what matters: how much the error rises beyond what the identity rises.
Continuationmap errorvs realidentityvs realmap − identity
real (coherent)0.145—0.943——
2nd half of another document0.172+18.6%0.953+1.0%+17.6%
shuffled0.205+40.9%0.987+4.7%+36.3%
reversed (same tokens, wrong order)0.192+32.3%0.914−3.1%+35.3%

It is the ball that vanishes from the video, in text: the same sentence backwards makes the map's error rise 32% while the identity barely notices (−3%). The world model learned something about the dynamics of text that copying the state does not capture — the first "common sense" measured in this project, and it came in the run that cost the generator the most.

The latent variable, read

wm1n2z16-sz1 had the lowest cost of the end-to-end runs (+7.00%) and the largest map gain in the table — and the gain is false. ζ is read from the target through a 16-dimensional channel, regularized by SigReg to be N(0, I); the bet was that a narrow, Gaussian channel would only carry "which future", not "the whole future". Measured on validation, with the same states:

The same map, four sources of ζ. 32 sequences of 256 tokens. The inference row is the one that counts.
ζMSEcos
inferred from the target (as in training)0.0380.984
zero0.8890.521
sampled from N(0, I) (as at inference)1.2580.278
from another sequence1.6820.203
floor: copying zt1.6710.289

With the ζ that inference has, the map is the floor. The channel carried the target — and SigReg on the ζ did not close the channel: the mean stayed at 0.00 but the standard deviation at 1.44 and the norm at 5.7 (N(0, I) would give 1.0 and 4.0). The symptom shows up in everything that uses ζ = 0: the violation of expectation vanishes (+3 / −4 / −1 beyond the identity, against +25 / +41 / +39 for wm1n2-sz1) and level 2 becomes worse than copying the block. It is the talk's collapse through another door: not the constant representation, but the trivial prediction via a shortcut. The fix is in the queue: ζ-dropout (--world-latent-dropout 0.5) — half the batches with ζ sampled, so that the predictor has to work without the target, and ζ can only carry what a sample would also carry. Meanwhile, this model's rudder governs anyway (chapter 12: 0.383 against 0.265 for free), because the planner samples ζ and the cost on the real state does not depend on the map.

The fix, measured: wm1n2z16zd0.5-sz1, half the batches with ζ sampled. Same 32 sequences, same four sources of ζ.
ζwithout dropout: MSE (cos)with dropout 0.5: MSE (cos)
inferred from the target0.038 (0.984)0.144 (0.925)
zero0.889 (0.521)0.201 (0.892)
sampled from N(0, I)1.260 (0.280)0.222 (0.879)
from another sequence1.682 (0.203)0.214 (0.884)
floor1.671 (0.289)1.110 (0.430)
ζ: standard deviation / norm1.44 / 5.700.70 / 2.75

ζ-dropout closed the channel. With ζ sampled, as at inference, the map errs 0.222 against 1.110 for the floor — before, it erred 1.260 against 1.671, that is, nothing. The difference between ζ inferred and ζ sampled fell from 33× to 1.5×: what ζ still carries is the choice among futures, not the future. The cost to the generator stayed the same (+7.60% against +7.00%). And ζ came closer to N(0, I) (standard deviation 0.70, norm 2.75) — SigReg on the ζ starts to have an effect once the predictor can no longer depend on them. The violation of expectation came back with it: with ζ = 0, +22.6 / +31.4 / +30.4 beyond the identity (against +3 / −4 / −1 in the leaked channel) — the map understands sequence again. And chapter 12 closes the cycle: on this map the rudder governs on both axes (0.324 against 0.243, PPL 51.7 against 62.6).

The two stages, read

The talk's recipe — "use DINO as the encoder, then train a world model and plan" — is wm-sobre-dino: the encoder of run reg1-dino1-lat1o frozen, only the world model's heads learning, 532 thousand parameters, eleven minutes. The map comes out worse than the end-to-end one (MSE 0.665 against 0.15; cosine 0.73 against 0.93) and better than the floor by a wide margin (+0.80). What it buys is what no end-to-end run bought: zero cost to the generator, because the generator is not touched. It is the opposite pair of wm1-sz1: there the map is excellent and the generator pays 9.59%; here the map is good and the generator pays nothing. Between the two, wm1det (+1.11%, cosine 0.79). The choice between them is the choice between a more precise map and an intact generator — and chapter 12 says that, to govern, the map does not need to be the most precise: on this one, the rudder gives 0.436 against 0.281 for free, the largest effect of all the maps. The violation of expectation is there too (+10.1 / +31.6 / +32.7 beyond the identity): the map trained in eleven minutes on top of an encoder that never saw a world model understands sequence.

The control, read

wm1det — the same world model with the target without gradient and without SigReg on the states, the "old shortcut" the LeWorldModel recipe dispenses with — closed at 5.3291, +1.11%, with a map gain of +0.87 over the floor (MSE 0.535 against 1.406; cosine 0.79 against 0.51). Against wm1-sz1: eight percentage points less in cost, and a map that predicts almost as well. Criterion (2) of the box below fired: end-to-end training with SigReg-z, with weight 1.0, does not pay for what it costs in this model. What it buys is a more predictable space (cosine 0.93 against 0.79) — and chapter 12 shows that this space governs when the cost has scale; what it charges is the generator. Two honest readings fit at the same time: the stop-gradient did not collapse (the identity floor remains far from the map's error, and the SigReg of the states, measured without training, stayed at 10× the Gaussian floor against 12.8× for wm1-sz1), and the end-to-end recipe may be right with the wrong weight. wm0.1-sz1 has said: with weight 0.1 the cost falls from +9.59% to +3.25%, and the map keeps beating the floor (+1.17, cosine 0.71 against 0.33). The weight was most of the bill; the two points left between 0.1 end to end and the stop-grad are the price of SigReg on the states, which has not paid for itself in any run yet. The violation of expectation on wm1det gives the same picture, a little weaker: another document +10.7%, shuffled +26.0%, reversed +27.7% beyond the identity (against +17.6 / +36.3 / +35.3 for wm1-sz1, +25.0 / +41.3 / +39.3 for wm1n2-sz1 and +16.0 / +41.4 / +39.4 for wm1n2e-sz1). With weight 0.1 (wm0.1-sz1): +9.4 / +20.1 / +22.8 — the lighter map understands less sequence, in the same order. All the level-1 maps understand sequence; only the one with the leaked ζ, with ζ sampled, does not.

What would invalidate v3

Three results, any one of them: (1) wm gain ≈ 0 in every run — the world model does not predict better than copying the state, and the action adds nothing in text; (2) wm1det equal to or better than wm1-sz1 — SigReg on the states does not play the role the LeWorldModel recipe gives it; (3) a quality cost above what the deep rudder gives back (−0.90%) — then the world model pays to exist, and chapter 00 changes the line "the only piece that improved the generator". All three are written before the number, so that the number does not choose the question.

4 Inference: how the rudder becomes a rudder

With the world model trained, generation changes in nature: instead of adding a bias (the negative result of §2), the system imagines each candidate and chooses by energy. The modes, all selectable in the «Antivision · rudder» panel (chapters 09 and 10):

The inference modes. The energy always has the form guardrail + task; what changes is where the search happens.
ModeWhere it searchesCost per token (smoke test, CPU)The concept it realizes
additivedoes not search: adds β·cos to the logits~0the negative control
energybeam in the latent, branching over tokens0.05 sMPC in miniature; "generate many sequences and choose"
gradientone continuous action, one step0.4 sinference by optimization, literal form
mpcsequence of H continuous actions; commitment by energy over the candidates0.8 s"reasoning in mental space, not in output space"

And on top of the modes, three flags from the reading of LeCun: the task cost and the guardrails can be learned heads from three sentences (costs.py); level 2 can plan its own abstract action (plan2_steps); and the planner can stay quiet when the model has no doubt (plan_if_entropy). The comparison of all this on a trained model is chapter 12.

The cross-test table

The evaluate_compass.py test: three headings × four prompts. For each generation, the affinity with each heading (neighborhood in the 400 nearest tokens) and the perplexity of the generated text. A rudder works if the diagonal of the affinity matrix dominates and the perplexity does not explode.

wm1-sz1, energy mode, β = 8, horizon 3. Rows: requested heading. Columns: measured affinity with each heading (neighborhood in the 400 nearest tokens, in the model's own embedding). Last column: PPL of the generated text.
Requested headingaffinity: codefootballhistoryPPL
code0.1460.0020.17911.0
football0.1290.0000.25013.5
history0.1290.0020.25213.7

Effect (diagonal − off-diagonal): +0.017 with β = 8; 0.000 with β = 16. The rudder, with the cosine-to-heading cost, does not govern this model: the three rows are almost equal, and with β = 16 they are identical — the planner always chooses the same candidate, the most probable one, because the task energy does not distinguish the candidates. The map predicts well and the cost does not point. It is exactly the gap the learned cost head (chapter 12) was made to close; the modes table, with the independent judge, says whether it closes.

5 Correcting the map

When the plan does not give the predicted result, what gets corrected is the world model (chapter 09, §3.3). The smoke test, on a two-step world model, gave a surprise/floor ratio of 0.907 → 0.719 on a held-out set. The number that counts is the same test on a trained model, where the map is already good and the margin is small:

correct_world.py --finetune on wm1n2-sz1, 16 real sequences + 16 generated, 300 steps on the map's heads only. Surprise/floor ratio: below 1 = the map predicts better than copying the state. (On wm1-sz1, before: real 0.177, generated 0.165, test 0.167.)
Setbeforeafter
real text0.161—
generated text (seen during correction)0.1490.095
held-out test0.1610.159

What the smoke test predicted, happened: with the map already at 0.16, the correction memorized its own trajectories (0.149 → 0.095 on the generated text) and did not generalize (0.161 → 0.159 on the test). It is the "critic overfitting" the talk says to watch for, and it appears exactly where the margin is small. The loop is right and so is the reading criterion; what this map lacks is systematic error to correct.

Analogy

The shallow rudder is a weathervane: it shows where the wind blows, and nothing more. The deep rudder is a weathervane that knows the boat: it shows where the boat is going. The world model is the pilot who asks "what if I turn to port?" before turning — and who, when the boat does not go where he predicted, corrects the chart, not the helm.

Open questions

Chapter 06 tells how all these numbers were measured — and the eleven mistakes the method caught along the way.