Speculative Decoding: Fast LLM Inference Without Quality Loss › Key Parameters
Language AI HandbookAll chapters 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 (): 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 (): The number of candidate tokens generated per round. Typically 4-8. Larger 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 requires balancing the expected tokens per round against the overhead of drafting. For high acceptance rates (above 80%), to is generally optimal. For moderate acceptance rates (60-75%), to tends to be better because the probability of long acceptance runs is lower and the overhead of generating many draft tokens is not recouped.