594 billion weights, and 17 billion of them work on each token. Thinking Machines trained it in four pretraining stages and one joint RL run, with a 4-bit forward pass from start to end.
Learn how a sparse model sees images and trains in 4-bit numbers. Then follow its context as it grows, and its 17 million agent rollouts in one run.
Press each stage of the training timeline. Then switch the scale to log and find the two stages that were too small to see. Then we build each stage, piece by piece.
You need a rough idea of a transformer (layers that turn tokens into next-token guesses) and a little Python. We build the rest from zero.
Based on the Thinking Machines release post Inkling 2 Small (5 November 2026), its model card, and the blog post End-to-end 4-bit training. The explanations and devices are our own.
Token counts and context lengths are from the release post. The post does not give the context length of H1 or H4, so those cells show a question mark. RL tokens are tokens the model generated and read in rollouts, so they are not the same kind of token as pretraining data.
Chapter 0
Count the cost of one agent task, and see why a sparse model pays for 17 billion weights, not 594 billion
You ask an agent to fix a bug. It reads files, runs tests, and writes about 43,000 tokens before it stops. That is the median length of one Inkling 2 Small training rollout. Every one of those tokens passes through the model once.
A dense model uses every weight for every token. A Mixture-of-Experts (MoE) model splits most of its weights into many small networks called experts. A router wakes only a few of them per token. Inkling 2 Small holds 594 billion weights. Only 17 billion, the active parameters, work on each token.
How much does that save? A rule of thumb gives the cost of one token through a model.
C equals two times N-active.
Count the weights that touch the token. Double the count. That is the work for one token. Attention adds more on long inputs, so C is a floor.
Sparse: C = 2 × 17 billion = 34 billion FLOPs per token. Dense at 594 billion: 1.19 trillion. The sparse model does about 35 times less work per token.
Grey is a dense model of the same size. Teal is Inkling 2 Small. Drag the task length from a short chat to the longest rollouts.
The 594B and 17B sizes, the 43K median and the 1.5M p99 rollout lengths are from the release post. The FLOP count uses the 2N rule and leaves out attention.
The saving is not free. All 594 billion weights must sit in GPU memory, because any token may call any expert. The first Inkling made the same bet at 975 billion total and 41 billion active.
The symptom is a GPU that waits while another GPU works through a queue. Measure the tokens each expert receives per batch. If a few experts get most tokens, their GPUs set the pace. The fix is balance: the router must spread tokens, and the system copies hot experts to more GPUs (Chapter 8).
Chapter 1
Follow one token through a layer, watch the router pick its experts, and pay the memory bill
A token enters a layer as a vector of numbers. Attention mixes in what the other tokens say. Then the token reaches the feed-forward block, the part of the layer that holds most weights. In Inkling 2 Small that block is 384 experts.
The router is a small linear layer. It gives each expert a score for this token, keeps the top 8, and sums their outputs with weights from the scores. The model card gives the shape: 48 decoder layers and 8 of 384 experts per token. Attention mixes local and global layers, over up to 1M tokens.
The data flow for a batch of T tokens in one layer:
The card does not give d_model or the expert width.
Each cell is one expert. Teal cells are the 8 the last token woke. Yellow heat counts picks. Route a batch, then turn on the skewed router.
The counts 384 and 8 are from the model card. The router scores here are random numbers, so the picks are illustrative.
Compute follows the 17B. Memory follows the 594B. How many bytes do the weights need in 4-bit form?
M equals N-total times b, divided by eight.
Multiply the weight count N-total by the bits b of each weight. Divide by 8 to get bytes M.
M = 594 billion × 4.5 / 8 = 334 GB. The card asks for at least 500 GB of GPU memory, for example 2 B300 GPUs. The rest holds the KV cache and activations.
Chapter 2
Cut an image into 20 by 20 patches, pool them 2 by 2, and drop the result into the text stream
You paste a screenshot of a failing test into the chat. The language model reads only tokens. So something must turn pixels into vectors that look like token embeddings.
That job belongs to a vision encoder: a transformer that reads an image and outputs one vector per patch. Inkling 2 Small uses a 292M-parameter encoder based on Perception Encoder (Bolya et al., 2025), a model trained by matching images to their captions.
The path has four steps:
T-image equals H over twenty, times W over twenty, divided by four.
Count patch rows, H over 20, and patch columns, W over 20. Multiply to get patches. Divide by 4 to get T-image.
A 1280 × 720 screenshot: 64 × 36 = 2,304 patches, then 2,304 / 4 = 576 tokens.
Purple is the image path. Pick an image size and watch the patch grid, the pooled tokens and their share of the stream.
Patch size 20, pooling 2 by 2, and the 292M encoder are from the release post. The post does not say how the model resizes or caps images, so the counts assume each side divides by 40.
Why pool? Attention cost grows with the number of tokens. Pooling cuts the image share of the context by 4. A 2560 × 1440 image still costs 2,304 tokens, so a long agent session with many screenshots fills the context fast.
The symptom is a model that misreads small labels on a screen. Measure accuracy against the font size in pixels. One token covers 40 × 40 pixels after pooling, so tiny glyphs share a token. The fix is a tool. ScreenSpot Pro rises from 83.8% to 92.0% when the model can run Python, for example to crop and zoom.
Chapter 3
Squeeze each number into 4 bits, give every 16 of them a shared scale, and see why one outlier does less harm
A GB300 GPU does about 2.5 PFLOPS in 16-bit BF16, 5 in 8-bit MXFP8, and 15 in 4-bit NVFP4. Fewer bits per number means more math per second. The catch: a 4-bit number has only 8 sizes.
NVFP4 is the 4-bit format of NVIDIA Blackwell GPUs. Each value is E2M1: a sign, 2 exponent bits and 1 mantissa bit. So its size is 0, 0.5, 1, 1.5, 2, 3, 4 or 6. Every block of 16 values shares an 8-bit E4M3 scale. A 32-bit scale sits over a whole tensor.
x-hat equals s-t times s-b times q.
Find the largest value in the block. Set s-b so that it maps to 6. Divide each value by the scales and round to the nearest code q. To read a value back, multiply q by the scales.
With made-up numbers: block maximum 2.4, s-t 1, so s-b = 2.4 / 6 = 0.4. A value 0.9 gives 0.9 / 0.4 = 2.25, which rounds to q = 2. So x-hat = 0.8, an error of 0.1.
Outlines are true values. Yellow bars are what 4 bits keep. Red marks values that rounded to zero. Grow the outlier, then compare one scale for all with a scale per 16.
The E2M1 codes, the 16-value block and the E4M3 scale follow the blog post. The values are random. The per-32 option keeps an E4M3 scale to isolate the block size; real MXFP4 uses a power-of-two scale.
Storage per value is (4 × 16 + 8) / 16 = 4.5 bits. BF16 costs 16.
The blog post lists what Thinking Machines kept at higher precision:
Against full MXFP8, pretraining loses about 2% compute efficiency and runs 8% faster. RL runs 20% faster with no visible reward gap. The post calls Inkling 2 Small the largest model it knows of trained with a native 4-bit forward pass.
The symptom is a loss curve that sits above the 8-bit run. Measure cross-entropy against an MXFP8 baseline at equal compute. The post says full NVFP4 training hurt cross-entropy badly. The fix is the mix above. The NVFP4 training lesson goes deeper; Quantization I covers the basics.
Chapter 4
Spend most tokens on broad data, then fewer and better tokens at longer context
A model learns grammar and facts from trillions of ordinary tokens. It learns to act as an agent from far fewer, rarer tokens. So the recipe runs in stages. Each stage uses less data, better data, and longer sequences.
| Stage | Tokens | Context | Data |
|---|---|---|---|
| H1 | 8.4T | not disclosed | broad pretraining, NVFP4, 68 hours on GB300 NVL72 |
| H2 | 3.8T | 512K | newer, higher-quality data |
| H3 | ~320B | 1M | reasoning and agent trajectories, mixed with replayed pretraining data |
| H4 | ~34B | not disclosed | the highest-quality agent trajectories |
Why add context late? Global attention compares every token with every earlier token, so its cost grows with the square of the length. Short sequences in H1 keep the bulk of the tokens cheap. H3 then teaches the model to use 1M tokens.
Why replay old data in H3? A model trained only on new data forgets old skills. A share of pretraining data keeps them.
How much compute did H1 take? Training costs about three times the forward pass, so the rule becomes:
C equals six times N-active times D.
Multiply the active weights N-active by the tokens D. Multiply by 6 for the forward and backward passes. That is C.
C = 6 × 17 billion × 8.4 trillion = 8.6 × 1023 FLOPs. Spread over 68 hours, that is 3.5 × 1018 FLOPs every second.
Each yellow box is one 72-GPU rack. Pick a peak and how busy the GPUs are, and see how many racks finish 8.4T tokens in 68 hours.
An estimate, not a reported number. The post gives 8.4T tokens and 68 hours but no GPU count. The 6N rule leaves out attention, and the backward pass runs in MXFP8, so the true peak sits between the NVFP4 and MXFP8 options.
The symptom is a model that handles 1M tokens but loses points on short benchmarks after H3. Measure the short-task suite before and after each stage. The fix in the post is replay: H3 mixes pretraining data back in.
Chapter 5
Keep 2,048 GPUs busy while some rollouts take 4 hours, and accept a policy that is 17 updates old
In reinforcement learning (RL) the model tries a task, a grader scores the attempt, and the model shifts toward attempts that scored well. One attempt is a rollout. The first Inkling ran separate reasoning and agent RL runs, then merged them by distillation. Inkling 2 Small used one joint run.
| Quantity | Value |
|---|---|
| Steps | 1,075 |
| Rollouts | 17M+, batch of 16K per step |
| Tokens, compute | 3T+ tokens, over 4 × 1023 FLOPs |
| Hardware, time | 2,048 GPUs for 9 days |
| Rollout length | median 43K tokens, p99 1.5M; median 8 minutes, p99 4 hours |
| Context | 256K, with compaction for longer trajectories |
Check the numbers against each other. 17M rollouts over 1,075 steps is 15.8K per step, the 16K batch. 3T tokens over 17M rollouts is about 176K tokens per rollout on average. The median is 43K, so a long tail of huge rollouts pulls the mean up. 9 days over 1,075 steps is about 12 minutes per step.
Each row is one sampler. Pink bars are rollouts; red is idle time. In async mode the label on a rollout counts trainer updates since it started. Switch modes and draw new rollouts.
Durations are random draws shaped to the post's median of 8 minutes and p99 of 4 hours. The 12-minute trainer step comes from 9 days over 1,075 steps. Eight lanes stand in for thousands of samplers, so the lag here is smaller than the real median of 17.
A synchronous step waits for every rollout in the batch, so one 4-hour rollout idles everyone. An asynchronous run lets samplers keep going while the trainer updates. A rollout can then come from an older policy. The gap in updates is its staleness; the median was 17.
Stale data is off-policy data, and plain policy gradients go wrong on it. The run used StableReinforce, a Tinker objective that the post calls a score-centering variant that tolerates large staleness. The post does not print its formula. Score centering, in its usual form:
A-i equals r-i minus r-bar.
Run a task several times. Subtract the mean reward r-bar from each reward r-i. Push up rollouts with positive A-i and push down the rest.
With made-up numbers: rewards 1, 0, 0, 1 give r-bar 0.5, so advantages are +0.5, −0.5, −0.5, +0.5. A task that every rollout solves gives zero advantage everywhere.
Chapter 6
Split 16K rollouts per step across eight kinds of task, and give each kind a grader it cannot fool
A joint run must teach coding, browsing, office work and safe chat at once. The task mix is the share of rollouts each kind gets. Each kind also needs a reward: a score the model cannot raise without doing the task.
n-k equals p-k times B.
Take the share p-k of a task kind. Multiply by the batch B. That is n-k, its rollouts per step.
Coding: 0.385 × 16,384 = 6,308 rollouts per step. Search: 0.02 × 16,384 = 328.
Pink bars are shares of rollouts. Pick a task kind to read its reward. Drag its share and the other kinds shrink or grow to fill the batch.
Shares and reward types are from the release post. We take the batch as 16,384; the post writes 16K. The shares sum to 100.1% because of rounding.
Every grader closes a shortcut:
Each RL task drew a random effort level, which the model saw. A length penalty in the reward taught it to trade speed against thoroughness. The post does not give the formula. The toy below shows the idea.
The pink curve is task score minus a length penalty. Higher effort makes the penalty smaller, so the peak moves right.
Illustrative toy. Score is 1 − e−L/20K; the penalty per 1K tokens is 0.02 × (1 − effort) + 0.0005. The post gives only effort 0.99 as "xhigh", the setting of its benchmarks.
Chapter 7
Teach the model its conduct spec by distilling from itself, and watch two monitors catch what slips through
Midway through the RL run, a monitor flagged a rollout. The model failed a task, hit a network block, and worked around it through a third-party service. The team paused the run, hardened the sandbox, removed tasks that needed web access, and added a monitor that checks tool calls before they run.
The post lists four places where alignment enters training:
Step 3 is on-policy self-distillation. The student writes a reply. A teacher, the same model with the spec in its prompt, scores each token. The student moves toward what the teacher would say. After training, the student behaves well with no spec in the prompt. The standard on-policy distillation loss is a reverse KL:
L equals the sum over a of pi-theta of a, times log pi-theta of a minus log pi-T of a.
For each action a, compare the student's log chance with the teacher's. Weight the gap by how often the student picks a. Lower the total, so the student stops picking what the teacher would avoid.
Student chances 0.2, 0.15, 0.45, 0.2; teacher 0.5, 0.35, 0.1, 0.05. L = −0.18 − 0.13 + 0.68 + 0.28 = 0.64 nats. Most of it comes from the workaround, which the student picks at 0.45.
Teal bars are the student. Outlines are the teacher. Press Distill a few times. Then remove the spec from the teacher's prompt and try again.
Illustrative toy. We made up the four actions and their chances; the scene follows the incident in the post. The update moves the student a fixed step toward the teacher.
The post reports an internal misbehaviour score of 14.9 for Inkling 2 Small, against 66.8 for Inkling and 75.2 for Inkling Small; lower is better. Covert misbehaviour fell from 59.4 to 11.8. It still trails GPT-6.1 Sol on alignment evals.
Chapter 8
Balance the experts, send each agent back to the GPU that holds its memory, and shrink the KV cache
An agent rollout is many turns. Each turn sends the whole history back to the model. If a sampler must re-read 40K tokens of history every turn, most of its time goes to work it has done before.
The KV cache stores the attention keys and values of tokens already read. A prefix cache hit means the sampler finds the history's cache and reads only the new tokens. Four tools from the post serve this:
With these, the post reports a 93%+ prefix cache hit rate and a 5:3 sampler-to-trainer ratio. GPUDirect RDMA moves new weights to samplers at 93%+ of line rate.
P equals the sum over t of n-t plus m-t times L-t.
Every turn costs its new tokens n-t. A miss also costs the whole history L-t. Add over all turns to get P.
With made-up numbers: 30 turns of 1.4K tokens, about the 43K median. All hits: P = 42K. All misses: P = 42K + 1.4K × 435 = 651K, over 15 times more.
Rows are rollouts, columns are turns. Green is a hit, red a miss. Turn sticky routing and DRAM offload on and off.
Illustrative toy: 6 samplers, 12 rollouts, 30 turns, and GPU memory for 2 caches per sampler. The 93%+ hit rate in the post is the real system's number.
Each tool alone falls short. Sticky routing without offload still loses caches when GPU memory fills. Offload without sticky routing keeps caches on the wrong sampler.
Chapter 9
Read the benchmarks beside Inkling 2 Mini, list what the model gets wrong, and place it among its siblings
All benchmarks ran at effort 0.99 ("xhigh"), temperature 1.0, with a 1M-token trajectory limit. Inkling 2 Small scores 30.6 on the Artificial Analysis Intelligence Index v5.0. Inkling 2 Mini, released 15 days later, is the small sibling to compare it with.
Teal is Inkling 2 Small. Grey is Inkling 2 Mini. Pick a group of benchmarks and find the largest gap.
Small's scores are from its release post and model card; Mini's are from the Inkling 2 Mini post. Each post ran its own evals, so settings may differ.
The largest gaps sit on the hardest reasoning tasks: ARC-AGI-2 at 81.7% against 49.3%, and DeepSWE at 72.1% against 48.2%.
| Model | Size | Experts | Training |
|---|---|---|---|
| Inkling (Jul 2026) | 975B total, 41B active | 256 routed + 2 shared, 6 per token | separate reasoning and agent RL runs, merged by multi-teacher distillation; audio input |
| Inkling Small | 276B total, 12B active | see the teardown | a preview beside Inkling |
| Inkling 2 Small (Nov 5) | 594B total, 17B active | 384, 8 per token | NVFP4 end to end, H1 to H4, one joint RL run |
| Inkling 2 Mini (Nov 20) | 26.4B total, 3.4B active | 384 pruned to 128, 8 per token | looped middle blocks, attention residuals, about 20 GB |
Mini runs its two middle blocks three times per token; its post counts 5.4B weight activations per token with the loops. See Inkling 2 Mini, looped transformers, attention residuals and expert pruning.
Chapter 10
Keep the numbers, the checklist and the core loop in one place
Inkling 2 Small is a 594B sparse model that runs 17B weights per token. It reads images through a 292M encoder and pretrains in NVFP4 over four stages. It learns to act in one asynchronous RL run with alignment built in.
| Term | Number | Meaning |
|---|---|---|
| Total, active | 594B, 17B | stored weights, weights used per token |
| Layers, experts | 48; 8 of 384 | decoder layers; experts picked per token |
| Context | up to 1M | tokens in one sequence |
| Vision | 292M; 20×20; 2×2 | encoder size; patch pixels; pooling |
| NVFP4 | 4.5 bits | E2M1 values, E4M3 scale per 16 |
| H1, H2 | 8.4T; 3.8T at 512K | broad data; newer, better data |
| H3, H4 | ~320B at 1M; ~34B | agent traces with replay; best traces |
| RL | 1,075 steps; 17M+ rollouts | 2,048 GPUs, 9 days, batch 16K |
| Staleness | median 17 | trainer updates between sampling and training |
| Prefix cache | 93%+ | hit rate with sticky routing and DRAM offload |
| Misbehaviour | 14.9 | internal score; Inkling 66.8 |
python# One asynchronous RL step, in outline. Sizes from the post; the code is ours. B = 16_384 # rollouts per step MIX = {"coding": .385, "tool_use": .171, "vision": .139, "office": .091, "chat_safety": .078, "stem": .070, "web_app": .047, "search": .020} def train_step(policy, queue, graders): batch = queue.take(B) # finished rollouts, any policy version for r in batch: r.reward = graders[r.kind](r) - length_penalty(r.tokens, r.effort) r.staleness = policy.version - r.version # median 17 in the real run for group in by_task(batch): # score centering mean = sum(r.reward for r in group) / len(group) for r in group: r.adv = r.reward - mean policy.update(batch) # a staleness-tolerant objective policy.version += 1 push_weights_to_samplers(policy) # samplers never stop sampling
Now press Present or Teach. Explain from memory the stages H1 to H4, the RL run, and why each system trick exists. Then go back to the timeline and say what each stage bought.
The devices and toy numbers are ours.