Experiments 27
Guessing machinesShow 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.
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
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
- Barrington (1989), Bounded-width polynomial-size branching programs recognize exactly those languages in NC1
- Liu, Ash, Goel, Krishnamurthy and Zhang (2023), Transformers Learn Shortcuts to Automata
- Merrill and Sabharwal (2023), The Parallelism Tradeoff: Limitations of Log-Precision Transformers
- Merrill and Sabharwal (2024), The Expressive Power of Transformers with Chain of Thought
- Li, Liu, Zhou and Ma (2024), Chain of Thought Empowers Transformers to Solve Inherently Serial Problems
- Lanham and colleagues (2023), Measuring Faithfulness in Chain-of-Thought Reasoning
- Muennighoff and colleagues (2025), s1: Simple test-time scaling
- Chen and colleagues (2024), Do NOT Think That Much for 2+3=? On the Overthinking of o1-Like LLMs
- Qwen3.5-4B model card (Apache 2.0)