Understanding Looped Transformers with Sudoku
- Source
- wthrajat.com
- Author
- negativefactori
- Date

Context
A looped transformer runs some of its layers more than once for each token, with the same weights every time, instead of sending the token once up a stack in which every layer has its own weights. Understanding Looped Transformers with Sudoku is an interactive explainer posted to Hacker News by its author, negativefactori, and written after two labs released looped models within days of each other: Thinking Machines with Inkling 2 Mini and Z.ai with GLM-5.4. Its conclusion, built from those labs' published results and earlier papers, is that extra passes help with problems where each step depends on the one before and barely help with recalling facts, while every pass costs time and memory on every token.
The Sudoku answers the obvious objection that rerunning identical weights should produce the same result. A solver applying one fixed rule, such as writing in a number wherever only one fits, finds more on each scan because the previous scan filled in cells; the rule stays the same but the grid changes. A layer works the same way, since on its second pass it receives what the first pass produced. The writer's strongest evidence that looping pays comes from Samsung's Tiny Recursive Model, a two-layer network of about 5 million weights trained on 1,000 very hard puzzles. According to the paper the blog cites, raising its layer visits from 7 to 42 lifted its solve rate from 63% to 87% with no new weights, more visits than that did not help, and a four-layer version with fewer loops scored 80%. It is a Sudoku specialist, not a .
Inkling 2 Mini, as Thinking Machines describes it, stores 24 layers in four blocks of six. The first block runs once, the two middle blocks (layers 7 to 18) run three times in a row, and the last block runs once, so each token gets 48 layer visits from a file the size of a 24-layer model. Thinking Machines also released a research version of the same layout that can run one to five passes, and its results show the split the blog is about. Tests where each step builds on the last, such as following links through a long document, answering questions about very long documents, ARC-AGI-1 puzzles and DeepSWE coding-agent tasks, rose sharply, with DeepSWE going from almost nothing to 47% at three passes. Fact-recall tests such as SimpleQA barely moved. The writer notes that this version was fine-tuned at three passes, so its one-pass scores are lower than a model trained for one pass would get. Facts live in the weights, and citing other papers the writer puts the capacity at about 2 bits of knowledge per weight, looped or not, so a loop adds no room for them.
The costs are paid on every token. In the same research version, the reasoning text the model wrote on science questions it answered correctly at every pass count fell from 3,703 tokens at one pass to 1,731 at three, which the writer reads as the loop doing work the written reasoning used to do. Each of those tokens takes longer, though. vLLM measured a token at three passes taking about 2.5 times as long as at one on a single GB200 GPU, and the writer's claim that the two effects come out about even on such hardware is the writer's own arithmetic, not measured on a laptop. On a Mac, where speed is limited by how fast weights are read from memory, the middle layers are read again on every pass, so looping saves memory space but not memory reads. The shipped model also keeps a separate attention cache (the , its on earlier tokens) for each pass. By the writer's own calculation from the model's configuration, that doubles the memory a long chat needs, to about 32GiB at the full 1M-token , which would not fit beside the 20GB of weights on a 32GB Mac. Z.ai's second pass reuses most of its first pass's cache instead.
The pass count stays fixed mainly because of how GPU servers work. A server answers many requests at once by running each step for the whole batch together, so letting easy tokens stop early saves little if the batch still waits for the hardest one. The blog cites an open vLLM pull request for NVIDIA's looped Dory model in which a batch mixing one, two and three passes ran at the speed of one where every request got three. Variable counts would also need a separate prerecorded GPU sequence (a CUDA graph) for each pass count, and requests with different counts could not share saved work on a common prompt. Z.ai says it is working on variable passes for GLM; the writer judges a fixed count the right call for a model served on busy GPUs.
Training is where the evidence the blog gathers disagrees. Thinking Machines found its looped version beat a normal one at the same training compute, a 2026 paper using a different recipe found each extra pass worth less than half a fresh block of layers, and Z.ai says looped models trained from scratch still lose, which is why it taught an existing GLM-5 model to loop. The writer reads this as a recipe question that will not be settled until labs publish failures too, and expects looping to spread first among small models people run on their own machines, where fitting in memory matters more than speed, while treating GLM-5.4 as the test of whether it works for large cloud models. Those forecasts are the writer's judgment. The benchmark figures are the labs' and papers' own, relayed by the blog rather than reproduced by it.
- Large language model — A model trained on large amounts of data to process and generate language.
- KV cache — The memory a model keeps about text it has already read, so generating each new token doesn't require reprocessing the whole conversation.
- Stored work — What the process has written to storage: input files, output files, the progress note, and records held by destinations such as a board.
- Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.
Checking sign-in…
Loading comments…


