NVIDIAExplainer
Co-Designing AI Models Using Speculative Decoding for Faster LLM Inference
Summary
Speculative decoding accelerates large language model inference by having a smaller draft model propose multiple tokens and a target model verify them in parallel, preserving the standard output sequence under its acceptance criteria. It reduces decoding iterations and increases target-model arithmetic intensity, but speedup depends on acceptance length, verification time, draft latency, batch size, and hardware behavior. For attention-heavy workloads, the recommended starting point is D = 128/G - 1, where G is query heads per KV head; larger D values should align G × (1 + D) with 128-token kernel tiles. The remaining guidance covers compute-bound GEMMs, low-latency draft-cost tradeoffs, and choosing among external models, EAGLE-3, MTP, DFlash, DSpark, and suffix or n-gram methods; SPEED-Bench, TensorRT LLM, and NVIDIA/Model-Optimizer support measurement, training, and quantization workflows.
Context
Autoregressive LLM decoding generates tokens sequentially, and the optimal speculative-decoding configuration varies with batch size, attention behavior, latency targets, workload, hardware, and draft-model costs.
Approach / What changed
Use a smaller draft model or another draft mechanism to propose D tokens, verify them in parallel with the target model, and select draft length and mechanism using acceptance length, verification performance, draft overhead, and training and deployment costs.
Takeaways
Speculative decoding can move target-model GEMMs toward the compute-bound region without increasing KV cache capacity pressure.
When attention dominates, D = 128/G - 1 is recommended as a starting point; larger draft lengths should align G × (1 + D) with multiples of 128.
SPEED-Bench measures acceptance length on realistic workloads, while TensorRT LLM can quantify draft overhead and NVIDIA/Model-Optimizer provides examples for EAGLE-3, DFlash, and DSpark.
Source and freshness
- Source
- developer.nvidia.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.