Multi-Token Prediction (MTP) Speculative Decoding: Breaking Batch-1 Bandwidth Ceilings on Qwen 4
How native MTP speculative heads verify multiple candidate tokens inside a single MoE forward weight sweep without any separate draft model.
Batch-1 MoE generation is strictly memory-bandwidth bound. Qwen 4’s native MTP head predicts and verifies k candidate tokens concurrently in one DRAM sweep.
- Step 01 · MTP Propose k
Drafts k follow-on tokens via lightweight head. Batch-1 LLM decode uses under 5% of modern GPU/Apple Silicon ALU compute because DRAM bandwidth stalls waiting on 2.45–3.15 GB weight reads per token.
- Step 02 · Batch Verify 1x
Sweeps 2.45–3.15 GB MoE weights once for k+1. Verifying k = 3 to 5 candidate tokens concurrently costs nearly the same DRAM bandwidth as verifying 1 token, turning idle compute FLOPs into extra tokens/sec.
- Step 03 · Lossless Accept
Accepts exact matching tokens via target logits. Unlike classic speculative decoding requiring a separate 0.5B–1.5B draft GGUF file (and risking tokenizer mismatch), Qwen 4 embeds its MTP prediction head inside the base weights.
- Step 04 · Amortized Speedup
Effective tok/s scales by 1 + E[accepted]. Because speculative rejection sampling preserves the exact target output probability distribution, MTP speedup introduces zero accuracy or syntax degradation.
1. Arithmetic Intensity Physics: Why GPU Compute Sits 95% Idle at Batch=1
Every hardware accelerator has a ridge arithmetic intensity equal to Peak_FLOPs divided by Memory_Bandwidth_Bytes_per_Second. On an RTX 4090 (82.6 TFLOPS FP16 / 1,008 GB/s), that ridge point sits near 82 FLOPs per byte read; on an Apple M4 Max (546 GB/s), the ridge still exceeds 50 FLOPs per byte. Yet generating a single token (batch size = 1) performs just 2 FLOPs per weight byte loaded from memory.
That means single-stream autoregressive decoding operates deeply inside the memory-bandwidth-bound regime—roughly 95% of your GPU’s tensor cores sit completely idle waiting on DRAM controllers to stream active MoE weights. Interestingly, processing 4 or 8 tokens concurrently inside a single forward pass raises arithmetic intensity toward 8–16 FLOPs per byte while reading the exact same shared attention and overlapping expert weight matrices once.
Speculative decoding exploits that exact hardware asymmetry: by proposing a short draft chain of k candidate tokens and feeding all k + 1 tokens into the target model as a micro-batch in one pass, the GPU verifies every candidate for nearly the memory bandwidth cost of a single token.
Arithmetic_Intensity(B) ≈ 2 * B FLOPs / byte
Effective_TPS = (1 + E[accepted_tokens_per_step]) * (BW_GBps / B_active_sweep(k))2. Native MTP Head vs. External Draft GGUF Models
Historically, practitioners wanting speculative speedup in llama.cpp had to hunt down a compatible small draft model (for instance pairing a 0.8B model alongside a 32B model), manage two GGUF downloads, verify identical BPE vocabulary and chat templates, and surrender another 1 GiB of VRAM plus duplicate KV cache allocation. Any mismatch between draft and target tokenizers broke speculation entirely.
Qwen 4 35B-A3B eliminates external draft plumbing by integrating a Multi-Token Prediction (MTP) head directly into the main checkpoint training objective. Instead of training solely on next-token cross-entropy, the final hidden representations additionally project k future token logits through lightweight tied/shared prediction layers. The MTP head shares exact vocabulary IDs, exact hidden state semantics, and exact rotary context embeddings with the main model.
Crucially, MTP speculative execution inside a MoE model faces one unique subtlety: if k candidate tokens route to slightly different sets of sparse experts across a layer, the active FFN read footprint B_active_sweep(k) grows sub-linearly relative to k=1 (for instance rising from 2.95 GB for 1 token toward ~4.5–6.0 GB when verifying 4 distinct tokens across all layers), still yielding large net speedups whenever average acceptance exceeds 1.8 tokens.
| System Parameter | External 0.8B Draft GGUF | Qwen 4 Native MTP Head |
|---|---|---|
| Setup Complexity | Manage 2 GGUF files + vocab check | Single unified GGUF checkpoint |
| Extra VRAM & KV Allocation | 0.8–1.5 GiB weights + separate KV | Shares base KV & hidden states |
| Domain Alignment on Code | Weak draft rejects domain tokens | Trained jointly on target hidden states |
| Output Distribution Fidelity | Lossless via rejection sampling | 100% lossless via target verification |
3. Geometric Acceptance Math and MoE Expert Union Sizing
Let alpha denote the per-token acceptance probability of the MTP predictor on a given task. Under standard speculative verification across depth k, expected accepted tokens per verification step follow the truncated geometric series E[accepted] = sum_{i=1..k} alpha^i (plus 1 guaranteed correction/next token from the target verifier). At alpha = 0.80 and draft depth k = 4, expected output per forward sweep reaches 1 + (0.80 + 0.64 + 0.512 + 0.410) = 3.36 tokens.
Unlike dense transformers where verifying 5 tokens reads identical weight bytes to 1 token, MoE verification evaluates the union of experts selected by those 5 candidate tokens. If token 1 activates experts {2, 9} and token 2 activates experts {2, 14}, only 3 experts load from memory rather than 4. Because adjacent code, JSON, and prose tokens strongly exhibit expert locality—especially for punctuation, indentation, and repeated identifiers—the active expert union grows sub-linearly with k.
Even accounting for a 1.35x wider expert union read during a 4-token sweep, emitting 3.36 accepted tokens in a single sweep delivers 3.36 / 1.35 ≈ 2.49x real wall-clock throughput acceleration over batch-1 single-token decode.
4. Tuning Draft Depth (k) Across M4 Pro, M4 Max, and RTX 5090
Optimal draft depth k depends directly on the compute-to-bandwidth ratio of your target silicon and task entropy. On high-bandwidth, high-TFLOPS GPUs like the RTX 4090 (82.6 TFLOPS) and RTX 5090, verify sweeps up to k = 4 or k = 5 remain comfortably inside compute ceilings for code and structured extraction. Conversely, on bandwidth-focused laptop SoCs such as a base 16 GB M4 or 24 GB M4 Pro executing lower-compute GPU shader cores, pushing k past 3–4 can shift verification from memory-bound into ALU-bound territory during dense non-overlapping expert unions.
When running stochastic creative brainstorming at temperature T >= 0.8 and top-p = 0.95, alpha naturally falls toward 0.40–0.50. Adaptive draft schedulers drop k automatically from 4 down to 1 or 2 when consecutive rejections appear, avoiding wasted expert union reads while keeping deterministic tool-calling at full speculative speed.
- Set draft depth k = 3–4 for structured TypeScript, Python, SQL, and JSON tasks.
- Measure real expert-union overhead vs accepted token ratio using llama-bench -n 128.
- Keep greedy or low temperature (T <= 0.2) for maximum MTP acceptance rate.
- Ensure Gated-DeltaNet recurrent state rollback supports clean multi-token checkpointing when rejecting draft tails.
5. Verifying Exact Distribution Equivalence & GDN State Rollback
A persistent engineering concern with any multi-token predictor is silent quality drift. Speculative verification prevents quality loss mathematically: whenever the target forward sweep checks candidate token c_i against target distribution p(x), c_i is accepted unconditionally if p(c_i) >= q(c_i) or with probability p(c_i)/q(c_i) otherwise, resampling the rejected position from the normalized residual distribution max(0, p(x) - q(x)). This guarantees zero statistical divergence from non-speculative decoding.
Inside Qwen 4’s hybrid 30 GDN + 10 QSA topology, rejecting candidate tokens partway through a k-token sequence additionally requires rolling back the 30 Gated-DeltaNet recurrent state matrices S_t to the exact checkpoint immediately following the last accepted token. Modern Metal and CUDA inference runtimes snapshot those compact ~15 MB GDN state buffers cleanly before launching the speculative verify pass, ensuring bit-exact recurrence continuity without recomputing history from scratch.
MTP Speculative Amortization Across Deterministic Code vs. Open-Ended Prose
| Workload Pattern | Mean Accepted Tokens / Sweep | Effective Speedup Multiplier vs. Batch-1 |
|---|---|---|
| Strict JSON / OpenAPI / SQL Boilerplate | High syntactic predictability (alpha ≈ 0.80–0.88) | ~2.5x–3.2x effective tok/s at lossless parity |
| TypeScript / C++ / Python Refactoring | Structured identifier & bracket patterns | ~2.0x–2.6x effective tok/s per MoE sweep |
| RAG Extraction / Document Citations | Verbatim entity & phrase continuation | ~2.2x–2.8x effective tok/s per MoE sweep |
| High-Temperature Creative Prose | Low token predictability (T >= 0.8) | ~1.2x–1.5x modest speedup (graceful fallback) |
| Additional Draft VRAM Required | External Draft Model: +0.8–1.5 GiB | Native Qwen 4 MTP Head: ~0.1–0.3 GiB built-in |
Connected Workflows & Technical References
Launch pre-configured interactive sandboxes or read paired Academy, Guide, and GGUF specifications.
Draft technical papers with local GGUF inference in Unified Memory, eliminate hallucinated references via offline DOI/ISBN/arXiv checksum math, and publish a fast static HTML5 monograph.
Screen attributed central-bank, SEC EDGAR, CFTC, and on-chain series at 120Hz, test DestinyScript hypotheses in 48.2 ms per 1M ticks locally, and publish clean investor research portals.
Run Every Studio Unlimited at $9.99/mo (Web Cloud + 5 Apple Silicon Macs)
Consolidate $130+/mo of separate writing, PDF, citation, cutout, video, and 1-second charting subscriptions into one local-first workspace — backed by a 14-day refund window and 1-click cancel.
Add our 1-line Shadow DOM widget to your blog or share your partner link for 40% monthly / 30% annual recurring revenue.
More in Local Apple Silicon AI, Zero-Upload Privacy & Post-Quantum Web Security (8 Sibling Playbooks)
All 84 Articles →Local Apple Silicon AI, Zero-Upload Privacy & Post-Quantum Web Security — FAQ
- Does MTP speculative decoding change Qwen 4 output quality?
- No. Rejection sampling against the target model’s forward verification pass preserves the exact mathematical output distribution of standard single-token decoding.
- Why does MTP speed up Qwen 4 without needing a second draft GGUF?
- Qwen 4 integrates a native Multi-Token Prediction head directly inside the base checkpoint weights, sharing the exact vocabulary and hidden states without extra draft files.
- Which tasks benefit most from MTP speculative decoding?
- Low-entropy deterministic workloads—TypeScript/Python/C++ coding, JSON schemas, SQL generation, and RAG entity extraction—commonly verify 2.0–3.2 tokens per sweep.
- How does Gated-DeltaNet handle rejected speculative tokens?
- Because the 30 GDN layers keep recurrent state under ~15 MB, runtimes snapshot and restore the exact checkpoint at the last accepted token cleanly.
- Does MTP help during long prompt prefill?
- No. Prompt prefill already batches all prompt tokens concurrently and is compute-bound; MTP accelerates autoregressive token generation (decode).