induction-tab

Looking for your GPU

This network has never seen text, only random characters, and while you watch, on your own GPU, it will work out that things repeat.

Press a head to silence it. Silence all of layer 0 or all of layer 1 and copying dies.

0.0 seconds

Try another seed.

Each seed starts from different weights. On an M4 Pro, seeds 1 to 64 reached the event between step 400 and step 700.

The benchmark trains seeds 1 to 5 back to back with the page held still, then gives you a log you can submit.

What you just watched

The lower row is the upper row again. Nothing else in that sequence can be predicted, because every character was drawn at random. So there is exactly one thing to learn, and for the first few hundred steps the model has not learned it.

Then it does, quickly. The light in the lower row is the model becoming sure of characters it has seen once, in a sequence it was never trained on. It saw only sequences like this one, random characters repeating at random intervals. It has no idea what English is. Type a repeating pattern into the third row and it continues yours too.

What an induction head is

Say the model has just read an x in the second pass.
This x was seen before, and a Q came right after it. So it says Q.

It finds where this character came before, reads what followed and says that. This takes two heads, one stacked on the other. A head in layer 0 reads the previous character, so every position also carries what came just before it. A head in layer 1 then asks, at each position, where was the previous character the same as mine? It attends there and copies what it finds.

You can see both in the maps. Each row of a map is a position reading and each column a position being read, so the empty upper right is the future, which no head may read. The previous-character head draws a line just under the main diagonal. The induction head draws a parallel line 63 positions below it, in the lower half, because the earlier copy of a character is 64 back and the thing to read is one after that.

In the run saved with this page, seed 1 at step 3000, one head in layer 0 has a previous-character score of 0.98 and the four heads in layer 1 have prefix-matching scores from 0.87 to 0.94. This is the circuit Olsson et al. described in 2022. With one layer there is nothing beneath the head to say what came before each position.

The circuit is also why it stumbles, because it matches on the previous character only. Look at the last column of the lower row, which stays dark. The 4 before it appears three times in the first pass, followed by Z, U and b, and on seed 1 at step 3000 the model says Z at nearly 100%. The first column stays dark for a simpler reason: the b before it has never been seen.

Prompts go the same way. Where every character has one possible successor it is clean, so abcabcabcabcab gives cabcabc. After 1800 steps, the quick brown fox. the quick br gave ox. brox. quick. Read that one character at a time and every step is a real pair from the prompt: o was followed by x, and a space was followed by b. By step 3000 on seed 1 it gets that prompt right, own fox. the quick brown, and it still misses the 4 above.

Why this is a phase change

On the first pass through a random sequence the best possible loss is chance, ln 96 = 4.56 nats, however long you train. Copy advantage is the first-pass loss minus the second-pass loss, and it does not measure copying alone. A model that expects repeats guesses wrong on characters it has not seen, so its first-pass loss climbs above chance. On the tab's model at the event, over 64 seeds, the first pass is 5.23 against chance at 4.56, the second pass is 3.01, the advantage is 2.23, and a median 30 percent of that advantage is the first pass rising above chance.

In the saved run the advantage creeps up to 0.33 by step 350, reaches 1.73 by step 425 and stays above 2 from step 475. The remaining 2500 steps take it to 4.59, which is more than ln 96 for the same reason. At step 3000 the first pass is 4.73 and the second is 0.14, so the second pass is close to perfect and the first sits above chance.

The event and the precursor come from Gunner Howe, arXiv 2609.19000, and the event's definition stays Howe's. The event is copy advantage at or above 2 nats on two consecutive evals, reported at the second. The precursor is the first time a first-layer head reaches a previous-character score of 0.10. The head scores themselves come from Olsson et al. 2022, and the prefix-matching score is the induction head's own signature.

What correct means here

The trainer is raw WGSL. The forward pass, the backward pass and AdamW are written by hand, with no ML library underneath. npm run parity checks the gradient of every parameter tensor against PyTorch autograd on five configurations, including the tab's, and on an M4 Pro the worst relative L2 is about 1.1e-6, 1.12e-6 in the stored run. It varies slightly between runs.

The stronger test is a whole run. Started from the same weights on the same batches, one on the M4 Pro's GPU and the other in PyTorch on a CPU, the tab's model reaches the event at the same step and the precursor at the same step on 64 of 64 seeds, compared at evals 25 steps apart. Their copy advantage differs by 6.5e-5 at worst, and 1328 of 1336 evals differ by under 1e-5. The study's smaller model matches on 64 of 64 seeds too, worst difference 3.2e-6.

All 64 seeds of the tab's model fire, at a median of step 475 and a range of 400 to 700, with no stalls by step 3000.

It is not faster than native, and it needs nothing installed. On the M4 Pro this trainer takes 10.3 ms per step on the tab's model, PyTorch takes 5.5 on the same GPU through MPS, and 13.9 on the CPU with 8 threads. The trainer's figure is with drawing off, and so is the benchmark's median of 4.9 s to the event over seeds 1 to 5. A run you watch also draws. With another job on the GPU, in headless Chrome, the page with drawing on read a median of 8.7 s, and 5.8 s on each seed's fastest round. We have no reading on an idle GPU, so the cost of drawing is unmeasured.

Run at Gunner Howe's own configuration, far larger than the tab's, with Howe's language, precursor and event, seed 1 of this trainer reached the event at step 6225, inside the range Howe reports for 30 seeds, 5650 to 7400. The precursor fired at 0.847 of that time, near the median of 0.844 computed from Howe's repository. That is one seed, so it is one draw and nothing more. A rerun takes 24 minutes a seed.

The tab's model reads an alphabet of 96 tokens, printable ASCII and one token that never renders, with 128 characters of context, width 128, 4 heads, 2 layers and batch 16. It trains only on uniform random characters made periodic.

What did not work

Gunner Howe's curriculum does not fit a tab at this size. The tab's own model on Howe's language and clone rule fired on 0 of 8 seeds by step 8000, where its own curriculum fires by step 700 on all 64. We stopped at 8000, so this does not say it never would.

Two negative controls on the tab's model showed no event in 6000 steps, on 8 seeds each. One layer has no head beneath it to read the previous character, and its copy advantage peaked at 0.913. A model that never sees a repeat has nothing to copy, and its copy advantage peaked at 0.029.

Prior work

Other browser demos train induction heads live, including TheoremPath's lab and gama's Induction, both on the CPU or without a stated GPU backend. This one runs on the viewer's GPU in hand-written WGSL, keeps MLPs and LayerNorm, and streams previous-token and induction scores with head ablation on one page. We did not find that combination within our search coverage.

This stands on other people's work. Sequence Toy and Piston by Vin Howe train sequence models in the browser on WebGPU. TabGPT and webgpu-llm write their training kernels by hand in WGSL. Little Language Machine trains a small transformer client-side. The circuit and the head scores are from Olsson et al. 2022, In-context Learning and Induction Heads. The event, the precursor's threshold and fraction, and the transition are from Gunner Howe 2026, arXiv 2609.19000. Reddy 2023, Singh et al. 2024 and Aoyama et al. 2025 studied what sets the formation of these heads, on other setups, and Aoyama et al. found that how often and how reliably bigrams repeat strongly affects whether they form. Zucchet et al. 2025, arXiv 2505.17863, found that repetition can greatly speed up the emergence of sparse attention, in theory and on an in-context associative recall task, the same direction as the repeat rule below.

Records

Median seconds to the event with drawing off, over seeds 1 to 5, one row per machine.