24 layers, 48 layer runs
Inkling 2 Mini is a 26.4B-parameter mixture-of-experts model that Thinking Machines Lab released on November 20, 2026 under Apache 2.0 (Thinking Machines Lab, 2026b, 2026a). It fits in about 20 GB, runs on a 32 GB laptop, and scores roughly in line with other models of its size on coding benchmarks. What makes it unusual is how a token moves through it: the model stores 24 transformer layers, but every token goes through 48 layer applications. The middle 12 layers run three times in a row, reusing the same weights each time.
Repeating layers isn’t new—Universal Transformers did it with a single shared layer (Dehghani et al., 2019), and recent work showed that looping a handful of layers can buy reasoning depth without adding parameters (Geiping et al., 2025; Saunshi et al., 2025). Inkling 2 Mini is the first looped model trained at this scale with public weights, a Hugging Face implementation (Hugging Face, 2026a, 2026b), and an interpretability study from Goodfire (Lee et al., 2026), which makes it possible to inspect how the loop actually works.
The layout: prelude, looped core, coda
The 24 layers are grouped into four blocks of six. Each layer is an attention sublayer followed by a mixture-of-experts (MoE) sublayer. In each block, five layers use sliding-window attention over the last 1,024 tokens, and one layer uses full attention over the whole context (Hugging Face, 2026b).
| Block | Layers (1-indexed) | Runs | Role |
|---|---|---|---|
| 1, the prelude | 1–6 | once | turns token embeddings into internal representations |
| 2 and 3, the core | 7–18 | three times, shared weights | the looped part |
| 4, the coda | 19–24 | once | turns the result back toward the output vocabulary |
That gives layer applications per token. Each application keeps its own key-value cache, so the cache has 48 entries even though there are only 24 sets of weights (Hugging Face, 2026a).
Every pass restarts from the prelude
You might expect layer 18’s output to feed directly back into layer 7. Instead, every pass through the core starts again from the output of the prelude (Thinking Machines Lab, 2026b). On passes 2 and 3, each core layer also reads a gated summary of the previous pass—what Thinking Machines calls the message.
Rather than stacking three passes in a chain, the model makes three attempts from the same starting point, with each attempt able to peek at notes left by the previous one. Geiping et al. (2025) use a similar trick, re-injecting the prelude output at every recurrent step.
Thinking Machines loops the middle rather than the end because the first and last layers mostly translate between token embeddings and internal representations, while the middle layers do the more abstract work (Thinking Machines Lab, 2026b). At equal training compute with three passes, looping the middle 12 layers beat looping the last 12 on 27 of 28 evaluations (more on those numbers below).
Other architecture numbers (from config.json)
| Field | Value |
|---|---|
| Total / active parameters | 26.4B / 3.4B per token (5.4B effective with three passes) |
| Hidden size | 2,304 |
| Attention | 24 query heads, 8 KV heads (GQA), head dimension 128 |
| Local / global layers | 20 sliding-window (1,024 tokens) / 4 full attention (layers 6, 12, 18, 24 in 1-indexed terms) |
| Position information | learned relative-position bias per head (d_rel = 16, rel_extent = 1024); no RoPE in the main model |
| MoE | 128 experts, 8 per token, no shared expert, expert width 1,152, sigmoid router |
| Loop | core_start 6, core_end 18, num_passes 3, gate_rank 64, fixed loop count |
| Context | 1,048,576 tokens |
| Vocabulary | 200,058 tokens (padded to 201,024) |
| Extras | vision encoder (23 layers, width 1,024); a 3-layer speculative-decoding drafter (“DSpark”) |
Training started with 384 experts per layer. Two thirds were pruned mid-training, keeping the 128 most used, and the model was then healed with 1T tokens of distillation from a larger internal model (Thinking Machines Lab, 2026b).
Attention residuals: each layer picks its own input
Before looking at the cross-loop message, we need one architectural piece that isn’t specific to looping: attention residuals (Kimi Team, 2026).
In a standard transformer every sublayer adds its output to one running sum, the residual stream, and the next sublayer reads that sum. Every earlier layer contributes with weight one, forever. Attention residuals replace this fixed sum with a learned choice: a sublayer looks back at earlier outputs and decides, with softmax attention over depth, how much of each to use.
Inkling 2 Mini uses the block version. Within a block the outputs are still summed as usual. Across blocks, each sublayer attends over whole block sums. I follow Goodfire’s notation (Lee et al., 2026). Write for the sum of everything block has written, with the normalized token embedding (treated as “block 0”), and for the RMS-normalized version. A sublayer with its own learned query forms its input as
and receives . The sources are the embedding, the blocks that are already complete, and the running sum of the current block up to this point.
This lets a deep layer pull directly from the embedding or prelude instead of fishing it out of a sum polluted by every intervening layer. Crucially for the loop, the weights are learned per sublayer: Goodfire counts 56 depth-wise readers in the model, each with its own query (Lee et al., 2026).
With a plain residual stream, the only way to “restart from the prelude” would be to throw away the core’s output. With attention residuals it is natural: on each pass the core layers simply attend over the embedding, the prelude block, and the blocks of the current pass. What the previous pass computed has to come in through a separate path, and that path is the message.
The message: how passes talk to each other
On pass , every core layer gets a second input besides its own depth-wise mix : a message built from the two core blocks of the previous pass, and . Then a gate decides how to combine the two.
Step 1: read the previous pass
The message is another attention over depth, this time over the previous pass’s two core blocks, with its own learned query (Lee et al., 2026):
In fact each core layer has four of these readers, one each for the attention query, key and value inputs and one for the MoE input, each with its own . That is cross-loop readers. The Hugging Face blog describes the same thing as separate messages mixed into the query, key, value and MoE paths (Hugging Face, 2026b).
Step 2: the keep-and-gain gate
The gate looks at both inputs through a small bottleneck of size 64 (the gate_rank in the config) and produces two vectors, a keep and a gain (Lee et al., 2026):
Each of the 2,304 dimensions gets its own keep value in and gain value in . Keep can damp or amplify the current input, and gain can add or subtract the message. And because both are computed from and themselves, the mix changes from token to token.
The gate starts closed
At initialization, the gate blocks the message completely (), so the model starts training as if it weren’t looped at all and only opens the gate as the message becomes useful (Thinking Machines Lab, 2026b). Neither source specifies the exact initial values of , , and .
Because is a weighted sum of block writes, Goodfire splits each trained gate’s output into exact shares from the current pass () versus the previous pass () to trace cross-loop flow (Lee et al., 2026)—though much of their interpretation is still tentative.
Two loose ends in the published equations
- One message or four? Goodfire’s main text writes a single message, while the appendix defines four per-reader messages and still writes the gate with a single . It is not stated which (or which combination) enters the gate’s bottleneck.
- Reader counts. Goodfire counts 56 depth-wise readers, “31 for attention sublayers, 24 for MoE sublayers, and 1 before the final output layer”. With 24 attention sublayers, the 31 is not explained.
Neither changes the picture above, but anyone re-implementing the model should read the Transformers code (Hugging Face, 2026a) rather than rely on the prose.
Testing the message gate on an A100#
To check how much the cross-pass gates matter in practice, I hooked all 48 Inkling2LoopMessageGate modules in layers 6–17 on an A100-80GB and ran ablations on a 60-prompt probe (15 prompts each for factual recall, arithmetic, logic, and short Python traces; the prompts and hook scripts are in scripts/experiments/).
| Condition | Top-1 Acc (60 prompts) | Mean P(correct) | Entropy | Notes |
|---|---|---|---|---|
| Full 3× (both bridges on) | 93.3% (56/60) | 85.4% | 0.77 bits | Default 3-pass model |
| No forget gate (additive only) | 83.3% (50/60) | 80.7% | 0.82 bits | Math and code hold; state updates break |
| Cut pass 1→2 bridge only | 53.3% (32/60) | 46.4% | 2.43 bits | Matches 2-pass accuracy and entropy |
| Cut pass 2→3 bridge only | 40.0% (24/60) | 25.6% | 3.69 bits | Resets pass 3 to single-pass behavior |
| Cut both bridges | 40.0% (24/60) | 25.6% | 3.69 bits | Same prob/entropy as 1× (1-prompt tiebreak vs. 23/60) |
Cutting the bridge between passes 2 and 3 puts the model back to single-pass behavior, because pass 3 then restarts from the prelude with nothing from the earlier passes. In the single-pass run below, accuracy is 38.3% (23/60) rather than 40.0% (24/60) due to a one-token tiebreak on a single factual prompt; mean answer probability (25.6%) and entropy (3.69 bits) are identical across both runs.
The gates open widest at the start of each core block—layer 6 and layer 12—and open wider on pass 3 than on pass 2 across every layer. Turning off only the forget gate leaves arithmetic and Python tracing mostly intact, but breaks state-updating prompts: the coin-swap prompt stops at C instead of B, and the light-switch prompt stays at OFF instead of ON.
What looping costs
Looping saves parameters, not compute: every pass is a real forward pass through 12 layers.
Parameters and compute
Inkling 2 Mini has 26.4B parameters in total and activates 3.4B of them per token on a single trip through the network. Thinking Machines counts 5.4B weight activations per token once the loop is included: each extra pass through the core adds about 1.0B (Thinking Machines Lab, 2026b, 2026a). That puts the core at roughly 1.0B active parameters per pass, and the prelude, coda, attention and embeddings at the remaining 2.4B.
Relative to running those same 24 layers once, the looped model does about the work per token with the exact same weights—keeping weight memory around 20 GB so it fits on a laptop, at the cost of slower generation.
The KV cache: 192 KiB per token, but only at first
The cache is where looping has a less obvious effect. Each of the 48 layer applications keeps its own keys and values (Hugging Face, 2026a). With 8 KV heads of dimension 128, one layer application stores
so 48 applications cost 192 KiB per token, the figure in Raschka’s architecture card (Raschka, 2026).
But that only holds for short contexts. 40 of the 48 applications are sliding-window layers, which only ever need the last 1,024 tokens. Only the full-attention layers keep growing with the context: one in the prelude, two per pass in the core, one in the coda, so 8 growing applications with three passes. Beyond 1,024 tokens the cache grows at KiB per token. At the full 1M-token context that is about 32 GiB for the global layers plus a fixed 160 MiB for the windows.
Looping doubles this long-context cost compared with the same 24 layers run once (4 global layers, 16 GiB at 1M tokens). The local/global split is what keeps it manageable at all: if all 48 applications attended to the full context, 1M tokens would need 192 GiB.
The 1.0B-per-pass figure comes from the model card. The KV numbers are my own arithmetic from config.json (8 KV heads, head dimension 128, 1,024-token window, global layers at positions 6, 12, 18 and 24) and the fact that each layer application has its own cache. Quantized caches would shrink them proportionally. Thinking Machines does not publish a memory breakdown.
Measured on an A100: latency, KV cache, and early exit#
I checked the memory arithmetic above directly on an A100-80GB in BF16 eager PyTorch (49.2 GB weights in VRAM, compared to 19.53 GB on disk in NVFP4/MXFP8), measuring prefill time, decode speed, and exact DynamicCache size across context lengths up to 8,192 tokens (benchmark script).
| Context | Passes (Layers) | Prefill | Decode (A100 BF16) | KV + Conv Cache |
|---|---|---|---|---|
| 512 | 1× / 2× / 3× (24 / 36 / 48L) | 155 / 309 / 343 ms | 13.0 / 7.9 / 5.6 tok/s | 50.2 / 75.4 / 100.5 MB |
| 2,048 | 1× / 2× / 3× (24 / 36 / 48L) | 387 / 576 / 792 ms | 13.1 / 7.8 / 5.7 tok/s | 112.3 / 168.4 / 224.6 MB |
| 8,192 | 1× / 2× / 3× (24 / 36 / 48L) | 3,267 / 5,284 / 6,644 ms | 13.3 / 8.0 / 5.7 tok/s | 208.3 / 312.4 / 416.6 MB |
Running three passes doubles the KV cache compared to a single pass and makes eager decoding about 2.3× slower. Because 20 of the 24 physical layers cap at the 1,024-token sliding window, only the 8 global attention passes grow linearly with context—adding 32 MB per 1K tokens at three passes, which keeps 128K context near 4.2 GB of KV cache.
I also tested skipping pass 3 whenever pass 2’s top-1 probability crossed a threshold τ. At τ = 0.90, one in five prompts exited early with no drop in accuracy on this 60-prompt set, saving 5.6% decode latency. Lower thresholds saved more time but ran into prompts where pass 2 was already over 80% confident in the wrong shortcut before pass 3 corrected it.
Does looping pay off?
All numbers below come from Thinking Machines’ release post (Thinking Machines Lab, 2026b). Keep in mind these are self-reported results, mostly on internal or held-out evals, and the 28 benchmarks in the middle-versus-end comparison aren’t named.
Loop the middle, not the end
In a controlled comparison at training step 2,000, both models used three passes and the same training compute. One looped the middle 12 layers (7–18), the other the last 12 (13–24). Thinking Machines then asked how much more compute a non-looped model would need to match each one’s loss:
- looping the middle: 1.51× to 1.91× the compute,
- looping the end: 1.24× to 1.36×,
where each range spans the lowest and highest estimate over three evaluations. Downstream, the middle loop gave larger accuracy gains on 27 of 28 evaluations.
At larger scale, on their predictive scaling ladder, an unpruned looped model was compared with an unpruned non-looped one. The non-looped model was 7.5% cheaper to train, but its scaling law predicts it would need over 1.5× the looped model’s training compute to reach the same held-out loss.
More passes, shorter reasoning
Inkling 2 Mini always runs exactly three passes. To test how pass count affects reasoning, Thinking Machines trained a separate research checkpoint, TML-d24-varloop-research, on 1 to 5 passes (mostly 3) (Hugging Face, 2026a; Thinking Machines Lab, 2026b).
On GPQA Diamond questions the research model answers correctly at every pass count, its mean chain of thought drops from 3,703 tokens at 1 pass to 1,731 at 3 and 1,661 at 5. An uncertainty score counting words like “wait”, “actually”, and “hmm” drops from 9.7 to 3.9 to 3.6 while legibility stays flat—part of the thinking moves from visible tokens into the loop. Accuracy at a fixed reasoning budget improves up to three passes and then levels off (on a no-chain-of-thought time-horizon task, human-equivalent task length rises from about 16 seconds at 1 pass to 37 seconds at 3, then flattens), though on a synthetic multi-hop lookup task accuracy keeps climbing out to 10 passes—well past what it was trained on.
What looping does not help
Across tasks, extra passes help most on long-context benchmarks (GraphWalks BFS, MRCR v2), followed by math, abstract and visual reasoning (ARC-AGI, HLE-Diamond), and long-horizon agentic tasks (DeepSWE, BrowseComp). Closed-book factual benchmarks—AA-Omniscience, SimpleQA Verified, SimpleVQA, and WorldVQA—stay essentially flat (Thinking Machines Lab, 2026b).
That makes sense: facts live in the weights, and looping adds no weights. Extra passes only give the model more computation over information it already has—which helps reasoning and long-context retrieval, not memorization.
Watching the model change its mind across loops (1×, 2×, 3×, 4×)#
In Hugging Face’s Inkling2LoopTextModel, the number of loop passes is controlled by text_config.loop_num_passes. I ran the 60-prompt probe at 1, 2, 3, and 4 passes on an A100-80GB to see how predictions change after each pass (prompts and script). Note that this is a small sample—15 prompts per category, so one prompt moves a category score by 6.7 points.
| Category (15 each) | 1× (24L) | 2× (36L) | 3× Native (48L) | 4× Extrap. (60L) |
|---|---|---|---|---|
| Factual recall | 60.0% (9/15) | 80.0% (12/15) | 93.3% (14/15) | 66.7% (10/15) |
| Arithmetic | 33.3% (5/15) | 53.3% (8/15) | 93.3% (14/15) | 66.7% (10/15) |
| Logic & state tracking | 33.3% (5/15) | 40.0% (6/15) | 86.7% (13/15) | 66.7% (10/15) |
| Code execution | 26.7% (4/15) | 40.0% (6/15) | 100.0% (15/15) | 66.7% (10/15) |
| Overall (60 prompts) | 38.3% (23/60) | 53.3% (32/60) | 93.3% (56/60) | 66.7% (40/60) |
| Mean P(correct) / Entropy | 25.6% / 3.69b | 46.4% / 2.43b | 85.4% / 0.77b | 46.7% / 2.97b |
Most of the multi-step answers only came out right on the third pass, with 34 of the 60 prompts flipping from wrong at pass 1 to right at pass 3. A fourth pass made things worse across every category (each happened to land on 10/15 on this small probe), so the model seems trained to stop at exactly three passes rather than keep improving with extra loops.
Below are three individual prompts from the run, animated from their next-token probabilities after each pass:
How MoE routing shifts across passes#
Each looped layer routes every token to 8 of 128 MoE experts, and the same router runs on all three passes. I hooked every Inkling2LoopTopKRouter across layers 6–17 on 24 prompts to see whether tokens reuse the same experts on each pass (routing script).
The experts change from pass to pass, and they change most on pass 3. By the last core layer (layer 17), almost half of the experts fire mainly on the third pass. Pass 3 seems to bring in its own group of experts to finish the answer.
| Routing Metric (Layers 6–17) | Value |
|---|---|
| Shared experts on answer token (Pass 1 ↔ Pass 2) | 5.22 / 8 (random baseline: 0.50) |
| Shared experts on answer token (Pass 2 ↔ Pass 3) | 4.60 / 8 |
| Shared experts on answer token (Pass 1 ↔ Pass 3) | 3.84 / 8 (1.67 / 8 at layer 17) |
| Pass-1 / Pass-2 / Pass-3 specialists (≥60% in one pass, of 1,536) | 45 / 32 / 142 (58 at layer 17) |
What’s still open
A few big questions are still unanswered. No published ablation separates how much of the gain comes from the cross-loop message versus simply repeating the layers, or how much attention residuals pull their own weight. The released checkpoint is also locked to three passes, even though Thinking Machines’ variable-loop research model suggests the pass count could become an inference-time dial. And while the scaling-ladder numbers look encouraging, Inkling 2 Mini is still a single data point at 26B parameters.
The nice part is that the weights, code, and config are all open—and small enough to run locally—so those ablations and per-layer gate inspections don’t have to wait for another lab release.
- Dehghani, M., Gouws, S., Vinyals, O., Uszkoreit, J., & Kaiser, Ł. (2019). Universal Transformers. International Conference on Learning Representations (ICLR).
- Geiping, J., McLeish, S., Jain, N., Kirchenbauer, J., Singh, S., Bartoldson, B. R., Kailkhura, B., Bhatele, A., & Goldstein, T. (2025). Scaling up Test-Time Compute with Latent Reasoning: A Recurrent Depth Approach. arXiv Preprint arXiv:2502.05171. back: 1, 2
- Hugging Face. (2026a). Inkling 2 Mini (inkling2_loop) model documentation. https://huggingface.co/docs/transformers/en/model_doc/inkling2_loop back: 1, 2, 3, 4, 5
- Hugging Face. (2026b). Welcome Inkling 2 Mini, Cutting-edge Performance for your Local Setup. https://huggingface.co/blog/inkling2mini back: 1, 2, 3
- Kimi Team. (2026). Attention Residuals. arXiv Preprint arXiv:2603.15031. https://arxiv.org/abs/2603.15031
- Lee, Krishnamurthy, Merullo, Balsam, & Lubana. (2026). Interpreting Inkling 2 Mini. https://www.goodfire.com/research/interpreting-inkling-2-mini back: 1, 2, 3, 4, 5, 6
- Raschka, S. (2026). LLM Architecture Gallery: Inkling 2 Mini. https://sebastianraschka.com/llm-architecture-gallery/
- Saunshi, N., Dikkala, N., Li, Z., Kumar, S., & Reddi, S. J. (2025). Reasoning with Latent Thoughts: On the Power of Looped Transformers. International Conference on Learning Representations (ICLR).
- Thinking Machines Lab. (2026a). Inkling-2-Mini model card and config. https://huggingface.co/thinkingmachines/Inkling-2-Mini back: 1, 2
- Thinking Machines Lab. (2026b). Introducing Inkling 2 Mini. https://thinkingmachines.ai/news/inkling-2-mini/ back: 1, 2, 3, 4, 5, 6, 7, 8, 9