blog›looped transformers
What a 26B looped transformer actually does inside its loop
On this page
A regular transformer runs every token through its layers once, so an easy word and a hard one get the same compute. To give a model more steps, you usually stack more layers or let it write out chain-of-thought tokens.
A looped transformer runs its middle layers more than once per token, reusing the same weights each time. In November 2026 Thinking Machines released two 26.4B open-weight mixture-of-experts models with the same 24-layer layout: Inkling 2 Mini, trained to always run three passes, and TML-d24-varloop-research (varloop), trained with one to five passes (mostly three).
Goodfire published an early look inside Mini on release day, which made me want to open up both models myself: what happens if you run more passes than they trained for, what does each pass compute, and can the model decide when to stop?
- 01Mini cycles, varloop settles. Past three passes, Mini's perplexity waves up and down in a three-pass cycle (good at 3, 6, 9; broken in between). Varloop stays flat up to nine passes.
- 02Mini counts passes along one direction. Which pass it's on is stored in the message sent between passes, spread across hundreds of coordinates rather than a single slot.
- 03One vector controls Mini's depth. Subtracting it lets Mini stop at two passes (perplexity 18.0 → 11.1); adding it gives Mini a working fourth pass, lifting four-table lookup accuracy from 34% to 74%.
- 04Later passes re-read the prompt. Hide the lookup tables during passes 2 and 3 and two-table accuracy drops from 98% to 33%, worse than a single pass (91%).
- 05Confidence picks depth on puzzles, not text. Stopping varloop once it hits 95% confidence matches five-pass lookup accuracy in 2.9 passes on average. On ordinary text, it saves nothing.
How the loop is built
Both models split their 24 layers into four blocks of six. The first block (the prelude, layers 1–6) and the last block (the coda, layers 19–24) run once. The two middle blocks (blocks 2 and 3, layers 7–18) loop. Each layer has attention and 128 small experts, of which a router picks 8 per token.
PRELUDELAYERS 1–6RUNS ONCE
LOOPLAYERS 7–18RUNS THREE TIMES
CODALAYERS 19–24RUNS ONCE
24 LAYERS · HOVER TO SEE THE THREE PARTS AND THE FLOW
The diagram below walks through three passes of varloop on a three-table lookup puzzle: start with a word, look it up in Table 1, look that result up in Table 2, and look that up in Table 3, then give the final word straight away with no scratchpad.
Because the coda only needs the output of a single pass, you can run it early (after pass 1 or pass 2) to see what the model would answer if it stopped there. Goodfire calls this the coda-lens; I'll call the resulting prediction a read-out. For varloop, stopping after one to five passes is how it trained.
How a pass reads the one before
The simplest way to loop a transformer is a chain, where the output of pass 1 becomes the input of pass 2. That is how the Universal Transformer works. Mini and varloop do something different: every pass restarts from the prelude's output, and the previous pass's result is fed into each looped layer separately as a message. Since every pass runs the same weights on the same starting input, any difference between passes has to come from that message.
What is the message? Just two vectors per token: the outputs of block 2 and block 3 from the pass before. The message never crosses between tokens: token 40 in pass 2 only gets the message from token 40 in pass 1. Tokens still only talk to each other through attention and short convolutions inside a pass.
Inside each looped layer, the message enters at four spots: the queries, keys and values of attention, and the input to the experts. Each spot computes its own learned blend of block 2 and block 3, and a small gate mixes that blend into what the layer was about to read. Thinking Machines notes that the gates start closed in training, so a model begins by ignoring the message and has to learn to use it.
Goodfire reported that later passes rely mostly on block 3. Measuring the blend on 4,096 tokens of text in pass 3 confirms it: averaged over all twelve looped layers and four inputs, 69% of a read comes from block 3 in varloop and 80% in Mini. It varies by layer, though. In varloop, layers 13 to 18 take over 90% of their queries from block 3, while layers 8 to 11 take about half from block 2.
Because every pass starts over from the prelude, the message should be the only link between passes. I checked this by cutting all four gates in every looped layer and running three passes on 4,096 tokens of held-out text and 96 three-table lookup problems. Both models dropped back to their exact one-pass scores: varloop's perplexity rose from 10.05 to 10.78 and its lookup accuracy fell from 86% to 43%; Mini went from 9.83 to 23.64 and from 84% to 20%.
Running more passes than it trained for
Looping is interesting because compute becomes a runtime knob: two passes on an easy input, six on a hard one. That only works if a pass is a step the model can keep repeating, so I started by running both models past the pass counts they trained on.
Changing the count takes no new weights, just one number in a plain for loop:
start = prelude(tokens) # layers 1-6, once
message = None
for p in range(num_passes): # 3 in Mini; any number here
b2, b3 = loop(start, message) # layers 7-18, same weights every time
message = (b2, b3) # read by every layer of the next pass
logits = coda(b2, b3) # layers 19-24, once
I ran both models from one to nine passes on 32,768 tokens of WikiText-103, calling coda after each pass to measure perplexity.
Varloop settles: perplexity drops from 11.30 at pass 1 to 10.57 at pass 3, then stays between 10.55 and 10.62 all the way to pass 9, four passes beyond training.
Mini cycles in threes. Perplexity drops from 23.5 to 18.0 to 10.45 at pass 3, spikes back up to 15.2 at pass 4, settles to 11.0 at pass 6, and repeats through pass 9. In their release-day note, Goodfire spotted one huge outlier among block 3's 2,304 numbers: coordinate 2027. Layer 18, the last looped layer, pushes it way up in passes 1 and 2 (around +31) and pulls it down in pass 3 (−6). Switch the chart above to largest coordinate and it follows the exact same three-pass wave: back up at pass 4 and down again at pass 6.
Those high perplexities at passes 1 and 2 also mean Mini's early states aren't readable answers yet. On 40 simple one-word factual questions, Mini scores 7.5% after pass 1 versus 90% after pass 3. Whenever I track an answer pass by pass below, I use varloop.
Pass-specific experts in layer 18
Layer 18 isn't just flipping one outlier coordinate; it also swaps which experts it runs on each pass. Even though every pass shares the same weights, each token picks 8 of 128 experts, and Mini's layer 18 treats pass 3 completely differently from passes 1 and 2.
Expert 124 runs on 100% of tokens in passes 1 and 2, then drops to 0.2% in pass 3. Experts 87, 71 and 48 do the opposite: unused in passes 1 and 2, then taking 17–21% of tokens each in pass 3. Passes 4 to 6 repeat a softer version of the same swap. Overall, 50% of layer 18's expert choices change between passes 1 and 2, and 70% between passes 2 and 3 (compared to about 10% in layers 9–12). Varloop barely shifts at all: from pass 3 on, its layer-18 routing changes by only about 5% per pass.
Where Mini keeps count
A three-pass cycle means Mini knows which pass it is on. Yet pass 2 and pass 3 run the same weights on the same prelude output; only the message changes. Whatever tells layer 18 to pull coordinate 2027 down and switch experts on pass 3 has to sit inside that message. It can't be coordinate 2027 itself, because it enters pass 2 and pass 3 at almost the same value (+32.6 vs +30.1).
Finding the counter in the message
To find where the counter lives, I compared Mini's message after pass 1 with its message after pass 2 on 4,096 tokens, ranked which coordinates differed most, and tested swapping pieces of the message on 4,096 fresh tokens:
- Only block 3 matters. Giving pass 3 the block-3 output from pass 1 turns it back into pass 2 (perplexity jumps from 9.8 to 17.9). Swapping block 2 does nothing.
- It's spread across hundreds of coordinates. Swapping the 50 most pass-specific coordinates barely budges layer 18's experts. With 300, layer 18 falls back to its pass-2 expert on 84% of tokens; with 1,000, on all of them. Swapping 1,000 random coordinates, or the three largest, changes nothing.
- One constant vector is enough. Take the average block-3 message after pass 1 minus the average after pass 2 (about a fifth as long as block 3's output). Add that single vector to every token entering pass 3, and pass 3 acts like pass 2. Subtract it entering pass 2, and pass 2 acts like the final pass: coordinate 2027 drops, layer 18 switches experts, and two-pass perplexity falls from 18.6 to 10.5.
Mini keeps count along one direction in block 3's output. Measured along that direction, the average token steps down from +33 (pass 1) to −8 (pass 2) to −22 (pass 3), then resets to +4 at pass 4 and repeats. That reset is the three-pass wave.
Steering Mini's pass count
If that vector really is Mini's pass counter, we can use it to control how many passes Mini runs. Subtracting it before pass 2 tells Mini to wrap up early; adding it before pass 3 (and each extra pass until the last) delays that final-pass switch so the loop can keep going.
On the full 32,768-token WikiText set, steering flattens the wave: two-pass perplexity drops from 17.95 to 11.07 (close to 10.45 at pass 3), and passes 4 through 8 stay steady around 10.5 to 10.8 (a random vector at pass 4 gives 15.50). Most of the huge perplexity jump between passes 2 and 3 isn't extra computation; it's just Mini formatting its state so the coda can read it, which pass 2 can already do if given the signal.
Does an extra pass actually help on harder reasoning? I tested steered Mini on harder four- and five-table versions of the lookup puzzle (covered in detail next). On four tables, a steered fourth pass lifts Mini from 34% to 74%, well past varloop's 40% ceiling. On five tables, it climbs from 24% to 49% (vs 29% for varloop). Pushing further doesn't hold up: four-table accuracy dips to 65% at five passes and collapses to 14% at six.
The vector hardly depends on where you measure it. On 160 fresh four-table problems (where unedited Mini scores 44% at three passes), the original WikiText vector reaches 74%. A vector from different WikiText passages (cosine similarity 0.98) gets 73%, and one measured on lookup prompts themselves (cosine 0.77) still gets 73%. Scaling it down by half (33%) or doubling it (55%) hurts, and a random vector drops to 21%.
Prompt format matters more. When I rewrote the same task as a shuffled list of plain sentences instead of tables, the vector still prevented the pass-4 collapse (34% vs 9% unedited), but only matched Mini's three-pass score (35%). The big jump at pass 4 may be specific to the table layout.
What each pass actually computes
WikiText perplexity barely moves across passes in varloop (11.30 at pass 1 to 10.57 at pass 3), so ordinary text doesn't reveal much about what each pass is doing. To watch the work step by step, I scaled up the lookup puzzle from the opening diagram into a full version of Thinking Machines' N-hop lookup task: one to five tables of five rows each, a start word, and five answer choices. Random guessing gets 20%.
Table 2: fire -> bell · box -> cave · rock -> key · wind -> fish · olive -> hill
Table 3: cave -> wheat · bell -> crown · key -> honey · fish -> house · hill -> stone
Start with: road
Chain: Table 1, then Table 2, then Table 3
Options: wheat, crown, house, honey, stone
Reply with ONLY the single final word from Options after Answer:.
On three tables, varloop climbs smoothly from 44% at pass 1 to 92% at pass 5. Four tables stall at 40% (up from 17%), and five stay near guessing. Thinking Machines saw gains out to ten passes on their version; mine levels off around pass 4 or 5, and I can't tell how much of that is my prompt format.
Early misses are often one step short: on three-table problems, the intermediate word after two tables gets 17% of the model's probability after pass 1, falling to 6% after pass 2.
Which table is in the message
To see when each lookup lands in the message, I made pairs of three-table prompts (prompt A and prompt B) that differ in only one table, and therefore have different answers. I ran prompt A normally (five passes for varloop, three for Mini), except before one chosen pass I swapped in prompt B's message. If the answer flips to B's, later passes must have read that table's result from the message; if it stays on A's, they must have re-read the table from prompt A.
In varloop, tables enter the message in order. When table 1 changes, swapping the message before pass 2 flips only 4% of answers, jumping to 68% before pass 3 and 98% before pass 5. Table 2 lags a pass or two behind (0% before pass 2, 18% before pass 3, 47% before pass 4, and 100% before pass 5). Table 3 barely enters the message at all: even before pass 5, only 24% flip while 67% stay on A. The last lookup is redone from the prompt every time.
Look at the right-hand grid too: swapping the message only at the final answer token does almost nothing until late passes. Early intermediate results sit on earlier prompt tokens first, before moving to the answer token.
Later passes read the prompt again
It's tempting to picture pass 1 reading the prompt and later passes just thinking over the saved message. That table-3 result already hints otherwise. To test it directly, I let pass 1 read everything normally, then blocked the answer side from attending to the tables during passes 2 and 3 (blocking the task instructions instead as a control).
On two tables, varloop scores 91% in one pass and 98% in three. Hide the tables in passes 2 and 3 and accuracy crashes to 33%, far worse than a single pass, while hiding the instructions leaves it at 98%. Mini drops the same way (100% to 35%). Later passes don't keep an earlier answer and polish it; they re-solve the prompt using the message as a hint, and without the tables they fail.
Hiding one table at a time on three-table prompts confirms table 3 matters most: accuracy is 67% without table 1, 79% without table 2, and just 26% without table 3 (barely above guessing). Attention agrees: from pass 3 on, the answer token puts 4–5% of its attention on the needed rows in tables 2 and 3, up from about 1% in passes 1 and 2.
Knowing when to stop
Can varloop pick its own pass count per input, spending one pass on easy prompts and five on hard ones? After each pass, I tested three stopping rules: stop when read-out confidence (the top word's probability) is high enough, stop when block 3's output stops changing much, or stop when a linear probe trained on block 3 predicts the top word is final.
On lookup problems, plain confidence works well. Across a mix of one- to four-table puzzles, stopping at 95% confidence gets 84.4% accuracy in 2.9 passes on average, almost matching five fixed passes (84.8%) and beating three (81.2%). As the bars above show, it naturally spends 1.0 pass on one-table problems and 5.0 on four-table ones. Because the whole prompt stops together, those extra passes are genuinely skipped. Two caveats: each confidence check costs a run of the coda (about half a pass), and I picked the 95% threshold on these same problems. The probe and state-change rules both do worse.
On ordinary text, early stopping doesn't pay off. Even though 86% of tokens already have their final top-1 word after pass 1, the perplexity gains of later passes are spread thinly across almost every token. No rule beats a fixed pass count: matching three passes takes 3.5 passes with confidence. And this is only a read-out test anyway; really stopping one token early would leave later tokens nothing to attend to on the skipped passes.
Adaptive depth per problem already works with a simple confidence threshold; stopping token by token will take a better signal or a model trained to stop.
Which layers carry the loop
Finally, do passes 2 and 3 need all twelve looped layers? I let pass 1 run normally, then skipped one looped layer at a time during passes 2 and 3.
For text perplexity, only the very end of the loop stands out: skipping layer 18 adds +0.48 loss in Mini and +0.28 in varloop, while layers 7 to 16 cost 0.03 to 0.10 each. That matches Goodfire's finding that layer 18 writes the directions the next pass looks for.
For lookup, the important layers flip. Without layer 18, three-table accuracy barely moves (83% in Mini and 78% in varloop, from baselines of 84% and 86%). Without layer 7 it falls to 30% and 47%, and without layer 12 to 30% and 31%. The layers keeping text readable aren't the ones carrying lookups across passes.
The four message gates inside each layer also divide the work. Cutting the message going into attention values hurts lookup most (varloop drops from 86% to 35%), while cutting it from the experts hurts a four-step arithmetic chain most (89% to 53%, on prompts like a = 4, b = a + 3, c = b − 5). Plain factual recall (40 questions) doesn't budge under any edit: varloop already gets 90% on pass 1.
Conclusion
I came out of this more optimistic about looped transformers than I went in. Mini only ever trained with three passes, yet its pass counter sits along one direction, and pushing along that direction gives it a working fourth pass (34% to 74% on four-table lookups). Varloop stays stable well past the pass counts it trained on and builds a multi-step answer pass by pass. A simple confidence threshold on its read-out already spends fewer passes on easy lookups and more on hard ones.
Some caveats: the test sets are small (96 to 160 problems per task), the lookup prompts are my own, and stopping per token on ordinary text didn't work. What I'd like to see next is a model trained from the start to choose its own number of passes.
Appendix: setup
- Models:
thinkingmachines/Inkling-2-Miniandthinkingmachines/TML-d24-varloop-researchin Hugging Facetransformers(24 layers, width 2,304, 128 experts, 8 active). - Variable passes: a copy of the reference forward pass taking
num_passes, with the coda callable after any pass. Matches the library identically at three passes. - Prompts: chat template with thinking effort zero and reply started with
Answer:. Scored correct when the top-1 next token over the full vocabulary matches the target. - Message edits: applied once to the previous pass's pair of block outputs (before normalization), right before the twelve looped layers read them.
References
- Thinking Machines Lab. Introducing Inkling 2 Mini. November 2026.
- Lee, Krishnamurthy, Merullo, Balsam, Lubana. Interpreting Inkling 2 Mini. Goodfire, November 2026.
- Model weights: Inkling-2-Mini and TML-d24-varloop-research on Hugging Face.
- Dehghani, Gouws, Vinyals, Uszkoreit, Kaiser. Universal Transformers. 2018.
- Kimi Team. Attention Residuals. 2026.