Skip to content

Lab: Two Rooms

World models · 2026 · our experiment

Every page before this one reports somebody else’s results. This one is ours, and it is told in the order it happened, failures included.

Can a small world model learn a room just by watching it? And when the room changes, did it learn the rule (“walls block, gaps let you through”) or only the one room it saw?

The world is deliberately tiny. A dot moves in a square split by a wall with one door. The model never sees coordinates, only 32 × 32 pictures. It learns to predict the next picture’s code, not its pixels - the JEPA bet - and a planner then searches inside those codes for a route to a goal picture, as in LeWorldModel and PLDM.

We made a film of the first part of this story. Each clip below sits in the chapter it covers. The film was finished before chapters 4-6 happened, so those chapters are told in words and in the explainers.

"Inside the Two Rooms" (draft film), part A - why watch, the smallest world, and JEPA · 166s, companion clip.

The first model squeezes each picture into 32 numbers. Nobody told it where the dot is, yet two straight read-outs recover x and y from those numbers at R² 0.997: the code is a map of the room. Its prediction error spikes about twelvefold when the dot “jumps” through the wall, so it is surprised by the impossible.

"Inside the Two Rooms" (draft film), part B - the code becomes a map, and collapse · 164s, companion clip.

To plan, the model imagines 512 random push sequences inside its code, keeps the ones that end nearest the goal’s code, and refines them. In the first round 3% of imagined routes end in the goal room; by the sixth, all of them go through the door. With the door where it trained, it reached the goal in 14 of 24 cross-room trips.

"Inside the Two Rooms" (draft film), part C - where the wall lives, and planning by imagining · 107s, companion clip.

Move the door from the middle to the bottom. The model still sees the dot fine, but its predictor still expects the old door. Pushed right where the old door used to be, it imagines the dot reaching x = 0.63; the real dot stops at the wall, at 0.49. Planning falls to 7 of 24, and the planner drives straight at a door that is no longer there.

It is tempting to say the model “doesn’t know the door moved”. It sees the new door perfectly well. What it lacks is a rule for what doors do - it memorised one room.

"Inside the Two Rooms" (draft film), part D - surprise, the moved door, and learning from bumps · 151s, companion clip.

3. Fixes that filled the gaps, but never reached past them

Section titled “3. Fixes that filled the gaps, but never reached past them”

We tried the standard remedies, one at a time:

  • Many training doors. Doors between training examples started to work.
  • Longer imagined rollouts (24 steps instead of 8) roughly doubled planning, because the planner imagines 50 steps ahead and small errors compound.
  • Spreading the code within each clip, or an inverse-dynamics loss (recover the push from two codes) stopped a shortcut where the model tracked the door and dropped the dot: 10 trips became 117 to 135.
  • Telling the model the door height as a number did nothing. Trained on one door, that number never varies, so the model never learns what it means.
  • Bump, surprise, update. Let it wander the new room and fine-tune on its own prediction error. It learns the new door within a few hundred to a thousand steps - and forgets the old room unless it replays it.

The pattern held for every vector model: at doors 0.1 and 0.9, outside any training range, they reached only 1 to 6 of 24. Interpolating between examples is not the same as learning a rule.

"Inside the Two Rooms" (draft film), part E - door heights and the fixes that fill gaps · 119s, companion clip.

4. A model that learned the rule - and still could not plan

Section titled “4. A model that learned the rule - and still could not plan”

The fix that worked was a change of shape, not of training. A spatial model keeps a 16 × 16 grid of features and updates it with small 3 × 3 convolutions. Near the door, a cell only sees its neighbours, so the cheapest thing to learn is local: a wall cell blocks, a gap lets you through.

Trained on the middle door only, it predicted correctly whether the dot gets through at 89-100% of heights at every door from 0.1 to 0.9. It had learned the rule.

Then we asked it to plan: 7 of 216 trips. Worse than the model it was meant to replace.

5. The twist: the predictions were right; the sense of progress was wrong

Section titled “5. The twist: the predictions were right; the sense of progress was wrong”

A planner needs two separate things. It needs to know what happens after a push, and it needs a sense of progress - is this imagined future closer to the goal than that one? Ours measured progress as the distance between codes. A failure could come from either.

So we froze each model and changed only the measure of progress: match every imagined code to the nearest real picture, and score routes by the true walking distance to the goal, around the wall and through the door. Starts, goals and the planner’s random draws stayed the same.

Model (frozen) Its own code distance True walking distance
Ceiling (real simulator) - 216
Original spatial model 7 199
Vector model 59 87

Read it across. The spatial model’s predictions were right all along; with a correct measure it goes from 7 to 199. The vector model’s predictions are wrong at the far doors, so even a perfect measure only lifts it to 87. And the search itself was never the limit: with the real simulator, the same planner reaches all 216 goals.

Why was the spatial code so bad at measuring? It writes the dot as a tight spot in the grid. Once two spots stop overlapping, their codes are as far apart as they will ever get, so every frame but the last looks equally far from the goal. The planner had no slope to follow. Measured over the whole room, its code distance and the real distance were unrelated (rank correlation −0.003).

