JEPA4Japan · tutorials

Chapter 28 — Violation of Expectation: Is the Model Surprised by “Impossible Events”?

731 words 4 min read #LeWorldModel#World Models#JEPA

Compare normal dynamics with controlled violations, define surprise through latent prediction error, and state what the resulting evidence can and cannot prove.

Course progress Course outline 48 of 48 lessons available

Part 0 — Reading Guide: What Exactly Are We Going to Learn?

  1. 01 Chapter 0 — Before You Begin available now

Part 1 — World Models: An Internal Sandbox for the Agent

  1. 02 Chapter 1 — Why an Agent Needs to “Imagine the Future” available now
  2. 03 Chapter 2 — Why Not Predict the Next Image Directly? available now
  3. 04 Chapter 3 — The JEPA Idea: Predict Meaning, Not a Replica of the Image available now
  4. 05 Chapter 4 — Understand LeWM in One Diagram available now

Part 2 — Turning Images into State: The LeWM Architecture

  1. 06 Chapter 5 — Trajectory Data: To the Model, the World Is Not an Image Collection available now
  2. 07 Chapter 6 — The Visual Encoder: Issuing a “State Passport” for Every Frame available now
  3. 08 Chapter 7 — The Dynamics Predictor: Moving Time Forward in the Mind available now
  4. 09 Chapter 8 — A Complete Forward Pass: Follow One Batch from Start to Finish available now

Part 3 — Preventing the Model from Cheating: Prediction Loss and SIGReg

  1. 10 Chapter 9 — The Most Dangerous Shortcut: Representation Collapse available now
  2. 11 Chapter 10 — Prediction Loss: How the Model Learns the Next Step available now
  3. 12 Chapter 11 — The Intuition Behind SIGReg: Letting Representation Space “Breathe” available now
  4. 13 Chapter 12 — Keep the Mathematics Minimal but Sufficient available now
  5. 14 Chapter 13 — The Original LeWM’s End-to-End Training Mechanism available now
  6. 15 Chapter 14 — Train a Model That Does Not Collapse Immediately available now

Part 4 — Putting the Model into Action: Planning in Latent Space

  1. 16 Chapter 15 — Goal-Conditioned Planning: From “Where Am I?” to “Where Do I Want to Go?” available now
  2. 17 Chapter 16 — Latent Euclidean Distance: Convenient, but Not Necessarily Reliable available now
  3. 18 Chapter 17 — CEM: Searching for Actions Through an Elimination Tournament available now
  4. 19 Chapter 18 — MPC: Do Not Trust the Model for Too Long at Once available now
  5. 20 Chapter 19 — Long-Horizon Rollouts: How Small Errors Snowball into Major Failures available now
  6. 21 Chapter 20 — Implement a Minimal LeWM Planner from Scratch available now

Part 5 — Engineering Reproduction: From Paper to Running System

  1. 22 Chapter 21 — The Official Repository and Experimental Environment available now
  2. 23 Chapter 22 — First Experiment: A TwoRoom Smoke Test available now
  3. 24 Chapter 23 — Second Experiment: Reproducing PushT available now
  4. 25 Chapter 24 — How to Evaluate a World Model Fairly available now
  5. 26 Chapter 25 — Failure-Diagnosis Manual available now

Part 6 — What Has LeWM Actually Learned?

  1. 27 Chapter 26 — Linear Probes: Which Physical Variables Are Encoded in the Latent State? available now
  2. 28 Chapter 27 — Give Latent Space a “Health Check” available now
  3. 29 Chapter 28 — Violation of Expectation: Is the Model Surprised by “Impossible Events”? Current lesson
  4. 30 Chapter 29 — How to Discuss “Understanding the World” Rigorously available now

Part 7 — Why “Accurate Prediction” Can Still Produce “Poor Planning”

  1. 31 Chapter 30 — The Gap Between the Training Objective and the Planning Objective available now
  2. 32 Chapter 31 — Global Non-Collapse Does Not Guarantee Preservation of Task-Relevant Dynamics available now
  3. 33 Chapter 32 — When Is an Isotropic Gaussian Prior Too Strong? available now
  4. 34 Chapter 33 — Long-Horizon Planning: Predict Farther or Plan More Intelligently? available now
  5. 35 Chapter 34 — From Positional Distance to Task Progress available now
  6. 36 Chapter 35 — Multi-Task Learning, Real Robots, and Visual Distractions available now
  7. 37 Chapter 36 — Theoretical Boundaries: When Can the True State Be Identified? available now

