TWIN ARC-AGI-3
Test-time World-model INference

To beat a game it has never seen, the agent writes the game: 93.3 on ARC-AGI-3.

The loop

Think for free, then spend one checked move.

Write the twin, replay it against every frame ever seen, search it for a route: all free. Only the executor costs, and it stops at the first wrong prediction.

The TWIN loop: observe, write the twin, validate, explore, plan, and checked execution, split into a free zone and a scored zone
One lap, drawn with real boards from an ft09 run. Left of the boundary is free; the executor on the right is the only thing that ever costs. Click to open full size.

tap to open full size

Phase 1 Build a perfect twin free · 2.60B tokens of thinking · 7.1% of scored moves spent as probes
1
Watch, then act
first move of the run
real runPROBE ACTION2 → "changed no playfield cell; falsifies the hypothesis, the bar is a move budget"ls20 · actions.jsonl
2
Record the transition
1,282 logged before level 7 · sk48
real run{"prev":…,"action":"ACTION6:26,42","next":…} · 447 lines, oldest first, never editedtn36 · transitions.jsonl
3
Rewrite the twin
grows 7,009 → 7,533 lines · sk48
real run"the corner pixel changes only on the first interaction" → model.py edited → validate: []ka59 · agent.log
4
Validate against all historyvalidate
caught wrong_cells: 33 at step 1,281, repaired before acting · sk48
real runvalidate: [{'i':83,'action':'ACTION3','wrong_cells':1}] → {"ok":false,"error":"model does not validate"}ka59 · agent.log
5
Find the twin's worst mistakeexplore
“twin MISPREDICTS color 2 under ACTION1 (1/211)” · sk48
real runau.gaps: "MISPREDICTS color 12 under ACTION2 (5/5), 2 differing effects → SPLIT the rule" score 2.6wa30 · agent.log
6
Probe once, or repair for freeexplore
sk48 needed 0 probes; lf52 needed 14
real runvalidate: [{'i':138,'action':'ACTION4','wrong_cells':72}] → repaired from the log, no move spentka59 · agent.log
↻ repeat 1–6 until the twin replays every logged transition exactly
Phase 2 Spend moves to win scored · 92.9% of moves execute pre-validated plans · 79.4% predicted cell-exactly
7
Plan inside the twinplan
a 122-action route simulated before one real move
real runau.plan → ['ACTION1','ACTION4','ACTION4','ACTION4','ACTION1'] · shortest route, 0 scored moves to find itls20 · agent.log
8
Execute, one checked moveplan
steps 481–485 missed → halted → repaired → resumed at 486
real run"guard caught the first mismatch at move 8, 200 changed cells → halt, log, relearn"sk48 · agent.log
✓ level boundary → cleared → edit the twin for the next level
◌ plan completes, no boundary → that goal guess is retired for good
✗ any mismatch → counterexample → back to Phase 1, step 3
TWIN algorithm

The whole player, in 28 lines.

freescored
1(T̂, R̂) ← identity twin; D ← ∅ ▸ per game
2for each level do
3 while level not complete and budget remains do
4 s ← Perceive() ▸ read the real grid
5 while Validate(T̂, D) returns gaps do
6 g ← Top(Explore(s, D)) ▸ dynamics wall
7 T̂ ← Repair(T̂, g)
8 end while
9 p ← Plan(s, T̂, R̂) ▸ BFS inside the twin
10 if p = None then
11 c ← Top(Explore(s, D)) ▸ goal wall
12 R̂ ← ProposeGoal(c) ▸ tentative
13 while R̂(sᵢ) = 1 for some logged frame sᵢ do
14 c ← next candidate; R̂ ← ProposeGoal(c) ▸ consistency check, free
15 end while
16 p ← Plan(s, T̂, R̂) ▸ cheapest test of R̂
17 end if
18 if p = None then
19 p ← [ Probe(s, D) ] ▸ one informative move
20 end if
scored21 o ← ExecuteChecked(p) ▸ halt on mismatch, log to D
22 if o is a level boundary then
23 R̂ ← UpdateGoal(o, D) ▸ first positive label
24 else if o reaches c with no boundary then
25 RejectCandidate(c) ▸ permanently exclude this non-goal
26 end if
27 end while
28end for
line 4Look at the board