The cure was one extra line in the training loss, time-similarity: frames one push apart should get codes that are close. Think of a flip-book where each page is described by a list of numbers, and neighbouring pages must have neighbouring lists. A second rule stops the lazy answer (give every page the same list) by requiring the code to keep changing within each clip. Together they make the code move a little at every step, like marks on a ruler, so the distance between two codes starts to count pushes.

Inside the model, the dot’s spot widened into a patch; consecutive codes overlapped, and code distance began to fall frame by frame towards the goal. The correlation with real distance went from −0.003 to 0.87.

In its first training run, tested on door 0.5 only and then at all nine doors, the spatial model with time-similarity reached the goal in 193 of 216 trips (chapter 7 checks whether that was luck), including 16 of 24 at door 0.1 and 17 of 24 at door 0.9 - where every vector model managed 2 to 6. Its own code distance now did as well as the privileged walking distance (193 against 184, inside each other’s 95% ranges).

The idea is not new. Slow feature analysis (2002) and later video work rest on the same observation, and PLDM, a JEPA planner on this same task, drops from about 98% to 71% success without its time-similarity term. What this experiment adds is the diagnosis: in a spatial code, time-similarity is what turns correct predictions into a usable sense of progress.

One good run proves little. We retrained each model three times and re-planned at doors 0.1, 0.5 and 0.9 with three measures of progress, including an experience map that needs no labels: the model explores, links consecutive frames into a graph, and counts steps on it.

Trips reaching the goal out of 72 (24 per door). Each entry is one training run, with its 95% range in brackets.

ModelIts own code distanceTrue walking distance (privileged)Experience map (no labels)
Original spatial2 (1–10%), 2 (1–10%), 4 (2–13%)68 (87–98%), 71 (93–100%), 71 (93–100%)46 (52–74%), 46 (52–74%), 51 (59–80%)
Time-similarity62 (76–92%), 55 (65–85%), 47 (54–75%)55 (65–85%), 57 (68–87%), 49 (57–78%)43 (48–70%), 39 (43–65%), 40 (44–66%)
Vector16 (14–33%), 17 (15–35%), 14 (12–30%)29 (30–52%), 29 (30–52%), 28 (28–50%)26 (26–48%), 27 (27–49%), 24 (24–45%)
  1. The story holds in every run. The original spatial model plans well with walking distance and fails with its own code distance in all three runs (paired McNemar p < 0.0001).
  2. Time-similarity’s own measure stays as good as walking distance. The difference is not significant in any run (p = 0.12, 0.79, 0.69). Its predictions are a little less accurate than the original spatial model’s: a walking-distance mean of 54 against 70.
  3. The label-free map recovers most of the gap. It reaches about 48 of 72 for the spatial model, but stays below walking distance.
  4. The vector model’s predictions stay wrong at the far doors, whatever measure of progress it uses.
  5. Checks. A finer decoding grid changes nothing (67 vs 68, p = 1.0). Straight-line distance drops to 41, so knowing where the wall is matters.

The final headline: across 3 training runs, the one-door spatial model with time-similarity reached 47–62 of 72 trips at doors 0.1, 0.5 and 0.9 (24 of 24 at the training door every time, 11–19 of 24 at each far door).

  • One small toy world. Only the door’s height moved. Door widths, a shifted wall and two doors would test whether the model learned a rule about walls in general.
  • The cleanest diagnostic is privileged. True walking distance needs labelled pictures and the real layout; a robot would not have it. The label-free map is the first step towards removing that, and it does not yet match.
  • Wider patches may not be the whole story. A model forced to write wide patches without time-similarity would separate the two causes. Not run yet.
  • Small samples. Three runs per model and 72 trips per entry give each entry a 95% range of about ±11 percentage points mid-range. The same trained model also moved by about 5 trips between two evaluations with different start and goal pairs.
What it fixedA spatial JEPA trained on one door, with time-similarity in its loss, reached the goal in 47-62 of 72 trips across 3 training runs, including doors outside its training range where every vector model reached at most 6 of 24. The decisive finding: its predictions were right all along; what time-similarity fixed was its sense of progress.
What it still costsOne small toy world, three training runs per model, 24 trips per door. The strongest diagnostic (true walking distance) is privileged information a real robot would not have.

Each one is a complete interactive page from the experiment, placed inline on its page.

  • Two Rooms lab notebook - every experiment from scratch, with a door lab you can drive (chapters 1-4).
  • One push apart - what time-similarity is and why it made planning work, with real model data (chapters 5-6).
  • The planner’s path integral - Feynman’s sum over paths beside our sampling planner (how the search in chapter 1 works).
PaperLearning from Reward-Free Offline Data: A Case for Planning with Latent Dynamics Models (PLDM)Sobal, Zhang, Cho, Balestriero, Rudner, LeCun · 2025arXiv:2502.14819 →

The film ends by placing this experiment among the larger world models, and asking what a machine needs to learn one by watching:

"Inside the Two Rooms" (draft film), part F - the wider field, and what it all needs · 129s, companion clip.

Worth having first: LeWorldModel · JEPA

The code, logs and raw results live in the physicalAILabs project (jepa_two_rooms/video3/), which is not public yet.