Inkling 2 Mini started with 8 of 384 experts per layer. Midway through training it kept the 128 most used in each layer, then healed on 1T tokens distilled from a larger model. It now fits in about 20 GB.
Learn why a few experts carry most of the routing, how to cut the rest, what the cut breaks, and how a teacher repairs it.
Drag Experts kept to prune the least used columns. Watch the routed mass and the quality fall. Then press Heal. Then we build, piece by piece, the routing, the skew, the cut, the damage, the distillation and the memory payoff.
You need the Mixture of Experts lesson (experts, a router, top-k) and a little Python. We build the rest from zero.
Facts come from Thinking Machines' Inkling 2 Mini announcement and model card (2026-11-20), Hinton et al. on distillation, and the pruning and merging papers named in Chapter 8. We label toy devices illustrative.
Illustrative toy: 48 experts, top 2, router scores from a seeded model with skewed popularity. Inkling 2 Mini had 384 experts and top 8; keeping one third mirrors its 384 to 128 cut. We made up the quality proxy. That healing recovers fully at one third kept follows the source's claim; the partial recovery at harsher cuts is a toy.
Chapter 0
See how much of a mixture of experts sits idle for each token, and why that idle part decides where the model can run
You have a Mac with 32 GB of memory. You want a strong coding model on it, offline. The model keeps most of its weights in experts: small feed-forward networks, and the router picks a few of them for each token.
Inkling 2 Mini started training with 384 experts in every layer. Each token used 8 of them. The other 376 experts in that layer did nothing for that token, but they still sat in memory. Memory, not arithmetic, decides whether a model fits on a laptop.
Each dot is one expert. Press Send a token and see the 8 that light up. Then switch to the layer after the cut.
The counts, 8 of 384 and 8 of 128, are from the Inkling 2 Mini announcement and model card. Which experts a token picks here is illustrative, drawn from a skewed popularity.
Here is the worked number. Before the cut, one token touches 8 of 384 experts: 2.1 percent. After the cut, it touches 8 of 128: 6.25 percent. The token does the same amount of expert work. The layer stores a third of the experts.
Thinking Machines made that cut once, during midtraining (the phase after the main pretraining run, on more selected data). Each layer kept its 128 most used experts. Then the model trained on 1T tokens distilled from a larger internal Inkling model. That step recovered the performance it had before the cut. The shipped model has 26.4B total parameters, 3.4B active, in a checkpoint of about 20 GB.
The cut is cheap to describe and easy to get wrong. A router that learned to send tokens to 384 experts now points at 256 that are gone. This lesson follows the cut from start to finish.
Chapter 1
Follow the shapes from a token to its k experts, and count sparsity as N divided by k
The Mixture of Experts lesson builds the layer in full. Here is the part pruning touches. A batch of T tokens arrives, each a vector of width d. The router is one weight matrix. It gives each token one score for each of the N experts. These raw scores are the router logits.
h equals x times W-r.
Multiply each token vector x by each column of W-r. Each product is one score in h. Each token goes to the k experts with the top scores in its row of h.
A batch of 4,096 tokens and N = 384 gives h of 4,096 by 384, about 1.57 million scores. After the cut, N = 128, so h is 4,096 by 128. The width d is not disclosed for Inkling 2 Mini.
The gate turns the k top scores into weights that add to 1. The layer output is the gate weighted sum of the k expert outputs. Sparsity says how many experts the layer holds for each one a token uses.
s equals N over k.
Divide the experts in the layer, N, by the experts a token uses, k. A token runs one expert in every s.
Inkling 2 Mini at the start: N = 384, k = 8, so s = 48. After the cut: N = 128, k = 8, so s = 16. Mixtral 8x7B: N = 8, k = 2, so s = 4.
The top row traces the shapes. The grid shows one token's k experts among N. Pick a preset or move the sliders.
Presets come from the Inkling 2 Mini sources and the Mixtral setup used in Chapter 8. The batch of 4,096 tokens is illustrative.
The failure. Sparsity counts experts, not parameters. Attention, embeddings and the router are dense: every token uses them. So Inkling 2 Mini's total to active ratio is 26.4 / 3.4, about 7.8, not 16. The symptom is a memory or compute estimate that is off by 2 times. Measure both totals by counting the weights in each part. The fix is to always report total and active parameters, as the model card does.
Chapter 2
Count how often each expert gets picked, and see the three forces that pile tokens onto a few
Run a million tokens through one layer. For each expert, count how often it lands in a token's top k. The counts are not even. A few experts take a large share. Many take almost nothing. This skew is what makes pruning by usage possible.
Call the count of expert e ce. With T tokens and k picks per token, there are k times T routing slots in all. The usage of an expert is its share of those slots.
u-e equals c-e over k times T.
Count the slots expert e won, c-e. Divide by all the slots, k times T. The usages of all experts in a layer add to 1.
With made-up numbers: T = 1,000 tokens and k = 8 give 8,000 slots. An expert that wins 120 of them has u = 1.5 percent. An even share would be 1 / 384, about 0.26 percent, so this expert carries almost 6 times its share.
Three forces build the skew:
Bars are expert usage, sorted from most used. The shaded third is what a one-third cut keeps. Set the balance weight and press Train.
Illustrative toy: 48 experts, top 2, token kinds with uneven frequencies, an update that rewards picked experts and a balance term that pulls usage toward even. Thinking Machines did not publish Inkling's usage histogram.
The failure. Usage depends on the data you count it on. Count on web text and you may cut the experts that serve math. The symptom is one skill falling much more than others after the cut. Measure usage per data domain, and check what share of each domain the cut experts carried. The fix is to count on data that matches what the model must still do. Thinking Machines does not say which data it counted on.
Chapter 3
Rank the experts inside each layer, keep the top 128, and delete the rest from the router and from memory
The cut has four steps:
pythondef prune_layer(router_W, experts, usage, keep=128): # router_W: (d, 384) experts: list of 384 FFNs usage: (384,) shares that sum to 1 idx = usage.argsort(descending=True)[:keep].sort().values # the 128 most used, in old order kept_mass = usage[idx].sum().item() # share of slots that survive new_W = router_W[:, idx].clone() # (d, 128) new_experts = [experts[i] for i in idx.tolist()] # 128 FFNs return new_W, new_experts, kept_mass
The share of routing slots that survive is the kept mass of the layer. Call the set of kept experts in layer l Kl.
M-l equals the sum, over the experts e in K-l, of u-l-e.
Add up the usage u of every expert you keep in layer l. The total M-l is the share of slots that survive. One minus M-l is the share that pointed at a deleted expert.
With made-up numbers: if the top 128 experts of a layer hold 85 percent of its slots, M = 0.85. The other 256 experts held 15 percent, so 15 percent of that layer's routing slots now point at nothing.
Each row is one layer, its experts sorted by usage. Teal bars survive. Move Kept per layer, then try ranking across all layers.
Illustrative toy: 6 layers of 48 experts, top 2, each layer with its own skew. Inkling 2 Mini ranked within each layer ("the 128 experts that were most used in each layer").
Why rank inside each layer? Every layer keeps the same count, so every MoE layer has the same shape: one kernel and one memory plan. Each router also keeps at least k choices. Ranked across layers, a layer with flat usage loses most of its experts.
Why midtraining? The table compares three moments.
| When | Usage counts mean | Budget left to heal |
|---|---|---|
| At the start | Nothing yet: the router is random. | All of it, but you have nothing to rank by. |
| Midtraining | A settled router and real skew. | 1T tokens of distillation, then RL. |
| After training | A settled router. | None, unless you train again. Chapter 8 covers these one-shot methods. |
The failure. Rank across all layers and one layer can keep fewer than k experts. The symptom is a layer that cannot fill its top k, or uneven layer shapes that break a fused kernel. Measure the kept count of each layer after the cut. The fix is to rank within each layer.
Chapter 4
Follow one token that lost a top expert, and see a stranger take its slot
Take one token. Before the cut, its top 4 included expert 11. After the cut, expert 11 is gone. The router still computes the old scores for the experts that survive. The next best survivor moves into the empty slot. Call a token that lost one of its top k experts an orphaned token.
The gate turns the top k logits into weights. Call the set of the token's top k surviving experts S.
g-i equals e to the h-i, over the sum over j in S of e to the h-j.
Take the token's k best logits among the survivors. Raise e to each one. Divide each by their total. That is g-i.
With made-up numbers: top 4 logits 2.0, 1.5, 1.2 and 1.0 give gates 0.41, 0.25, 0.19 and 0.15. Cut the expert with 1.2. The next survivor has 0.4. The gates become 0.46, 0.28, 0.17 and 0.09. The stranger gets 9 percent of the token.
Bars are the token's router logits, experts ranked by usage. Outlined bars are its top 4. Pick a token, then toggle the cut.
Illustrative toy: 16 experts, top 4, hand-set logits. The first token's numbers match the worked example above.
The cut does two kinds of damage:
The failure. The symptom is a loss that jumps on the step after the cut. Measure the share of orphaned tokens in each layer: tokens whose old top k held a deleted expert. The fix is to heal before you ship, which the next two chapters cover.
Chapter 5
Train the pruned student to match the whole next-token distribution of a larger teacher, not only the right answer
The pruned model must relearn. Train it on plain text and each token gives one signal: the right next token. A teacher, a larger model that lost nothing, can give more: a probability for every token in the vocabulary. The pruned model is the student. Training the student to match the teacher is distillation (Hinton et al., 2015).
Thinking Machines writes that the model "trained on 1T tokens distilled from a larger internal Inkling model." It does not say whether it matched the teacher's logits or trained on text the teacher wrote. We teach the logit form here. The Knowledge Distillation lesson covers both.
Each model ends with logits z: one raw score per vocabulary token. A temperature τ softens them before the softmax.
p of v equals the softmax of z over tau, read at token v.
Divide every logit z by tau. Take the softmax. A larger tau gives the unlikely tokens more weight, so their order shows.
With made-up logits 2 and 0: at tau = 1 the softmax gives 0.88 and 0.12. At tau = 2 it gives 0.73 and 0.27.
The loss measures how far the student's distribution p-S is from the teacher's p-T. It is the KL divergence: the extra surprise of the student, averaged under the teacher.
L equals tau squared, times the sum over v, of p-T of v times the log of p-T of v over p-S of v.
For each token v, take the log of how much more the teacher p-T likes it than the student p-S. Weight it by p-T. Add the terms and multiply by tau squared.
With made-up numbers and tau = 1: teacher 0.7, 0.2, 0.1; student 0.4, 0.4, 0.2. L = 0.7 × ln 1.75 + 0.2 × ln 0.5 + 0.1 × ln 0.5 = 0.392 − 0.139 − 0.069 = 0.184 nats.
Compare the plain loss. If the true next token is the first one, plain cross entropy is −ln 0.4 = 0.92 nats. It says nothing about the other two. The teacher also says the second token is twice as likely as the third.
Warm bars are the teacher, blue bars the student, after "The capital of France is". Pick the student's state and slide the temperature.
Illustrative logits made up for this page. The page computes the losses live from them.
The failure. At a low temperature the teacher's distribution is almost one-hot, so distillation turns into plain labels. The symptom: the student gets the top token right and the rest wrong. Measure the KL at tau = 1 on held-out text. The fix is a small grid of temperatures. Teacher and student must also share one tokenizer.
Chapter 6
Run the recovery, count how much each surviving expert sees, and place the heal in the rest of training
After the cut, Inkling 2 Mini trained on 1T distilled tokens. Thinking Machines writes that this step "recovered the performance the model had before pruning." During the heal, the router learns new scores for the 128 survivors. The survivors learn to cover the tokens the deleted experts served.
How much training does each survivor get? Call the healing tokens D.
n equals D times k, over N.
Each of the D tokens fills k slots in a layer. Spread those slots over the N experts. Each expert gets n tokens.
D = 1T, k = 8, N = 128: n = 1012 × 8 / 128 = 62.5 billion tokens for each expert in each layer. Usage is skewed, so busy experts see more and quiet ones less.
The dashed line is quality before the cut. Slide the healing tokens and compare the three recipes.
Illustrative curves. The 1T token budget and full recovery for distillation are from the source. We made up the plain-text and no-heal curves and all the quality values to show the shape.
Why a teacher and not more plain text? Each distilled token carries a full distribution, so it holds more signal than one label. Hinton et al. (2015) found that soft targets let a student learn well from much less data. The teacher also stays fixed while the student moves, so the target does not drift.
The heal is one stage. After it came supervised fine-tuning, then RL that "totaled 2.2T tokens over 2,000 steps", and an extra alignment phase with on-policy distillation.
The failure. A heal mix narrower than the pretraining mix leaves some skills broken. The symptom is benchmarks that recover on average while one domain stays low. Measure each domain's score before the cut and after the heal. The fix is a heal mix that covers what the model must still do.
Chapter 7
Turn parameter counts into gigabytes, and see why the cut changes where the model runs but not what one token costs
To serve a model, all of its weights must sit in memory, even the experts a token does not use. So total parameters set the memory. Active parameters, the weights one token uses, set the arithmetic per token.
The model card gives two numbers after the cut: 26.4B total and 3.4B active. The pre-cut size is not disclosed. We can estimate it. Call the dense part O and all the expert weights E.
E equals P minus A, over one minus k over N.
P minus A is the expert weight a token skips. A token skips the fraction one minus k over N of E. Divide to get E. Then O is P minus E.
E = (26.4 − 3.4) / (1 − 8/128) = 23 / 0.9375 = 24.53B, so O = 1.87B. Before the cut, with 3 times the experts: 1.87 + 3 × 24.53 = 75.5B total. This estimate assumes experts of equal size and no shared expert.
The active count does not change with the cut: 1.9 + 24.5 × 3 × 8/384 is 3.4B again. Now turn parameters into bytes.
B equals P times b, over 8.
Multiply the parameters P by the bits b each one needs. Divide by 8 bits per byte.
After the cut in NVFP4: 26.4B × 4.5 / 8 = 14.9 GB. Before the cut: 75.5B × 4.5 / 8 = 42.5 GB, which does not fit in 32 GB. The published checkpoint is about 20 GB; its last four layers are MXFP8, and the full breakdown is not disclosed.
The yellow bar is weight memory. The lines are a 32 GB Mac and a 128 GB DGX Spark. Move the experts per layer and pick a precision.
Sizes use our estimate (dense part 1.9B, 24.5B of experts at 128 per layer) and weights only. NVFP4 is 4 bits plus one 8-bit scale per 16 values (Thinking Machines' 4-bit training post); MXFP8 is 8 bits plus one 8-bit scale per 32. The 32 GB Mac and DGX Spark are the launch targets.
Thinking Machines gives speed and local hardware as the reason for the cut. Fitting in one device's memory is the big gain: no splitting across machines, and fewer bytes to read per step.
The failure. Weights are not the only memory. The model card lists a context window of up to 1M tokens, and the attention cache grows with context. The symptom is a model that fits at short prompts and runs out of memory at long ones. Measure memory as the context grows. The fix is to cap the context for the device or shrink the cache.
Chapter 8
Compare usage pruning with reconstruction pruning, router-weighted pruning, merging and skipping
Usage is one way to rank experts. Published methods use other signals, and most cut after training with no heal. The table lists the ones with a primary source.
| Method | How it chooses | When | Reported result |
|---|---|---|---|
| Usage pruning | Keep the 128 most used experts per layer | Midtraining, then a 1T-token heal | Recovered pre-cut quality (Inkling 2 Mini) |
| Reconstruction pruning | Try every subset of r experts; keep the one whose layer output best matches the original on 128 C4 sequences | After training | Mixtral 8x7B, 8 to 6 experts: average 64.22 against 67.58 (Lu et al., 2024) |
| Dynamic skipping | Skip the second expert when its gate is below a per-layer fraction of the first | At inference | A further 1.2 to 1.3 times speedup with a slight drop (Lu et al., 2024) |
| REAP | Keep experts with the highest average of gate times output size | After training, one shot | Near-lossless code generation at 50 percent of experts pruned on Qwen3-Coder-480B and Kimi-K2 (Lasby et al., 2025) |
| Merging (M-SMoE, MC-SMoE) | Group experts, merge each group weighted by usage, then compress | After training | Up to 80 percent memory cut with little loss (Li et al., ICLR 2024) |
REAP (router-weighted expert activation pruning) asks how much an expert changes the output when it runs. Call the tokens that route to expert j Xj.
S-j equals the average, over the tokens x in X-j, of g-j of x times the norm of f-j of x.
For each token that reaches expert j, multiply its gate g-j by the size of the expert's output. Average over those tokens. That is S-j, a measure of how much expert j moves the output when it runs.
With made-up numbers: expert A serves 900 tokens with mean gate 0.06 and output size 1.5, so S = 0.09. Expert B serves 50 tokens with gate 0.62 and size 3.5, so S = 2.17. Usage keeps A. REAP keeps B.
Each column is one expert: its token count and its REAP score. Pick a criterion and a keep count.
Illustrative toy: counts, gates and output sizes made up. "Lost contribution" is count times gate times output size, summed over the cut experts. The REAP formula is from Lasby et al. (2025).
The failure. Merging can look fine on multiple-choice tests and fail on generation. Lasby et al. argue that a merged expert is one fixed average, so the router loses its control over the two originals. The symptom is fluent text getting worse while multiple-choice scores hold. Measure on generative tasks, not only multiple choice. The fix they propose is to prune instead of merge.
Chapter 9
Keep the numbers, the checklist and the code in one place
An MoE stores many experts and runs a few. Usage is skewed, so a few experts carry most of the routing. Inkling 2 Mini kept the 128 most used of 384 in each layer, at midtraining. The cut breaks routing and deletes knowledge. A 1T-token distillation from a larger Inkling repaired it, and the model now fits in about 20 GB.
| Term or number | Value | Source |
|---|---|---|
| Experts per layer, start | 384, top 8, sparsity 48 | Announcement |
| Experts per layer, shipped | 128, top 8, sparsity 16 | Model card |
| When the cut happened | Once, during midtraining | Announcement |
| Heal | 1T tokens distilled from a larger internal Inkling | Announcement |
| After the heal | SFT, then RL of 2.2T tokens over 2,000 steps | Announcement |
| Parameters | 26.4B total, 3.4B active, 5.4B effective with three passes | Model card |
| Checkpoint | About 20 GB, NVFP4 with the last four layers in MXFP8 | Model card, announcement |
| Pre-cut size | About 75.5B total (our estimate) | Chapter 7 derivation |
| Teacher size, usage data, logits or text | Not disclosed | None |
pythonimport torch, torch.nn.functional as F def usage(topk_idx, n_experts): # topk_idx: (T, k) expert ids for one layer c = torch.bincount(topk_idx.flatten(), minlength=n_experts) return c.float() / topk_idx.numel() # u_e = c_e / (k T) def distill_loss(student_logits, teacher_logits, tau=1.0): # logits: (T, V) for the same T token positions; teacher is frozen log_ps = F.log_softmax(student_logits / tau, dim=-1) log_pt = F.log_softmax(teacher_logits / tau, dim=-1) kl = F.kl_div(log_ps, log_pt, log_target=True, reduction="batchmean") return tau ** 2 * kl # sum_v pT log(pT / pS), times tau^2 # heal loop: one step with torch.no_grad(): t_logits = teacher(tokens) # (B*T, V) loss = distill_loss(student(tokens), t_logits, tau=1.0) loss.backward(); opt.step(); opt.zero_grad()
Now press Present or Teach and explain from memory: why usage is skewed, what the cut breaks, and how the distillation loss repairs it. Then go back to the heatmap, prune to one third, and say which tokens lost an expert before you press Heal.