Speculative decoding speedup calculator

Speculative decoding trades idle GPU tensor cores during memory-bound decode for 1.6x to 2.8x faster token output with mathematically identical distributions. Tune acceptance rate and draft depth below to find your exact speedup and optimal gamma.

Interactive calculator

Draft StrategyGammaTokens / StepNet SpeedupBoosted tok/s

How to maximize speculative decoding speedup

  1. Match draft and target tokenizers from the same model family. Pairing Llama 3.3 70B with Llama 3.2 1B or Qwen 2.5 72B with Qwen 2.5 1.5B keeps acceptance rates between 72% and 84% on code and JSON.
  2. Keep draft-to-target latency ratio c below 0.10. If your draft model takes 25% as long as the target model, drafting 5 tokens adds 1.25 target steps of latency and erases the gain.
  3. Use n-gram or prompt-lookup drafting for RAG and code edits. When the model copies large spans from the prompt, zero-parameter prompt lookup achieves 80%+ acceptance with almost zero draft latency.
  4. Turn off speculative decoding when batch sizes cross the ridge point. Speculative verification uses extra compute FLOPs. Once your node is compute-bound at high batch concurrency, standard decoding wins on throughput.

Common questions

Does speculative decoding change output quality?

No. Exact rejection sampling guarantees the output token distribution matches the target model mathematically, even at non-zero temperature.

Why is there an optimal draft length gamma?

Each extra draft token has a lower chance of being accepted (alpha^k) while still paying the full draft latency cost c, so speedup peaks and then falls.

What acceptance rate alpha do teams see in production?

Code generation and structured JSON often hit 75% to 88% acceptance. Open-ended creative prose usually sits closer to 55% to 68%.

Can speculative decoding save GPU cost as well as latency?

Yes, for low-to-medium batch latency-bound workloads. Cutting per-token wall time by 2x lets one GPU replica serve nearly twice the requests under the same SLA.

All calculations run 100% locally in your browser with zero external API calls. Hardware specs and hourly rates reflect published 2026 cloud and silicon datasheets.