A 23-Megabyte World Model Just Out-Explored the LLM
We ran an experiment we expected to be embarrassing — for the small model. The task: two hundred actions to explore a real filesystem tree it had never seen. Thousands of directories. One budget. Find the interesting places.
One contestant was a language-model pipeline — a 12-billion-parameter vision-language model backed by a frontier reasoning model — reading every directory it touched and deciding, on the merits, where to go next. The other was a world model that fits in 23 megabytes, has never read a file in its life, and runs its encoder in milliseconds on a CPU.
The world model discovered almost three times the distinct territory the LLM-guided policy did. The LLM-guided policy did worse than picking directories at random.
Three directory trees, one of which nobody won. This post is the architecture, the numbers, and the weeks the model spent predicting nothing at all.
A synthetic treemap rendering of a directory: byte-sized boxes colored by content type, a glowing traversal path, white landmark rings on distinct regions, and one haloed needle box.
The contest
The setup is deliberately simple, because every claim in this post hangs on it.
An agent starts at the root of a real directory tree — we used three, ranging from 821 to 2,788 directories — and gets a budget of 200 actions. Each action observes the current directory and descends into one of its subdirectories (or backs out). At budget, we stop and score two things:
Coverage — how many distinct kinds of place the agent discovered. More on what a "kind of place" is in a moment; roughly, it's the number of structurally distinct regions the agent's map ends up containing.
Needle-reach — before each run, we identify target directories in the rarest content regions of the tree: the places blind search stumbles onto last. We count actions until the agent first reaches one, censored at 202 ("never found it").
Five policies ran the same protocol on the same trees:
| Policy | What drives it |
|---|---|
| Curious | world-model latents + a landmark map; go where novelty is highest |
| Predictive | the world model's forward predictions of where each descent leads |
| Random walk | uniform random descent |
| Breadth-first | classic systematic sweep |
| LLM-reading-only | a language model reads each directory and picks the most promising child — no world model at all |
The result, averaged across all three trees:
Coverage under a fixed budget: horizontal bars showing distinct landmarks discovered in 200 actions, mean of three real directory trees. Curious 38, predictive 27.3, random walk 25, breadth-first 21, LLM-reading-only 13.3. Lines show min–max across trees.
The curiosity policy covered roughly 1.5× what random search covered and almost 3× the LLM-only policy — which, at 13.3, landed below the random walk's 25. An alternate checkpoint pushes curious coverage to 48.3, but it scores worse on the surprise test you'll meet in a minute, so we report the checkpoint we actually promoted. We'll get to why the LLM lost — it's the most interesting part — but first, what is this small thing that won?
What a filesystem looks like to a model that can't read
The world model is a small JEPA-style architecture: an encoder maps an observation to a spatial latent — a 32-channel, 16×16 feature map — and an action-conditioned predictor rolls that latent forward: given where I am and what I do, what will I see next? Training happens entirely in latent space. There is no pixel-perfect reconstruction objective, no generative decoder in the loop — just "predict the representation of what happens next." It was originally built for something that has nothing to do with filesystems: abstract grid-puzzle games, in the family of ARC-AGI-3.
When we dissected it for generalization, we found the architecture had already made the decision for us. The predictor, the novelty signal, the planner — everything downstream — operates only on the latent. The single component that knows what a "grid" is, is the front door: the tokenizer that turns an observation into a small map of categorical IDs.
That suggests a protocol rather than a rewrite. We call it an observation adapter, and it is two functions:
token_grid(obs) -> [H × W] map of category IDs # what the encoder eats
cond(obs) -> optional context vector # a side-channel, fused in
The grid-game adapter is trivially the identity — the board already is a token grid. The filesystem adapter is more interesting: a directory becomes a treemap. Every child gets a box, sized by its real byte-footprint, colored by one of eight content categories — code, data, media, documents, models, logs, configuration, archives. Descending into a subdirectory is clicking on its box.
Architecture diagram: filesystem and grid-game adapters feed the same encoder across a dashed seam labeled "the only modality-locked component." The encoder's spatial latent feeds an action-conditioned predictor and a landmark memory, which drive the curiosity policy. A cached LLM reading enters as offline context, never in the action loop.
One detail turned out to be load-bearing, and it's the honest answer to "where does the intelligence live?" If a subdirectory renders as a flat, uniform "folder" block, then the parent's frame carries zero information about what's inside it — and (parent, click) → child stops being a learnable function. The forward model has no choice but to predict the average treemap, forever. The fix costs one extra cheap directory scan per child: color each subdirectory's box by its dominant content type, size it by its actual bytes. Now descent is decodable. It's the difference between a map and a mural.
Is that hand-engineered? The rendering is, absolutely — extensions to eight colors, bytes to areas. But note what the adapter does not contain: no notion of novelty, no value judgment, no policy, nothing that says what is interesting. Everything that decides where to go transferred unchanged from the game domain and operates on latents it cannot parse back into filenames. The lesson we'd defend in any domain: if your observation doesn't contain the information the transition depends on, no architecture downstream will recover it. Making the environment decodable is adapter work, and adapter work is cheap.
Dozens of kinds of place
The world model encodes one observation at a time. An explorer needs something that accumulates: where have I been, what is this place like, where does the unmapped territory start?
We gave it a landmark memory — an online, growing set of latent centroids, a growing self-organizing map. Encode a directory; if the latent lands near an existing landmark, merge into it (a kind of place I've seen). If it lands far from everything, add a new landmark (new territory). Three signals fall out for free:
- Novelty — distance to the nearest landmark. High novelty means unmapped. That's the frontier.
- Coverage — the rate at which new observations match existing landmarks. As it approaches 1, you're done exploring.
- Compactness — thousands of directories collapse into a few dozen kinds of place. Which is what a map is.
The curiosity policy is then one line: expand the frontier whose parent was most novel. Go deeper where the map says "this is unlike anything you've seen."
Now, an objection you should be raising: landmark count is measured in the agent's own representation. A model with a noisy encoder could shatter the space into "landmarks" and grade itself generously. That objection is exactly right, and it is why coverage alone passes nothing. Our gate demands the agent also win on needle-reach — an external task with planted ground truth the representation cannot game — and beat random on it. Coverage says the map is rich; needles say the map is about the actual world.
This memory, note, is environment-agnostic: it never sees a path or a filename, only latents. The same code would map a website, a codebase, or a camera feed. If that reminds you of place cells — a small structure quietly keeping track of where here is while the rest of the brain does its thinking — hold that thought for the end.
The needles
Needle-reach: median actions to first reach planted target directories. Curious 125, random walk 192, breadth-first, LLM-only, and predictive all censored at the 202 budget cap. Best tree: curious found all needles in a median of 30 actions. Hardest tree: every policy found nothing.
The needle protocol: plant targets in the statistically rarest content regions of each tree, run every policy, count actions to first contact.
Median across trees: the curiosity policy reached needles in 125 actions. The random walk took 192. Breadth-first search, the LLM-only policy, and the pure forward-model policy never reached them within budget at all — censored at 202.
On the best tree the result stops being subtle: curious found every planted needle, median 30 actions, reach rate 1.0 — against 0.25 for breadth-first and the LLM policy. Thirty moves to find the rarest places in an 821-directory tree it had never seen.
And on one tree, nobody won anything. A flat, homogeneous, media-dominated hierarchy: every policy — including ours — found zero needles. We think we know why: with no structural contrast between regions, there is no novelty gradient, and curiosity has nothing to climb. That's a hypothesis, not an excuse, and the problem is unsolved. We're keeping both results, because the second one is the price of believing the first.
Update, same day. The ledger below says the needles are self-planted, and self-planted benchmarks deserve audits. Ours got one within hours of publishing: pointing the system at a fourth, larger tree revealed that the needle rule could plant targets inside vendored toolchain directories — a bundled Python runtime's certificate store is "rare and deep" by the letter of the rule, but it isn't content, and nothing (agent or human) should be crawling there. We fixed the rule — vendor trees now classify as caches and can't hold needles — and re-ran the full three-tree protocol. The result got stronger, not weaker: curious reaches needles in a median of 84 actions (vs the 125 above), reach rate 0.50 vs 0.25 for random, coverage margin 1.43×, and the ablation sweep is unchanged — the world model still wins every column. The figures keep the original run, as published; this note is the audit trail.
The fourth tree also handed us the next problem on a plate: at matched budget its coverage passes easily (1.55× the best baseline), but its deepest legitimate needles defeat every policy. Reaching those needs content-seeking, not just curiosity — that's the next post.
Why the LLM lost
Let's be precise about the baseline before drawing any lesson from it, because it's the article's most quotable number and the easiest to misread.
The LLM-only policy was not a crippled prompt. It used a 12B vision-language model plus a frontier reasoning model; it read every directory it visited and chose the most promising child each time. And a fair concession up front: it shared the world model's action interface and observation cadence — no scratchpads, no tools, no multi-step planning harness. A stronger agentic scaffold with explicit memory would close some of the gap. But notice what building that scaffold would mean: re-implementing state. Which is our point.
Because what the LLM lacked wasn't intelligence. It was a spatial sense. It had no memory of where it had been in any geometric sense, no forward model, no frontier. It judged each room on its merits — brilliantly, for all we know — and kept walking back into rooms it had already understood, because interesting-looking and not-yet-seen are different properties and it could only perceive the first. Below random is exactly the score you'd expect: the random walk at least never lingers.
Semantic understanding is not a spatial sense. Reading tells you what a place is. A world model tells you where you are, what's nearby, and what you haven't seen yet. These are different organs.
Here's the twist, though: the winning system doesn't reject the language model. It demotes it. In the full architecture, an LLM reads each directory once, and its structured impression is distilled into a compact 16–32-dimensional vector that's fused into the encoder and predictor as context. The world model still never reads a file — it is handed a reading, the way your sense of direction is handed a road sign. In live mode, when the explorer meets a directory nobody has ever read, it asks the language model then and there, uses the verdict immediately, and writes it back to a shared cache. The corpus of readings grows as a side effect of exploration. Explore more, understand more, explore better.
One operational trap we hit so you don't have to: a model trained with context must be run with context. For a while our forward-model policy silently underperformed because inference skipped the reading vector the model had been trained to expect. Technically the same weights; actually a different model. Train/inference symmetry isn't a nicety — it's the difference between a working policy and a mystery.
Confession: the predictor was a mirror for weeks
You should not trust the numbers above yet, because for most of this project the model those numbers depend on did not work, and the story of why is the only reason to believe it works now.
The symptom: the forward predictor collapsed to identity. Whatever action you conditioned on, it predicted the world would not change. We threw three successively cleverer contrastive losses at it — make different actions produce different predictions — and the model gamed every one. It separated actions inside the decoder's null space, where differences don't render. It exploited the gap between soft predictions and hard decodes, keeping distributions apart while the argmax stayed identical. Repulsion says "be different," and in a high-dimensional latent space there are infinitely many useless ways to be different.
Then we stopped staring at the model and audited the data. The action parser had been silently returning class 0 for anything it couldn't parse — clicks with coordinates, resets, malformed entries. 82% of the training buffer had collapsed into one garbage bucket whose median transition changed almost nothing. Identity wasn't a failure to learn. It was the Bayes-optimal answer to the dataset we had actually built. The model was right; our data was lying.
The fix stack, in the order we'd apply it anywhere:
- Drop, never coerce. An unparseable action label is a dropped transition, not a default class. Silent coercion poisons everything downstream, and no loss curve will tell you.
- Inverse dynamics instead of repulsion. Demand that the displacement between latents identifies the action that caused it — a supervised target with no null space to hide in.
- Collect with a random policy. An agent's chosen actions correlate with the states it chose them in; that confound flatters the model. Uniform random exploration gives clean dynamics data, free.
- Freeze the encoder once it's good; let the dynamics gradient shape only the predictor.
- Condition on which world you're in. Action semantics are world-specific — a probe decoding actions from pooled multi-world data scored at chance, versus 0.895 within a single world. A world-blind dynamics model should predict "nothing changes," because that's the pooled truth.
Same architecture, before and after: the forward-model policy's coverage rises from 16.3 — below the blind-search band — to 27.3, above it, after fixing action labels and adding inverse dynamics.
The payoff was measurable in exactly the place it should be: the predictive policy — the one that plans by imagining where each descent leads — had always lost to blind search (16.3 against random's 25). After the label fix and inverse-dynamics retraining, it scored 27.3: the first time the forward model earned its keep in the real environment.
That episode calcified into doctrine: gates, not dashboards. A dashboard is a metric that goes up while you nod. A gate is a question with a no answer. Ours are three. Does the forward prediction beat "nothing changes" — else no planner built on it can work? Does the system beat strong blind baselines on task outcomes, by at least 1.15× on coverage and on external needle-reach, with an LLM-only ablation to prove the world model itself is doing the work? And the third gate is the one that still surprises us.
It knows when something is impossible
Developmental psychologists test infants with violation-of-expectation: show something physically impossible and measure the reaction. The world-model translation is clean. Surprise is prediction error — how far the observed next state lands from the predicted one, . Take real held-out transitions where the agent descends into a directory, then swap what it "observes" on arrival:
- Plausible — the actual child it clicked on.
- Sibling — a different directory of the same dominant type.
- Teleport — an unrelated directory from a distant subtree.
Violation of expectation: median surprise 3.4 for the real child, 4.7 for a same-type sibling (1.4×), 9.9 for an unrelated-subtree teleport (2.9×). The ordering is correct: structural impossibility is most surprising.
Median surprise: 3.4 for the real child, 4.7 for the sibling, 9.9 for the teleport. The ordering is exactly right, and the teleport gap is nearly 3×. The model has expectations about how this world is allowed to change, and it is measurably more offended by structural impossibility than by plausible substitution.
Beyond validation, there's an application hiding in that ordering: a real directory whose surprise lands in teleport range is a directory whose contents contradict its context — a place that shouldn't exist, flagged in milliseconds, continuously, by a model too small to be worth attacking. To be scrupulous: what we have is an ordering on three trees, not an ROC curve, and we have not benchmarked it as a security tool. It suggests an anomaly detector. It isn't one yet.
What this result is, and isn't
Claimed: a small world model plus a landmark map beat strong blind-search baselines and an LLM-reading-only ablation at budgeted exploration of real directory trees, and its surprise signal correctly orders impossible transitions above plausible ones.
Not claimed: that a world model is "better than an LLM." The claim is scoped to this task, this budget, these trees.
n = 3 trees. This is an existence proof and an architecture argument, not a benchmark victory. One tree defeated every policy, ours included — unsolved.
The needles are self-planted. We designed the benchmark (rarest-content regions), and it favors any policy sensitive to content statistics — in principle including the LLM's. Audited same-day: a flaw was found (vendored toolchain dirs could hold needles), fixed, and the re-run got stronger — see the update in "The needles."
The ablation is not the strongest possible LLM agent. It reads everything but carries no external memory or planning harness. Building that harness would be re-implementing state — which is the thesis, but a head-to-head against a full agentic stack hasn't been run.
Generalization is one adapter deep, demonstrated once — grid puzzles to filesystems. Code and weights are not released; the protocol above (budgets, needle rule, gate thresholds, censoring) is described precisely enough to reimplement.
Update 2, same day — what is the map worth in tokens? The obvious application is the coding agent that greps: every hit list and wrong-file read lands in the model's context window and is paid for on every turn after. So we measured it. Eighteen human-verified "where does X live" questions on our own monorepo; the baseline is a mechanically-simulated grep agent (ripgrep, gitignore-aware, ingesting output until the target file surfaces — no LLM, fully reproducible); a retrieval miss pays its query plus the full grep fallback, so nothing is flattered. Baseline: 188,925 tokens to localize all eighteen. Map-first: 39% saved at a 4/18 hit rate — because when the map hits, localization costs ~145 tokens instead of up to 35,095. Adding our code-graph index as a parallel lane (its hits are different questions — the lanes are complementary) reaches 45% saved at 7/18. And both indexes are currently running handicapped: keyword-only ranking on the map, zero embeddings on the code graph. Per-hit savings are ~99%, so saved-percent ≈ hit rate; the ceiling is high and the levers are known. Bonus the world model brings for free: surprise-driven re-indexing — it can tell which directories changed meaningfully and re-read only those.
A spatial sense under the cortex
We've argued before that language models are missing organs — all cortex, no nervous system. This result puts flesh on one specific organ. The LLM is a cortex: brilliant, articulate, and stateless between glances. What we built underneath it is something closer to a hippocampus — place memory, a forward model, a felt sense of where haven't I been and that shouldn't be here. The cortex was not replaced. It was consulted: one reading per directory, distilled to thirty-two numbers, cached forever. The frontier model thinks occasionally; the spatial sense runs continuously — 23 megabytes, milliseconds per step, on a CPU. The cortex is a consultant. The map never sleeps.
And the filesystem was never the point. It was the test range — real, cheap, endless, instantly verifiable, and designed by nobody as a benchmark. The entire result came through one adapter: a token grid, an optional context vector, nothing else changed. A shell session has states and actions. An API has states and actions. A codebase mid-refactor has states and actions. Each is one adapter away — and we know exactly what an adapter costs now, because we've written two: a decodable observation, one cheap peek's worth of per-child information, and an embedding that says which world you're in.
Twenty-three megabytes isn't the impressive part. The impressive part is that the next world this model learns won't require touching anything behind the front door.
Update 3, same day — the head-to-head we said was the next post
Two threads from the honesty ledger closed themselves within hours, so here they are.
We built the content-seeker. The failed root — deep, legitimate targets that curiosity couldn't reach — motivated a second policy we call the prospector: instead of "go where it's most novel," it goes where rare purposes concentrate, reading the same cheap directory signal the map already has (what kind of place is this, and does it look like there's more of the scarce stuff deeper). It's still the same 23 MB world model; only the frontier-scoring changed. On the fair three-tree benchmark it beat plain curiosity outright: needle-reach median 67 actions vs 84, reach rate 0.67 vs 0.50 — and it beats every blind baseline by more than the gate demands. Deep-needle reach on the hardest tree is still open; content-seeking narrowed the gap, it didn't close it.
Then we gave the LLM its best shot. The ledger conceded that our LLM-only baseline wasn't the strongest possible agent. So we ran the strongest one we could: Microsoft's FastContext — a 4-billion-parameter model trained specifically to explore repositories — on the exact same task, same budget, one call per step, served on a second GPU. This is not the naive "read each directory" baseline from earlier; it is a purpose-built code-exploration model an order of magnitude larger than everything else in the field.
It did well — far better than the naive LLM policy (reach 82 vs 143), and on the easiest tree it matched the world model. And across the three trees, it still lost:
| Policy | Reach (median actions, ↓) | Reach rate (↑) | Coverage (↑) |
|---|---|---|---|
| Prospector — 23 MB world model | 67 | 0.67 | 32.3 |
| FastContext — 4B trained repo-explorer | 82 | 0.46 | 23.7 |
| Curious — 23 MB world model | 84 | 0.50 | 31.0 |
| Random walk | 133 | 0.25 | 21.7 |
| LLM-reading-only (the naive baseline) | 143 | 0.17 | 12.7 |
A model 170 times larger, trained for exactly this job, reached the rare targets in more actions and found fewer of them. That's the whole thesis with the strongest possible opponent on the other side of the table: at the task of knowing where you are and where you haven't been, a spatial sense beats a bigger cortex — even a cortex built to explore. The 23 megabytes still isn't the impressive part. This is.
Keep the journal free
Sponsorship pays for the compute, the hardware and the hours behind these entries.
by email
New journal entries, in your inbox.
What the agents built, broke and fixed. One message per entry.