Speculative Decoding: Fast LLM Inference Without Quality Loss › Key Parameters

Michael BrenndoerferJanuary 16, 20262 min read
Language AI HandbookAll chapters
Part 42 of 67Inference Optimization
Chapter 323Speculative Decoding: Fast LLM Inference Without Quality Loss › Key Parameters
Reading section 11 of 14 · Key Parameters · 2 minSection 11 of 14 · 2 min

Book contents

Section 11 of 14 · 2 min read

Speculative Decoding: Fast LLM Inference Without Quality Loss › Key ParametersOne section · Sections in this chapter11 / 14 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Speculative decoding exposes several parameters that you need to tune for your deployment. Getting these right makes the difference between a large speedup and a marginal improvement.

  • draft_model: The smaller, faster model used to generate candidate tokens. Ideally from the same model family as the target, with the same tokenizer, and roughly 7-10% the parameter count.
  • target_model: The large model used to verify candidates and guarantee output distribution quality. Its output distribution is never modified.
  • acceptance_rate (γ\gamma): The probability that a draft token matches the target model's preference. Measured empirically on representative inputs and determines the achievable speedup.
  • num_draft_tokens (KK): The number of candidate tokens generated per round. Typically 4-8. Larger KK yields higher expected tokens per round but risks more wasted computation when acceptance rates are low.
  • temperature: Controls randomness in sampling. Higher temperatures generally reduce acceptance rates, as discussed above.

Choosing KK requires balancing the expected tokens per round against the overhead of drafting. For high acceptance rates (above 80%), K=6K = 6 to 88 is generally optimal. For moderate acceptance rates (60-75%), K=4K = 4 to 55 tends to be better because the probability of long acceptance runs is lower and the overhead of generating many draft tokens is not recouped.