The propagator
One layer, one linear solve
Each question is a graph from the search benchmark of Saparov et al., drawn as a map: every road is one edge, one way, from a town to the next. From the current town (dark), the layer must name the road toward the goal (rose ring). It sums the walks of every length at once, X = S (I − G)−1: the source S sits on the goal, the learned gates G weigh each step back along a road, and the weight of the walks that reach a town lights it. Trained on graphs of 49 vertices, it answered every test question at every lookahead on graphs of 250 vertices, in each of its three runs.
Playing the recorded run while the layer loads (300 KB).
Running the layer on this question…
lookahead 31, test question 1 of 1250 towns, 249 roadsrecorded run
Each bar a name’s logit, lowest to highest; names in order.
| name | logit | p |
|---|---|---|
| 219 | 8.05 | 0.99 |
| 203 | 3.50 | 0.01 |
| 48 | 0.57 | 6e-4 |
| 92 | -0.22 | 3e-4 |
| 1 | -1.33 | 8e-5 |
median gate walking a road back 0.97largest forward 3 × 10⁻⁵largest with no road 6 × 10⁻⁶
Click a town to make it the goal: the walks start from there, and the query token changes. Hover or tap a road to read its gates and find its tokens; drag the walks slider to add the walks one length at a time; rename the towns to give the layer the same question in other tokens.
In each of four channels the layer forms gates G and a source S from the normalised pair state, caps every row of G so that it sums to at most t0 = 0.99, and solves for the walk sum. The cap keeps the spectral radius below one on any graph, so the walk sum converges. The map shows the channel that carries the answer: its gates are near one on roads walked back and near zero on roads walked forward and between towns with no road. The layer has 28,472 parameters. This page runs the same forward pass in TypeScript, checked against the training code’s own outputs at 49, 125 and 250 towns to within 0.001.
Layer by layer
The depth law
Before one solve, depth. A pair state keeps a state for every pair of towns, and each layer sums over the two-step walks u → k → v through every middle town k. By the depth law (Theorem 1 of the paper), L such layers reach exactly 2L − 1 roads beyond the current town’s next town, lookahead 2L, for every L; trained pair states over names answer at least 95% at every lookahead up to 2L and fall just past it. The 8 layers here are the pair state over vertex names trained at 49 vertices (39,504 parameters).
The second model is the OR join: one pair layer, repeated, whose sum over the middle town is read through an OR, 1 − e−Z, so it says only whether some middle town connects a pair. Trained at 49 vertices and tested at 125, it answered at least 99.6% at every lookahead.
Playing a recorded run while the model loads (450 KB).
After layer 0 of 8 it would answer 45 (p = 0.76)
lookahead 6, test question 63 of 30025 towns, 24 roadstowns tinted by the current town’s read-out: rose above its average, cobalt below
Each bar a name’s probability; names in order.
| name | logit | p |
|---|---|---|
| 6 | – | 1.00 |
| 1 | – | 0 |
| 3 | – | 0 |
| 5 | – | 0 |
| 7 | – | 0 |
deeper rose, more probable; hover a cell to see its route
Click a town to make it the goal; drag from one town to another to build a road; click a road to close it. The model searches the new map from its start.
Recorded results
8 layers: which layer answers which depth
share of the test questions (12 per lookahead) the read-out gets right after each layer; this question outlined
After the start and the first three layers it answers only lookahead 1. Layer 5 answers most questions of lookahead 2 to 5, layer 6 most up to 7, layer 7 most up to 14, and layer 8 all of them: the depth it sees roughly doubles per layer, as the depth law says.
One layer, repeated: how far it sees
the longest lookahead it answers after each number of iterations, 99% or more of the test questions at every lookahead up to it
How it works
The map is only a drawing: no model sees it. Each reads the question as the benchmark writes it, a list of edges E u v, then Q start goal and the path so far, one token each. Tokens are pooled into the town names they write, each read with its two neighbours, and a state zuv of 16 numbers is kept for every ordered pair of names. With t the state normalised over its channels, each of the 8 layers is the summed pair layer
a route from u to k and a route from k to v make a route from u to v, so the length of route a pair can know about can double with each layer. The OR join replaces the sum, with no factor 1/√n, by
one matrix product per channel. Every name v is scored by w · norm(zcv) for the current town c; the table shows that read-out applied to every row, and the map tints each town by the current row. The 8 layers (39,504 parameters) answer all 300 exported test questions; the OR join has 24,896. This page runs both forward passes in plain TypeScript, checked against the training code: to within 0.001 in every logit for the 8 layers, to within 0.0001 after every iteration from 1 to 10 for the OR join, on maps of 49 and 125 towns. Each question’s map was laid out once, offline, with its own land; every road on it is an edge of the question.
The benchmark is Saparov et al., “Transformers Struggle to Learn to Search” (ICLR 2025): their generator, their test sets and their Transformer code. The paper states the depth law and the size law, the training runs, and where each layer falls short.