Part 8 — From Reproducer to Researcher

  1. 38 Chapter 37 — Design a Credible LeWM Improvement Experiment available now
  2. 39 Chapter 38 — Twelve Executable Research Projects available now
  3. 40 Chapter 39 — Open Questions in LeWM Research available now

Appendices

  1. 41 Appendix A — The Minimum Necessary Mathematical Toolkit available now
  2. 42 Appendix B — PyTorch Implementation Quick Reference available now
  3. 43 Appendix C — Complete Tensor-Shape Table available now
  4. 44 Appendix D — Experiment Configuration Cards available now
  5. 45 Appendix E — Paper Timeline and Evidence Levels available now
  6. 46 Appendix F — Glossary available now
  7. 47 Appendix G — Reproduction Checklist available now
  8. 48 Appendix H — Expert-Review Checklist available now

The big picture

  1. PredictWhat should arrive next?
  2. Change one thingColor, state, or support.
  3. Measure mismatchA spike is sensitivity, not a belief.
“Surprise” is a named prediction error, not proof that the model knows what is impossible.

Matched trajectories share history and actions, then branch into no change, color change, and teleportation.

A tiny story

A ball disappears behind a screen and appears across the stage. A child gasps; a motion detector also fires. Both responded, but only one response might involve a physical expectation.

A Violation-of-Expectation (VoE) test makes an expected continuation, intervenes, and measures prediction–observation mismatch. A larger teleport spike first means the tested event disagreed more with the model’s prediction. It does not yet mean the model knows teleportation is impossible.

The real rule

Use paired triplets with the same prehistory, actions, intervention time, and evaluation window:

  1. unperturbed continuation;
  2. appearance intervention;
  3. state discontinuity such as teleportation.

LeWM v3 reports this design in three environments:

  • TwoRoom: agent color change versus agent teleport;
  • PushT: block color change versus teleporting both agent and block;
  • OGBench-Cube: cube color change versus cube teleport.

PushT is visibly not a one-factor “color versus physics” test: the teleport branch changes two objects and their relation, while the color branch changes one object’s appearance.

The paper reports significantly higher surprise for teleportation across the three environments under a paired test with threshold below 0.01, while the main figure’s color effects are weaker and non-significant. The careful wording is: LeWM’s mismatch signal was more sensitive to these teleport interventions than to these color interventions under the authors’ protocol.

The frozen public repository does not contain enough VoE code to recover the authors’ exact reduction. A course implementation may define a tutorial scalar—the mean squared coordinate difference between predicted next latent and the frozen encoder’s latent for the actual next observation—but must label it tutorial diagnostic.

The trick that can fool us

A last-frame predictor copies the current latent forward and ignores actions. Ordinary slow motion gives modest error. Teleportation gives a large spike. A tiny color change gives a smaller spike. It passes the weakest ordering without learning contact dynamics.

Add controls that attack this explanation:

  • same actions after every branch;
  • overlapping image-change magnitude;
  • in-support fast motion and support-matched reset;
  • one-object and two-object interventions with matched displacement;
  • last-frame, stagnant-latent, action-shuffled, appearance-only, and persistence baselines.

Inspect the full time trace. A response before intervention suggests leakage or alignment error. A one-step spike followed by recovery differs from a lasting plateau, but neither diagnoses its own cause. New observations can re-anchor prediction; persistent error can mean unsupported reset or self-fed drift.

Pre-register intervention strengths, support bins, mismatch reduction, fixed-time or peak statistic, exclusion rules, and episode-level unit. Do not fit normalization after viewing teleport test spikes.

Experiment receipt

Archive the last clean history, action block, intervention frame, before/after observations, affected objects, simulator reset states, policy, random seed, checkpoint, attachment point, and aggregation rule. Keep dashed predicted latents distinct from solid encoded observations. A decoder image is a separate readout unless the protocol explicitly defines its error.

The later ACPC v1 gives the same action sequence to clean and visually perturbed histories and measures rollout divergence. It introduces Invariance Radius (IR) and Separation Rate (SR), with samplewise bounds connecting divergence to multi-step prediction error and—under a shared candidate pool—to planner-cost change. Its authors report trends on four tasks with three seeds per condition and public code 90d4276. The screen uses observed source-task success labels and tests one blur/resize severity; it does not show that selecting plans with ACPC improves control.

VoE supports perturbation sensitivity under a named protocol. It does not by itself prove object permanence, causal physics, human-like cognition, planner use, or generalization to unseen violations.

Quick check

  1. Which parts of a VoE triplet must be paired?
  2. Why is PushT color versus teleport not a single-factor physics test?
  3. Which simple baseline can also be “surprised” by teleportation?