Read the current frame: 64×64 cells, 16 colours.

lines 5–8 · the gate loopFix the physics until the past replays

Replay the twin over everything that ever happened. While one cell disagrees, Explore names the worst rule and Repair rewrites it. You never act on a twin that argues with history.

line 9Dream a route

Breadth-first search inside the validated twin for the shortest path to a state the learned goal accepts. Thousands of imagined futures, zero scored moves.

lines 10–17 · the goal wallInvent a destination, then check it against history

Twin is right but no route exists? Then the missing piece is the goal. Scout the twin for reachable candidates, and discard any predicate that would already have fired on a logged frame: a goal you supposedly reached without winning is no goal. That check is free.

lines 18–20Buy one fact

No plan and no candidate? Fall back to a single probe aimed at what the log cannot tell you.

line 21 · the only scored linePlay the plan, stop at the first surprise

Submit the route one move at a time, each against a committed prediction. The first frame that disagrees halts the plan and enters the log as a counterexample, sending you back to line 5.

lines 22–26Real goal, or retire it

A level boundary is the first positive label and sharpens the goal. Reached the imagined goal and nothing happened? That candidate is permanently excluded.

invariant 1 · the gateNo scored action on a twin that contradicts the past.

Every submitted action is preceded by au.validate == []. A mismatched move enters the log, so the next submission fails validation until the twin is repaired. You cannot run a plan through a mistake.

invariant 2 · the equivalence queryEvery real move is a free experiment.

A plan either completes, or hands you one clean counterexample for a move you were spending anyway. Repairs scale with the number of rules, not the number of screens.

The artifact

The agent's real output is a game engine.

model.py: a game engine for a game nobody gave it the rules to.

model.py
seeded as an identity stub, grown from counterexamples during play. Full files ship with the run artifacts: golden/runs/codex/<env>/.../model.py

Executable-copy scorecard

games pixel-perfect
transitions replayed exactly
11,562
of 11,614 actions: prediction hashed before the game answered · the 52 without are RESETsmodel_receipts.jsonl · wa30 verified 723/723
Generalization

Where the copy and the engine disagree.

Each final twin was replayed against the real engine on actions the agent never took.

First-seen pairs79%predicted exactly, never seen before
Untaken actions68.6%exact-frame agreement · 19,583 branches
First goal guess87.2%correct before any reward · 156 of 179
Error is local517of 4,096 cells hold 90% of the median game's error
online next-state prediction accuracy over the run for all 25 games
The twin learning each game live: share of the last 10 next-frame predictions, hashed before each move, that matched the game exactly. Dotted line: the 79.4% campaign mean.
Per level

Every level, rendered by model.py.

step() chained on its own output, server untouched.

How to read a level card

26/71h TWIN actions vs the human baseline. Green: at or under human pace.

eff 1.00 the efficiency term, cap 1.00; the game score weights these by level.

the bar share of the level's transitions the twin replays cell-exactly.

The scored budget

What the agent spends its actions on.

All 11,614 scored actions, one row per game, time left to right.

every scored action of all 25 runs, one row per game: blue validated plan steps, amber probes, red counterexamples
Blue a validated plan step that predicted correctly, amber a deliberate probe, red a plan step whose prediction failed and became a counterexample. Probes are 7.1% of the budget; the other 92.9% execute plans already tested in the twin. The arrow marks where ar25 learned its mirror rule: after it, the row is almost solid blue.
Results · same games, four players

The world model, not the base model, plays the game.

The benchmark’s action-efficiency score. Human pace = 100.

TWIN actions divided by human actions for each of the 23 cleared games
Actions relative to a first-time human, on the 23 cleared games. Twenty-one finish in fewer actions than the human; tn36 and ka59 do not. Per level: 158 of 179 beat human pace.
Per game
full clear partial zero
Cost

Same games. A fraction of the tokens.

Score against thinking spent. Reasoning, code and simulation are free to the metric, not to the bill.

full per-game table
Leaderboard

Where the field stands.

Agent systems on the ARC-AGI-3 public set. Click an entry for its source.

Standings as of July 31, 2026.