Inference, Serving & Production·Question 47 of 76Advanced

Go deeper on speculative decoding: acceptance-rate math, modern drafters (EAGLE-3, built-in MTP, n-gram lookup, parallel block drafters), and when it backfires.

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

The math. Let α be the per-token acceptance rate (draft token accepted by the target's rejection-sampling check). Drafting k tokens per cycle, the expected tokens emitted per target forward pass is (1 − α^(k+1)) / (1 − α) (Leviathan et al.). At α = 0.8, k = 4: ~3.4 tokens per target pass. Wall-clock speedup ≈ that, divided by the cycle cost 1 + k·c where c is the drafter's per-token cost relative to the target - so a drafter must be both well-aligned (high α) and cheap (low c). α is empirical and domain-dependent: high on code, boilerplate, extraction; lower on open-ended creative text. Larger k has diminishing returns (α^k decay wastes draft work past the first rejection), so k is tuned per workload (~4-8 typical).

Full worked answer

The math. Let α be the per-token acceptance rate (draft token accepted by the target's rejection-sampling check). Drafting k tokens per cycle, the expected tokens emitted per target forward pass is (1 − α^(k+1)) / (1 − α) (Leviathan et al.). At α = 0.8, k = 4: ~3.4 tokens per target pass. Wall-clock speedup ≈ that, divided by the cycle cost 1 + k·c where c is the drafter's per-token cost relative to the target - so a drafter must be both well-aligned (high α) and cheap (low c). α is empirical and domain-dependent: high on code, boilerplate, extraction; lower on open-ended creative text. Larger k has diminishing returns (α^k decay wastes draft work past the first rejection), so k is tuned per workload (~4-8 typical).

Modern drafters. Separate small models need a matching tokenizer and still burn sequential time drafting. Self-drafting removes that. Medusa, which bolted extra decoding heads onto the target, is now mostly historical context (vLLM removed it in v0.33). EAGLE, now at EAGLE-3, autoregresses in the target's feature space (reusing its internal representations), which gets substantially better acceptance than token-level heads, verified over a tree of candidate continuations rather than a single chain (tree attention verifies multiple branches in one pass - raising expected accepted length). Prompt-lookup/n-gram drafting retrieves candidate spans from the existing context - zero model cost, brutal effectiveness on tasks whose outputs copy inputs (editing, extraction, RAG quotes). Models trained with multi-token prediction (MTP) modules, DeepSeek-V3 being the well-known example, ship their own drafter, which engines can use directly with no separate training.

The newest family drafts in parallel. DFlash uses a lightweight block-diffusion model, conditioned on target-model features, to propose a whole block of tokens in one forward pass, and reports over 6× lossless speedup. DeepSeek's DSpark pairs a parallel drafter with a lightweight sequential module and sets each request's verification length from confidence estimates; in DeepSeek-V4 serving it runs 60 to 85% faster per user than MTP-1 at matched throughput. Parallel drafting changes the cost term: drafting k tokens no longer costs k sequential drafter steps, so the optimal k is set mainly by acceptance decay and verification cost. Engines have followed by choosing verification length per request from live acceptance estimates (vLLM added this in v0.30) rather than a fixed k. vLLM, SGLang and TensorRT-LLM have all added DFlash and DSpark support alongside EAGLE-3 and MTP.

When it backfires: (1) high-batch serving - verification consumes compute that regular decoding of other sequences would have used; when the fleet is compute-bound, spec decoding reduces aggregate throughput, so it's primarily a low-batch/latency-tier tool; (2) low α - drafting overhead with nothing accepted (mismatched domains, high temperature settings hurt); (3) memory - a draft model or extra heads eat KV/weight budget that could have been batch size; (4) engineering complexity - two models' KV caches, tree verification correctness, scheduler interaction. Always A/B on production-shaped traffic: measure ITL and aggregate goodput and cost, per domain.

What a good answer covers

  • Let α be the per-token acceptance rate (draft token accepted by the target's rejection-sampling check)
  • Drafting k tokens per cycle, the expected tokens emitted per target forward pass is (1 − α^(k+1)) / (1 −…
  • At α = 0.8, k = 4: ~3.4 tokens per target pass
  • Wall-clock speedup ≈ that, divided by the cycle cost 1 + k·c where c is the drafter's per-token cost…
  • Larger k has diminishing returns (α^k decay wastes draft work past the first rejection), so k is tuned…

Key terms: The math · Modern drafters · Medusa · EAGLE · EAGLE-3 · tree · Prompt-lookup/n-gram · multi-token prediction (MTP) · DFlash · DSpark

Interviewer follow-ups to expect

  1. Why does temperature affect acceptance rates?

  2. Sketch how tree verification amortises one target pass across candidate branches.

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep