Nandai AI
Sign In

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.

~1,005 wordsTechArticle + HowTo + Speakable JSON-LDZero-Upload Client RAM
Execution Pipeline ArchitectureLocal Browser RAM & Apple Silicon
01MTP Propose kDrafts k follow-on tokens vialightweight head02Batch Verify 1xSweeps 2.45–3.15 GB MoEweights once for k+103Lossless AcceptAccepts exact matching tokensvia target logits04Amortized SpeedupEffective tok/s scales by 1 +E[accepted]
  1. 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.

  2. 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.

  3. 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.

  4. 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.

Speculative Architecture Comparison: External Draft Model vs. Qwen 4 Native MTP
System ParameterExternal 0.8B Draft GGUFQwen 4 Native MTP Head
Setup ComplexityManage 2 GGUF files + vocab checkSingle unified GGUF checkpoint
Extra VRAM & KV Allocation0.8–1.5 GiB weights + separate KVShares base KV & hidden states
Domain Alignment on CodeWeak draft rejects domain tokensTrained jointly on target hidden states
Output Distribution FidelityLossless via rejection sampling100% 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.

Actionable Checklist
  • 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

MTP Speculative Amortization Across Deterministic Code vs. Open-Ended Prose
Workload PatternMean Accepted Tokens / SweepEffective Speedup Multiplier vs. Batch-1
Strict JSON / OpenAPI / SQL BoilerplateHigh syntactic predictability (alpha ≈ 0.80–0.88)~2.5x–3.2x effective tok/s at lossless parity
TypeScript / C++ / Python RefactoringStructured identifier & bracket patterns~2.0x–2.6x effective tok/s per MoE sweep
RAG Extraction / Document CitationsVerbatim entity & phrase continuation~2.2x–2.8x effective tok/s per MoE sweep
High-Temperature Creative ProseLow token predictability (T >= 0.8)~1.2x–1.5x modest speedup (graceful fallback)
Additional Draft VRAM RequiredExternal Draft Model: +0.8–1.5 GiBNative 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.

Check Hardware Bandwidth Roofline →
FOUNDER_999_LOCK · 67% OFF ALL-IN-ONE PRO

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.

Publisher & Creator Partner Network
Embed Zero-Upload Tools & Earn 40% Recurring

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 →
FAQ · DIRECT ANSWERS

Local Apple Silicon AI, Zero-Upload Privacy & Post-Quantum Web Security — FAQ

05 Questions
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).
Founder Pro $9.99/mo · 67% Off1-tap Stripe Checkout · Instant ?ref= Free Months · 40% Recurring Partner Payouts
1. Subscribe in 1 TapFOUNDER_999_LOCK

Unlock All 19 Pro Studios + Mac App

Lock $9.99/mo Founder Pro (reg. $29.99 — 67% off), $119/yr Web Annual (-34%), or $299/yr 5-Mac + Web Pro.

Redeem Code
2. Get 6 Months FreeZERO OTP

Mint Your ?ref= Link Instantly

Give friends 67% off ($9.99/mo). Every paid friend adds 30 days of Pro free to your account (up to 6 months).

Dashboard: /refer · Rules

3. Creator & Publisher Cash90-DAY COOKIE

Earn 40% Monthly · 30% Annual

Earn 40% recurring monthly until cancel + 30% annual & every renewal, or embed our free tools with data-ref.