Inside LeWM's Two Rooms
World models · 2026 · LeWorldModel
We took the published LeWM checkpoint for AnyGoal’s two-room world and asked what its latent space knows about the room. It plans well to goals in the same room, but with its own L2 latent distance it reached a goal in the other room in 0 of 5 runs. A distance learned on its own exploration data, used with a planner that looks only 5 steps ahead, reached it in 4 of 5.
What LeWM learned about the two rooms
LeWM is a JEPA world model. It squeezes every 224 × 224 frame into a vector of 192 numbers and learns to predict the next vector from an action. It never sees coordinates. Here we put the agent on every free spot of the room, read the vectors back out, and ask what kind of map is hiding in them.
Does a world model that only sees pixels learn a usable map?
The task. A dot-shaped agent lives in two rooms joined by a doorway in the middle wall. It is given a picture of a goal and must move there. In the AnyGoal benchmark the goal is where the agent will be 25 steps further along a route, and every route stays inside one room. Even so, LeWM gets there on only 48–60% of tries (3 seeds × 50 trips), while a model that plans from true coordinates gets 100%.
How LeWM plans. It turns the current picture and the goal picture into vectors. It imagines where many candidate action sequences would take it, and picks the one whose imagined final vector is closest to the goal's vector. So planning only works if the vector space behaves like a map: it must know where the agent is, measure distance the way the agent has to walk, and predict how actions move it.
What this page does. We put the agent on every free spot of the room, look at the vectors LeWM produces, and test those three things one at a time:
- Does the vector hold the agent's position? (sections 1 and 2)
- Does distance between vectors match walking distance around the wall? (section 3)
- Does the predictor move the vector the way real actions move the agent? (section 4)
Short answer: yes to position; distance only over short walks, so trips through the doorway fail; and yes to prediction, though the benchmark's planner scales actions differently from training. A learned distance plus a shorter look-ahead gets the frozen model through the doorway (How it finally crossed). None of these yet explains why LeWM misses half of the benchmark's same-room trips.
From a start to a goal: imagine, pick, step, repeat
LeWM only gets two pictures: where the agent is now, and what the room looks like with the agent at the goal. It never gets coordinates. Every 5 steps it runs the same loop:
- Encode the current picture and the goal picture into vectors.
- Imagine 300 random 25-step action plans with the predictor (faint lines).
- Pick the plans whose imagined end vector is closest to the goal's vector, and refine them 30 times.
- Step: take the first 5 actions of the best plan for real, then start again.
Watch the far trip. The agent walks straight toward the goal and stops against the wall, at the spot that is closest to the goal as the crow flies. From there every imagined plan ends further away in latent space, because the vector distance does not know a wall is in the way, so it never finds the door. It did this in all 5 runs. Even the trip next to the door, only 30 px away through the doorway, worked once in 5; in the other runs the agent drifted away to the far left wall. Same-room trips worked in 19 of 20 runs. The action scaling made no visible difference on any trip. The sections below show why: the latent space knows where the agent is, but its distances only make sense over short walks. How it finally crossed shows the fix: the same frozen model, with a learned distance and a shorter look-ahead, reaches the far goal in 4 of 5 runs. The benchmark never asks for a trip like this (its routes stay in one room), so the wall does not explain LeWM's 48–60% there; that gap is still open.
The planner is random, so each trip was run with several seeds; the counts under the controls say how often it worked. Here it replans every 5 steps and gets up to 100 steps (the benchmark allows 50). Four hand-picked trips show how it behaves; they are not a success rate.
Keep the model, change the ruler, look less far ahead
LeWM itself stays frozen. Two things around it change. First, the planner's ruler: instead of squared distance between vectors, a small network reads two LeWM vectors and predicts how many steps it takes to walk from one to the other. Second, the look-ahead: the planner imagines 5 steps instead of 25.
- Explore. 240 self-generated episodes, 72,000 frames, 236 real trips through the doorway. The test data had none, so nothing in it showed that the rooms connect.
- Label. Count steps along shortest paths over transitions that really happened, plus merges of near-identical frames. No imagined moves, so no shortcuts through the wall.
- Learn the ruler. A small network maps (vector now, goal vector) to steps-to-goal. Only LeWM's frozen vectors go in.
- Plan with it. The planner's cost becomes the predicted steps from the imagined end to the goal, with the old distance kept only to break ties.
The learned map bends around the wall: spots just left of it, a straight line away from the goal, are coloured far, because walking there means going round through the doorway.
The twist: the new ruler alone was not enough. Looking 25 steps ahead with the learned ruler still got 0 of 5 far trips. From the stuck spot against the wall, the predictor imagines that moving right carries the agent through the wall and up into the other room, and the learned ruler scores that imagined end as close to the goal. The real agent pushes into the wall, does not move, replans the same plan, and stays stuck. Over just 5 steps the predictor's imagination stays close to what really happens, so it has little room to imagine a way through the wall, while the learned ruler supplies the long-range sense of direction. The short look-ahead alone does not do it either: with the old ruler and 5 steps, even the same-room trip fails every time.
Nearby in latent space means nearby in the room, but only up close
Each dot on the left is one agent position, colored by where it is. The right panel shows the same dots placed by the first principal components of their latent vectors. Hover or touch a spot: its nearest neighbours in latent space light up in the room.
The top components each explain only a few percent of the variance, so no flat 2-D picture captures the room. The map lives spread across many of the 192 dimensions. The neighbour view is the fairer test. For a typical spot, its 25 nearest latent neighbours lie a median 9 px away in the room; 25 random spots would lie about 105 px away. About one spot in ten has neighbours scattered much wider.
A straight line through the latent space recovers x and y
We fit a linear map from the 192 numbers to (x, y) on the rendered grid, then test it on frames from the real test set, which it never saw.
The position is all there and linearly readable. That is the precondition for planning: if the vector did not carry position, no cost on it could steer the agent.
The planner's distance does not see the wall
Planning picks actions whose imagined final vector is closest to the goal's vector, using squared distance. Click any spot to make it the goal. Left: that latent distance from every other spot. Right: the true walking distance around the wall. Both are colored by rank, so if they agreed the two maps would look the same.
Within a short walk the two agree reasonably well. Across the room they barely agree, and latent distance tracks walking distance no better than straight-line distance, so the doorway leaves no mark. A planner looking 25 steps ahead works mostly inside the zone where the two still agree.
The predictor tracks the agent, if it is fed actions on the right scale
Start from one real frame, feed the real actions, and let the predictor imagine 5 steps of 5 actions each. Read each imagined vector back to a position with the linear map and compare with where the agent really went.
A scaling mismatch. Before the predictor sees an action, it is standardised. LeWM was trained with its training set's statistics. The AnyGoal planner standardises with the test set's statistics instead, which for the route test have a y-mean of and a spread near . Fed that way, the predictor is worse than assuming the agent stands still for the first few steps and only slightly better by step 25. With the scaling that best fits its one-step predictions (mean 0, spread 0.9, our estimate of the training statistics), it stays within about after 25 steps.
We have not yet re-run planning with the corrected scaling, so we do not know how much of LeWM's 48–60% success it costs.
What the latent space holds
- Position, precisely. A linear read-out recovers where the agent is to within a few pixels on real test frames.
- Local geometry, not global. Latent distance tracks real distance over short walks and loses it across the room. The wall and doorway do not shape the distance.
- Usable dynamics. With actions scaled as in training, imagined positions stay close to the real path for 25 steps; scaled the planner's way, the predictor barely moves.
- Crossing needs a better ruler and a short look-ahead. A distance learned from real exploration (steps to reach the goal) bends around the wall; with it and a 5-step look-ahead, the frozen model reached the far room in 4 of 5 runs. With 25 steps it still failed, because over that range the predictor imagines walking through the wall.
- Still open. Why LeWM misses about half of the benchmark's same-room trips. The crossing fix has not been tried on the benchmark.
Background: LeWorldModel