A field guide to native multi-token prediction on a mixture-of-experts model, and an honest ledger of where the speed is still hiding.
Speculative decoding buys speed by guessing several tokens cheaply, then checking them all in a single expensive pass. The trick only works because on this hardware, checking four tokens costs almost exactly what checking one does.
The classic setup (Leviathan et al., 2211.17192) uses a small draft model beside a big one. Self-speculative decoding drops the second model: a lightweight MTP head bolted onto the backbone does the drafting, in the DeepSeek-V3 style. The head predicts token t+1 from the backbone's own hidden state, then chains: each draft feeds the next.
n_confirmed=1. Correctness never depends on the draft being right: every emitted token is argmax(full-vocab verify), so a bad guess costs throughput, never quality.The dense matmuls that dominate a forward pass are memory-bandwidth bound at decode. Widening the batch from 1 to 4 tokens rides the same weight read, so it is nearly free. The mixture-of-experts routing is the one part that is not.
M is the verify width , the number of token positions the big model scores in a single forward pass. “Free-M” is the name for the finding this section proves: going from M=1 to M=4 costs almost nothing extra, because a decode pass is bottlenecked on reading the weights out of memory, not on the arithmetic. Four tokens ride the same weight read, so checking four is nearly as cheap as checking one. That flatness is the entire reason speculative decoding pays.
A cycle is the repeating unit drawn in section 01. Broken down by step it is three moves:
Broken down by time, that same cycle is a wall-clock budget: the stacked bar at the foot of this section shows one cycle is about 34 ms, of which verify is 77%, drafting is 21%, and host bookkeeping is the rest. So “step” tells you what happens; “time” tells you where the milliseconds go , and the winning lever in section 05 attacks that 21% draft slice.
The model shapes every decision below. It is a mixture-of-experts and a hybrid-attention stack, and both facts are why the usual speculative-decoding playbook does not transfer wholesale.
2048, vocab 248320, head_dim 256. 4-bit weights at group size 64. The 248320 vocab is the specific number the winning lever exploits.Drafting deeper wins more tokens per cycle only until the added draft cost and falling accept rate stop paying. A per-sequence controller finds that peak instead of guessing it.
It maximizes score(d) = E[tokens](d) / time(d), using an EMA of the conditional accept rate at each depth and the measured per-depth cost. Depth 0 is a park (decode normally, no speculation); a global hand-back drops the whole sequence to stock decode when MTP is a net loss. This objective subsumes the published heuristics (SpecDec++, DISCO, llama.cpp's p_min): they all approximate the same expected-tokens-per-unit-time argmax.
The draft head spends most of its time projecting a hidden state onto all 248,320 vocabulary rows, only to take one argmax. Project onto the first N rows instead and the draft gets cheaper with no change to what gets emitted.
This is safe by construction. The full-vocab backbone verify still decides every token, so a narrower draft vocabulary can only ever cost accept rate, if a true next token's id happens to land beyond N. It can never change the output. Qwen3's byte-level merges put common tokens at low ids, so a generous N covers essentially everything the model generates.
argmax(full verify), the slice is a pure cost cut. The one hazard is the repetition-penalty processor, which gathers and scatters at token-id columns: an id beyond N would corrupt the reduced row on the GPU (no bounds check), so we filter the penalty context to ids < N once per cycle.mtp_forward(…, draft_vocab=N), plus the penalty-context filter. Verify untouched. Off by default (draft_vocab=0) reproduces the old path byte-for-byte.Cheaper drafts should make deeper chains affordable, so raising max_draft to 4 looked like a free stack on top. It is not. Measured, it lowers throughput: the controller only picks depth 4 for 125 of 1458 cycles and depth 5 for 15, and the added draft cost plus the extra expert union (section 02) outweigh the rare deep hit. This is the falling right shoulder of the score hump, measured rather than argued.
| config | decode p50 | accept | tok/cycle | verdict |
|---|---|---|---|---|
| 131072 · depth 3 | 73.6 | 0.813 | 2.348 | keep |
| 131072 · depth 4 | 71.0 | 0.823 | 2.316 | diminishes |
| 65536 · depth 4 | 73.3 | 0.788 | 2.410 | diminishes |
Note the run-to-run spread from thermals: 131072 gave [76.5, 70.7] in one session and [76.8, 75.2] in another. The honest read of the whole lever is +4 to +7%, landing native MTP at ~74–76 t/s, which is omlx parity, not yet 80.
The reduced-vocab lever leans on an assumption: the model's hot tokens sit at low ids. They mostly do, thanks to Qwen3's byte-level merges, but not perfectly. So the natural refinement is to stop projecting the first N rows and instead project the N most-frequently-emitted rows, mapped back through an id table. Same projection cost as a contiguous slice, but every column is now a token the model actually uses, so a narrow N should hold the accept rate that the contiguous slice only keeps at a much wider 131072. This is FastMTP's vocab-compression idea (2509.18362) applied to the draft head.
The first map was built from Mira's chat history, and it refuted itself. It scored beautifully on the corpus it was trained on and came apart on held-out prompts, roughly 9% of true tokens uncovered: textbook train-on-test. The fix was a broader map, built from chat plus the model's own eval generations (13,712 distinct emitted ids) and held out from the bench prompts. On that map the mechanism is genuinely real.
But vindicating the mechanism is not the same as banking speed. The already-shipped first-131072 slice is also a wide, cheap draft with near-full accept. Measured head to head, remap's net gain over it is about 1% in decode throughput, well inside the thermal noise of a session this hot, and it costs a drift-prone map file plus id-translation on the hot path every cycle. The honest disposition: the mechanism is proven, the increment is real but marginal. The banked lever stays first-131072; remap is kept gated behind an env flag and documented, not switched on.
EAGLE-2/3 win by drafting a branching tree of candidates instead of a single chain. On this model that move is rejected, for two structural reasons the diagram makes concrete.
The other way to go faster is to make the head guess better, so more drafts survive. We already ran that experiment to its end, and it hit a capacity ceiling.
We built the FastMTP recipe (2509.18362) twice: a single-step self-distilled head fine-tune, and a multi-step recursive version that carries the head's own hidden state forward, which is the HASS exposure-bias fix (2408.15766). On the fixed dense head the ceiling was hard: +2 points at depth 3 only, with depth 1 and 2 immovable. A stronger head plateauing is what makes retraining the weaker MoE head low expected value. So we pivoted from the accept lever to the cost lever in section 05, and it worked.
The MoE-specific accept ideas in the literature do not rescue it either, for reasons specific to a resident 32GB deployment:
Shrinks the verifier's expert set for a 1.29×. But approximating which experts run risks the losslessness invariant, which we will not trade on a resident model.
1.45×, but the win comes from hiding expert-offload latency. Our experts are resident in 32GB, so there is no offload latency to hide.
MoE-specific expert eviction on Qwen3-30B-A3B. Same story: a memory-pressure tool, and this deployment is not expert-memory bound.
Every emitted token is the backbone's own greedy pick, yet the text is not bit-for-bit identical across draft settings. Both statements are true, and the gap between them is where a careless claim gets made.
argmax(full-vocab verify), the backbone's own choice. What it does not promise is identical bytes , see below.So “lossless” here means same decision rule, same quality, not same output text. The bytes can still shift because the tie-breaking arithmetic differs by batch width on this hardware.
The invariant emit = argmax(full-vocab verify) holds by construction. But changing the draft changes which batch widths the verify runs at, and on M5 the batched attention numerics (mlx#3897, mlx#3860, both closed won't-fix, so we always run MLX_ENABLE_TF32=0) resolve argmax ties slightly differently at different widths. That is the same non-determinism that already makes batch-1 and batch-4 diverge in production. We verified by reading divergent outputs side by side that they are equal quality, not regressions.
3% can be one 3% lever or three 1% increments, as long as they add without eating each other. This is the running total, honest about what composes and what does not.
The banked win. Cost lever, lossless by construction, zero accept loss at N=131072.
Draft through the same penalty processors verify will apply, so the head predicts the penalized target. Already shipped, small and free.
The +7.4 accept points were measured at width 16384, where the contiguous slice is starved to 0.692. At the shipped 131072 the contiguous slice already reaches 0.857, so there is almost no hot-token mass left to recover: the gain does not transfer to the operating point. Net ~1%, inside thermal noise, plus a drift-prone map. Document-only, kept gated.
Measured to lower throughput. The controller rarely picks it and the MoE union tax outweighs the rare deep hit.
Exhausted only on the dense head , FastMTP and HASS both plateaued there. The MoE head, at 0.83 accept, was never retrained, and a weaker head can hold more headroom, not less. The distill harness is already built, so the probe is a training run, not new code. The one lever here with compounding headroom toward 80.
Rejected structurally: 30 linear layers cannot fork recurrent state cheaply, and a tree inflates the MoE expert union faster than a chain.
AcceptMoE-style. Risks the losslessness invariant on a resident model. Not worth trading.
DraftExpert and friends. Their gain is hiding offload latency; our experts are resident in 32GB, so there is nothing to hide.
Chasing 80 harder, I put the engine and the literature through a twelve-way audit and turned two of the reviewers loose on this very page. The blunt result: the 76.0 base is softer than it looks. It is the top of a noisy pass-pair whose low end is 70.7, and every number here was measured at short context while production serves 131072. I later profiled that taper: decode falls from 73 t/s at 2k to 25 at 32k to 11 at 64k as the KV read takes over, so the 76 base is a 2k number and the served regime is 7×+ slower , “80” describes a benchmark, not the product. So the honest reading is that 80 is an aspiration, not a delivery , but the audit turned up more than trims. The first card below is the surprise: the verify batch never coalesces its expert gather because MLX gates the sort at a width the single-stream batch never reaches, and flipping it on is bit-identical and cut ~20% off every MoE forward in a resident A/B that held steady across 32 cold layers , a one-time jump that the resident full-model A/B then measured at +4.6% end-to-end: real, lossless, and dead-consistent, but a third of the projection, so it lifts 76 to ~79.5 without clearing 80. The one lever with compounding headroom is still retraining the MoE head, ruled out so far only on the dense one: a faster head lifts accept, which multiplies every cycle after. Both are unrun. Before I am allowed to write “exhausted”, they have to be.
Every cycle marshals the full token history to replay the repetition penalty, but the penalty only reads the last 64 tokens. A host-only probe measured the waste: 3.3 ms/cycle at 64k context, and bounding it to the window is byte-identical. That is ~10% decode at 64k (2–5% at 16–32k), paid only at long context , exactly the served regime every headline skipped.
MLX sorts the MoE expert gather only at ≥64 routed indices; a single-stream verify batch routes 4×8=32, so it runs unsorted and an expert two verified tokens share is read twice. I measured the overlap live: 20.6 distinct of 32 (~36% reuse). Forcing the sort on is bit-identical (|Δ| = 0) and the win scales with reuse , the coalescing signature. A resident A/B then streamed the verify forward through 8–32 distinct cold layers (a 14 GB working set, cache-defeating) and the speedup held rock-steady at on/off 0.80 , ~20% off every MoE forward, not decaying with scale. Those forwards are 55% of the cycle, so it projected to +12% end-to-end. The resident full-model A/B then settled it: 36 paired-interleaved reps with the model fully resident gave +4.6% end-to-end, 76 → ~79.5 , ON faster in 36/36 pairs, byte-identical output, accept unchanged. Real and free, but a third of the projection: MoE is a smaller share of the cycle than 55% once the whole stack is resident, so this trims rather than clears 80. The fix is a threshold, not a kernel: sort at ≥16 (catches verify M=2–7, spares single-token decode), via Mira's own MTP patch.
After the head's drafts, scan the context for the current suffix and append the following tokens into the same verify. Free draft tokens, no head forward, and it stays a linear chain, so the GatedDeltaNet recurrence never forks , the exact blocker that killed the tree. Large on code and edits, ~0 on prose. Untried.
Penalty-aligned drafting was added to lift accept, but the reduced-vocab knee already covers the hot penalized tokens. The A/B settled it: at draft_vocab 131072, rep-penalty 1.15, accept holds with it off (0.767 on / 0.776 off), so the per-draft replay is dead overhead , safe to drop. The t/s it saves sits below the cross-process noise floor, so it is cleanup, not a lever.
This work moved forward mostly by overturning things I had asserted. The reversals are the most useful thing here, because each one marks a place where a plausible claim survived until a measurement killed it.
quantized_matmul scaling: flat to M=4. The verify matmul was already amortized, zero headroom there. The gap was never the kernel.The discipline that came out of it: if a mechanism can settle a question, run it before asserting, and label every claim as measured, assumed, or not yet checked. Every number on this page is from a bench run with production down and MLX_ENABLE_TF32=0, or it is cited.
score(d) subsumes as approximations of expected tokens per unit time.SpecDec++: Kaixuan Huang et al. (2024), “SpecDec++: Boosting Speculative Decoding via Adaptive Candidate Lengths”.MLX_ENABLE_TF32=0 and why losslessness is not byte-identity.mlx#3897: “Batched (padded/masked) attention diverges from single-sequence on M5, not on M3 Max”. mlx#3860: “fp32 matmul silently defaults to TF32-class precision”.