Thinking Machines' open-weights model stores 24 layers and runs 48 for every token. Its middle 12 layers loop three times, so a 26.4B model that fits in about 20GB thinks deeper than its weights.
Pick how many passes, then press Send a token. Watch one token cross the prelude, the loop and the coda. Then we build each part, from the gated message to what loops do to the chain of thought.
You need a rough idea of a transformer layer and of a mixture of experts (each token uses a few small networks out of many). We build the rest from zero.
Based on Thinking Machines Lab's Introducing Inkling 2 Mini (20 November 2026), its model card, the 4-bit training post, and Goodfire's early interpretability notes. Every number on this page comes from those pages unless a device says it is illustrative.
Inkling 2 Mini always runs 3 passes. The other pass counts belong to the research model TML-d24-varloop-research, trained with 1 to 5 passes. Effective active parameters use the model card's rule of about 1.0B for each extra pass. Reasoning tokens are TML's averages on GPQA Diamond questions the research model solved at every pass count; 2 and 4 passes were not reported.
Chapter 0
See why a fixed stack of layers limits the thinking for each token, and how a loop raises the limit
You want a model that runs on a laptop. Memory caps the weights at about 20GB. But hard problems need many steps of thought. A transformer with 24 layers gets 24 steps for each token, and then it must write that token.
A serial step is a computation that needs the result of the step before it. A chain of lookups is serial: you cannot find the third name before you know the second. If a problem needs more serial steps than the layers give, the model writes the extra steps as text. That text is its chain of thought (CoT).
Inkling 2 Mini adds steps without adding weights. It runs its middle 12 layers three times for each token. That makes it a looped transformer: a model that applies the same layers to the same token more than once.
Each arrow is one lookup the answer needs. Teal lookups happen inside one token. Warm lookups the model must write out. Drag the chain length, then switch the model.
Illustrative toy: one run of a six-layer middle block does one lookup, and each written lookup costs 40 tokens. The real result is TML's: on N-Hop Lookup the research model followed longer chains with more passes, out to ten.
With the toy's numbers: a chain of 6 lookups. The plain model runs its two middle blocks once, so it does 2 lookups inside the token and writes 4, about 160 tokens. Looped three times, the middle blocks run 6 times and the model writes nothing.
The failure to watch for: forbid the CoT, and a plain model answers fast but wrong on long chains. To measure it, bin accuracy by chain length, as N-Hop Lookup does. Each question there has five options, so a guess scores 20%. The fix is more passes, or a CoT.
There is a price. A step that never becomes text is a step a reader cannot check. Chapter 9 measures that price.
Chapter 1
Follow one token through 24 stored layers that run as 48, and count what that costs
Follow one token. The embedding turns it into a vector of 2,304 numbers, the width Goodfire reports. A prompt of T tokens is a matrix of shape T × 2304. Every layer reads that shape and writes the same shape.
The 24 stored layers sit in four blocks of six.
| Block | Layers | Runs | Job |
|---|---|---|---|
| 1, the prelude | 1 to 6 | once | turns embeddings into the model's inner form |
| 2 and 3, the loop | 7 to 18 | three times, same weights | the abstract reasoning |
| 4, the coda | 19 to 24 | once | turns the inner form back into next-token scores |
Why loop the middle? TML's intuition: the middle layers carry the abstract reasoning, and the first and last layers translate. Looping the edges would repeat translation work. So 6 + 12 × 3 + 6 = 48 layer applications run for each token.
The top row is the 24 stored layers. Each lower row is one stage of the schedule. Press Play, and watch the same stored layer light up once in each pass.
Layer and block counts are from the model card and the TML post. Pass counts other than 3 belong to the research model.
Weights stay the same, but compute grows. How many parameters does one token touch?
A-eff equals A, plus p minus one, times delta-A.
Start from the active parameters A. Add delta-A once for each pass after the first. The total is A-eff.
From the model card: 3.4B + (3 − 1) × 1.0B = 5.4B. The token touches 5.4B weight uses, but memory holds 26.4B weights once.
The failure: the model card warns that compute per token is higher than 3.4B suggests. The symptom is a laptop that decodes slower than you planned. Measure tokens per second against a model with 5.4B active. The fix is to budget for 5.4B and use a runtime with looped-model support, which is new.
Chapter 2
Hand each pass the result of the pass before, through a gate that starts closed so looping arrives without a shock
Pass 2 must know what pass 1 found. The prelude's output feeds every pass. Passes 2 and 3 also read the middle blocks' output from the pass before. TML calls that output the message.
A gate is a learned number that scales a signal before it joins another. TML merges the message with the prelude output through a gate, which also scales the output of the earlier layers in the block. At the start of training the gate blocks the whole message. So each pass first behaves like a model without a loop. Then the gate's gain grows.
x-k equals b-one, plus g times m-k-minus-one.
Take the prelude output b-one. Scale the last pass's message m by the gate g. Add the two. That sum x-k is what pass k reads.
With made-up numbers for one coordinate: b-one = 0.8 and m = 0.5. At g = 0, x = 0.8, the input of a model with no loop. At g = 0.6, x = 0.8 + 0.3 = 1.1.
TML does not disclose the exact gate formula. The line above is the simplest form that matches their words. Why start closed? A new loop feeds the network's own output back in. If that path opens on step one, values from random weights stack up across the repeats.
The top lane is the gate gain. The bottom lane is the training loss; the faint line is the other gate. Pick a gate, then press Train.
Both curves are an illustrative toy. TML states only that the gate starts closed, its gain grows during training, and this lets looping start in a stable way.
The failure: switch on looping in a running training job and the loss spikes or diverges. Measure the gate gain and the size of the activations after each pass. The fix is to start the gate at zero, so the loop begins as an exact copy of the plain model.
Chapter 3
Replace the fixed running sum with a learned mix, so each layer picks which earlier blocks to read
In a standard transformer each layer adds its output to one running sum, the residual stream. Every write counts with weight 1. After 48 applications the sum is large, and one layer's write is a small share of it. The Kimi team calls this dilution.
Attention residuals (AttnRes) replace the fixed sum with a learned mix over depth. Each layer owns one learned vector, a pseudo-query. It scores each earlier output, and a softmax turns the scores into weights that add to 1. Inkling 2 Mini mixes at block level: each layer reads the outputs of earlier blocks.
h-l equals the sum over i of alpha-i-to-l times v-i.
Score every earlier output v-i with the layer's pseudo-query. Turn the scores into weights alpha with a softmax. Add up each v-i times its alpha. That is h-l.
With made-up scores 0, 1 and 2 for three sources, the softmax gives 0.09, 0.24 and 0.67. A plain sum would give 1, 1 and 1, and an input three units big.
Each bar is one earlier block output and the weight the reader gives it. Choose a reader and a rule, and watch the size of the input.
Weights are illustrative, shaped like Goodfire's finding that later passes read mostly from block 3 of the pass before. Real weights change with each token.
Why this suits a loop: a pass can read the message selectively. Goodfire found that the model uses one coordinate, dimension 2027, to signal which blocks later passes should read. In the last pass that signal flips sign, since no pass follows.
The failure AttnRes targets: output size grows with depth, and the earliest layers get large gradients. Measure the output size and the gradient size at each layer. The Kimi paper reports more even sizes across depth with AttnRes.
Chapter 4
Cut two thirds of the experts to fit a laptop, then train on 1T distilled tokens to win the loss back
A mixture of experts (MoE) layer holds many small feed-forward networks, the experts. A router sends each token to a few of them. Inkling 2 Mini started training with 384 experts per layer and 8 for each token. The MoE lesson builds the router from zero.
S equals E over k.
Divide the experts E by the experts each token uses, k. The result S says how much of the layer sits idle for any one token.
From TML: 384 ⁄ 8 = 48 at the start, and 128 ⁄ 8 = 16 after pruning. Memory shrinks by two thirds. Compute per token stays the same, since k is still 8.
At one point in midtraining, TML deleted two thirds of the experts and kept the 128 most used in each layer. Then the model trained on 1T tokens distilled from a larger internal Inkling model. Distillation trains a student to match a teacher's outputs. This heal won back the performance from before pruning: the kept experts took over the deleted ones' work.
The curve is how often the router picks each of the 384 experts, most used first. Pink experts stay. Drag the cut, then press Heal.
The usage curve and the loss bars are illustrative. Expert weights use the estimate below. TML gives only the counts 384, 128 and 8, the 1T-token heal, and that it recovered the pre-pruning performance.
A size estimate. Goodfire counts 147,456 MoE neurons per layer, so 1,152 per expert at width 2,304. If each expert has three weight matrices (a gated MLP, our assumption), one expert holds 3 × 2,304 × 1,152, about 8.0M weights. Then 128 experts × 24 layers is about 24.5B, most of the 26.4B. With 384 experts the same layers would hold about 73B.
The failure: right after the cut, the loss jumps. Tokens that used the deleted experts suffer most. Measure the loss before and after, by domain. The fix is the heal: distill from a stronger teacher until the loss returns.
Chapter 5
Store each expert weight in 4.5 bits with a shared block scale, and ship the exact numbers the model trained with
Four bits give 16 values. The FP4 format E2M1 holds ±{0, 0.5, 1, 1.5, 2, 3, 4, 6}. To reach larger numbers, NVFP4 groups 16 neighbours into a block and stores one 8-bit scale (E4M3) for the block, set by its largest value. A second FP32 scale covers the whole tensor.
x-hat-i equals q-i times s-b times s-t.
Find the block's largest value and divide it by 6 to get s-b. Divide each value by s-b and round to the nearest E2M1 value q-i. Multiply back to get x-hat-i.
From the 4-bit post: a block whose largest value is −54 gets s-b = 9, and the block stores −54 as −6. A neighbour of 5.4 becomes 0.6, rounds to 0.5, and returns as 4.5.
The cost is (4 × 16 + 8) ÷ 16 = 4.5 bits per value. MXFP8 keeps 8-bit values with one scale per 32, so 8.25 bits. Inkling 2 Mini runs NVFP4 in the expert layers on every forward pass, from pretraining through RL. The last 4 of 24 layers run in MXFP8: one sixth, the share TML's recipe keeps in higher precision.
Dots are the true values. Bars are the 4-bit versions. Red marks a value that rounds to zero. Grow the outlier, then share one scale across all 32.
We made up the 32 values. The E2M1 grid and the rule "scale = block maximum divided by 6" are from the 4-bit post. The toy skips rounding the scale to 8 bits.
The point is the match. The released weights are the trained weights: 20 layers in NVFP4, 4 in MXFP8, about 20GB, with no conversion loss. A model trained in 16 bits and squeezed to 4 bits later needs a calibration pass and loses some accuracy. The quantization lesson covers that older route.
The failure: one outlier sets a block's scale, and its small neighbours round to zero. Count the zeros in each block. Small blocks of 16 limit the damage. The NVFP4 training lesson adds stochastic rounding for the backward pass.
Chapter 6
Walk the whole training timeline, and see who writes the text and who grades it at each stage
Inkling 2 Mini comes from TML's mainline scaling ladder. Two changes set it apart: the loop, and the pruning. Everything else, including quantization and the data mix, follows the mainline recipe. After the heal come three post-training stages.
Pick a stage. The lower panel shows who writes the text and where the learning signal comes from.
Stage order, the 1T-token heal and the RL size are from TML. The timeline is not to scale; pretraining size and the RL reward design are not disclosed.
n equals N over K.
Divide the RL tokens N by the steps K. The answer n is the size of one step's batch of attempts.
2.2T ⁄ 2,000 = 1.1B tokens per step. Each sampled token loads the weights, which is why 4-bit sampling pays off most in RL.
The 4-bit post reports a 20% speedup in RL over full MXFP8 for Inkling 2 Small, with no visible change in reward. The on-policy distillation lesson derives its loss, and multi-harness async RL shows how such rollouts run at scale.
The failure, from the model card: the model can get stuck in long reasoning loops, re-checking its work without progress, most of all when debugging. Measure output tokens per task and count repeated checks. The card's fix is a limit on output tokens and agent turns.
Chapter 7
Compare a middle loop with a last loop, then weigh the cheaper training of a plain model against its inference bill
An ablation removes or moves one part and measures the change. TML ran two. The first asks where to loop. The unit is the compute-equivalent gain: how many times more training compute the no-loop baseline would need to reach the looped model's loss.
| Looped layers | Gain at step 2,000 | Result |
|---|---|---|
| Middle, 7 to 18 | 1.51× to 1.91× | larger gain on 27 of 28 evaluations |
| Last, 13 to 24 | 1.24× to 1.36× | smaller gain |
Both runs used three passes and equal training compute. The second ablation compares an unpruned looped model with an unpruned plain one. The plain model cost 7.5% less compute to train. But it needed 140% more inference compute to match the looped model's loss on 512k-token agentic traces.
I-star equals zero point zero seven five T, over one point four.
Looped total is T plus I. Plain total is 0.925 T plus 2.4 I. Set them equal and solve for I. That I-star is where the plain model's saving runs out.
0.075 ⁄ 1.4 = 0.054, so I-star is 5.4% of T. Once inference spends more than 5.4% of the training compute, the looped model wins.
The ruler shows the two measured gains. Below, drag how much compute serving uses, as a share of training, and watch the two totals cross.
Gains, 7.5% and 140% are TML's. The totals assume the 140% holds at every serving volume, which TML measured only on 512k-token agentic traces.
The failure in comparisons: set a looped model beside a plain one with the same active count, and the loop's extra compute hides. Measure at equal compute per token, or report compute-equivalent gains, as TML did.
Chapter 8
Read the benchmarks row by row against Qwen3.8-27B, find where the loop wins and where it loses, then count the energy
The closest rival in TML's table is Qwen3.8-27B: a dense model, 27B weights, all active for each token. Inkling 2 Mini uses 5.4B effective active out of 26.4B. TML says Inkling 2 Mini leads every open-weights model under 100B total parameters on DeepSWE v1.1 (48.2%) and Vals Index v2.2 (46.5%).
Warm is Inkling 2 Mini. Grey is Qwen3.8-27B. A red label marks a row Inkling loses. Pick a group.
Scores from TML's table and model card; TML notes that evaluation setups vary by model. GDPVal and PMPP-Hard are not percentages; PMPP-Hard is an area under the curve over 0 to 10 hours. Per watt: Stanford's measurement, with Inkling 2 Mini at MXFP8 and low reasoning effort on DGX Spark, and the others at NVFP4 or INT4.
The pattern has a cause. Loops add reasoning, not stored facts, so the knowledge rows lag: the non-hallucination rate is 63.4% against 71.4%. Search and tools close part of the gap, as on BrowseComp, 79.0% against 61.6%.
TML states two weak spots: 50.0% on MultiChallenge (multi-turn chat) and 33.4% on ComplexConstraints v1.1, and says both trail Qwen3.8-27B. The table itself lists Qwen at 30.1% on ComplexConstraints, so the two pages disagree on that row. It also trails larger models on CritPt v2 and HLE-Diamond.
Intelligence per Watt (IPW) is task accuracy per unit of power, from the Stanford paper of that name. On DGX Spark, Inkling 2 Mini scored 0.703, against 0.430 for Qwen3.6-35B-A3B. That is 0.703 ÷ 0.430 = 1.63 times as much. The settings differ by model, so read it as one measured setup, not a law.
The failure: a table built from each lab's own harness mixes setups. Measure both models in your own harness, on your own tasks. The fix is to treat a 1-point gap as a tie until you do.
Chapter 9
Turn the passes up on the variable-loop model, and check whether its reasoning stays short, readable and easy to watch
A CoT monitor is a second model that reads the chain of thought and flags bad intent. It works because a plain transformer must write long reasoning down. Loops do more work inside each token, so some reasoning may never reach the text.
To test this, TML trained TML-d24-varloop-research with 1 to 5 passes, mostly 3, and RL at 3 passes only. Its no-CoT time horizon (from Think Fast) is the task length, in human time, it solves half the time without a CoT. It rose from 16 seconds at one pass to 37 seconds at three, then stayed roughly flat. At ten passes it did not get worse.
Each bar is one pass count. A dashed box means TML did not report that point. Pick a measurement.
All values from TML. Backtracking counts uncertainty words such as "wait" and "hmm". Stealth is from LinuxArena with a weaker monitor at a 1% false positive rate, on 184 task pairings.
Shorter is not hidden. Take the GPQA Diamond questions solved at every pass count. Words per sentence stayed at 8.9, 8.7 and 8.7. Dictionary words stayed at 94.6%, 94.5% and 94.4%. The model backtracked less. Did the loops cost more work in total?
W equals L times N.
Multiply the layer work per token L by the reasoning tokens N. W is the decode work, leaving out the prompt.
One pass: 24 × 3,703 = 88,872. Three: 48 × 1,731 = 83,088. Five: 72 × 1,661 = 119,592. Three passes did the same answers with slightly less work.
CoT controllability asks whether a model can reshape its CoT on request, such as avoiding a keyword. On CoTs of 750 to 1,250 tokens, both looped models did it at most 0.1% of the time, against 1.3% for Qwen3.8-27B. That rate is too low to separate pass counts.
The failure to watch: a monitor that sees only tool calls misses attacks, up to 5.0% at five passes. When it also reads the thinking, stealth falls to 0.0% to 0.6%. So keep monitors on the CoT. TML found no clear trend with passes, and warns that RL at higher pass counts might compress more.
Chapter 10
Keep the numbers, the forward pass in code, a checklist, and where to go next
Inkling 2 Mini stores 24 layers and runs the middle 12 three times. A gate opens the message between passes as training goes on. Attention residuals let each layer pick what to read. Pruning and a 1T-token heal fit the experts in 20GB, and NVFP4 training means the shipped weights are the trained ones.
| Term | Number | Meaning |
|---|---|---|
| Total parameters | 26.4B | weights in memory, about 20GB |
| Active / effective active | 3.4B / 5.4B | one pass / three passes |
| Layers | 24 stored, 48 applied | 4 blocks of 6; blocks 2 and 3 run 3 times |
| Width | 2,304 | per Goodfire |
| Experts | 384 to 128, top 8 | pruned in midtraining, healed on 1T tokens |
| Numerics | 20 NVFP4, 4 MXFP8 | 4.5 and 8.25 bits per value |
| RL | 2.2T tokens, 2,000 steps | 1.1B tokens per step |
| Context | up to 1M tokens | model card |
| Loop gain | 1.51× to 1.91× | middle loop; last loop 1.24× to 1.36× |
| IPW | 0.703 | against 0.430 for Qwen3.6-35B-A3B |
| No-CoT horizon | 16 s to 37 s | research model, 1 to 3 passes |
The forward pass in a few lines. The gate form is the illustrative one from Chapter 2.
pythondef forward(x): # x: [T, 2304] token embeddings b1 = prelude(x) # block 1, layers 1-6, once msg = None for p in range(3): # the loop: layers 7-18, shared weights inp = b1 if msg is None else b1 + gate * msg # gate starts at 0 msg = middle(inp) # blocks 2-3; layers mix earlier block outputs (AttnRes) return coda(msg) # block 4, layers 19-24, once -> logits def moe(h, router, experts): # h: [T, 2304], 128 experts per layer w, idx = router(h).topk(8, dim=-1) # 8 of 128 experts per token return sum(w[:, j:j+1] * experts[idx[:, j]](h) for j in range(8)) # schematic; real kernels group tokens by expert
Papers behind the page: Dehghani et al., Universal Transformers; Kimi Team, Attention Residuals; Saad-Falcon, Narayan et al., Intelligence per Watt; Yueh-Han et al., CoT-Control; CoT monitorability; and Think Fast.
Now press Present or Teach and explain from memory: the data path, why the gate starts closed, what attention residuals mix, and why the weights ship in 4 bits. Then go back to the hero and send a token at one pass and at five. Say what each extra pass costs and buys.
This lesson re-teaches Thinking Machines Lab's Introducing Inkling 2 Mini and model card, its end-to-end 4-bit training post, and Goodfire's Interpreting Inkling 2 Mini. The numbers are theirs; the explanations, toys and devices are our own.