Experiments 27

Guessing machinespart 4 of 5

Show Your Work

Two small transformers trained on the same five-cup shell game run in WebAssembly: one predicts the ball’s position in a single pass, while the other records the position after each swap. Swap cups to see where single-pass depth breaks down, edit a note on the tape, or run the same shuffle on Qwen3.5-4B.

Rust · Candle · WASM · llama.cpp · SSEView source 

The ball is under cup 3. Swap any two cups and try to lose the two machines watching.

Writes it down1 layerwaking up

Answers at once2 layerswaking up

Thinks in wordsQwen3.5-4Bnot asked

Tap two cups to swap them, or let it shuffle.

Tap a note to change what it wrote.

Swap some cups first, then ask the big one.

Its thinking will appear here as it writes it. Every cup number it writes can be tapped and changed, to see whether it notices.
After 10 swaps: Writes it down 100%, Answers at once with 2 layers 20%, Qwen3.5-4B at once 21%. Chance is 20%.
Answers at once getslayers100k numbers, against 51k for Writes it down

Every answer gets the same fixed amount of work: one pass through its layers. Each swap adds a little more to follow, so any fixed number of layers runs out. Writing the ball down after every swap turns one long problem into many one-swap problems, and one layer is enough for each.

Rounds
0
Writes it down
0
Answers at once
0
Notes on how it works

Notes

Single-pass vs. scratchpad

Both browser models are small transformers (width 64) trained on random shuffles of up to 60 swaps with Candle and compiled to WebAssembly. Answers at once (1, 2, 4 and 8 layers, up to 396k parameters; trained for 20,000 steps of 64 shuffles) must predict the ball’s position in a single forward pass. Writes it down (1 layer, 51k parameters; 3,000 steps of 64 shuffles) appends its predicted cup after each swap back into the token stream before reading the next swap.

Depth and S₅ permutations

Whereas 3- and 4-cup permutations form solvable groups that bounded-depth transformers can shortcut (Liu et al., 2023), tracking 5 cups computes the word problem on S₅, which is NC¹-complete by Barrington’s theorem (1989) and outside fixed-depth TC⁰ transformers unless intermediate states are written out (Merrill & Sabharwal, 2023, 2024). On 4,000 held-out shuffles per length, single-pass accuracy stays above 90% for 2 swaps with one, 4 with two, 8 with four and 23 with eight layers, whereas the 1-layer scratchpad model gets 100% through 60 swaps.

Intervening on the scratchpad

Editing a note on the tape tests whether the written state is causally used. On 1,000 shuffles with a single random note flipped, the 1-layer model’s final answer followed the edited trajectory 100% of the time. When the initial cup token was similarly altered in Qwen3.5-4B’s reasoning trace (20 runs of 6 swaps), the model checked the prompt and corrected the forged note in all 20 trials (emitting a self-correction after 20 of 20 edits vs. 11 unedited controls).

Qwen3.5-4B: single-pass and thinking

Qwen3.5-4B (32 layers, 4-bit quantized via llama.cpp) scores 57%, 40% and 34% at 1, 2, and 3 swaps with thinking disabled (comparable to the 60%, 40% and 30% baseline of always guessing the starting cup) and averages 20% across 10–60 swaps (chance is 20%). With chain-of-thought enabled, it expends ~60 words per swap and frequently continues re-verifying after first reaching the answer (4 swaps: first answer at word 323, hit the token cap at word 663, 8 swaps: first answer at word 436, stopped at word 798 and 12 swaps: first answer at word 480, stopped at word 495). The live probability bar probes the model after each reasoning line by closing the thought block, and Wait appends a continuation token after s1 (Muennighoff et al., 2025).

Sources