Speculative Decoding
A serving technique that uses a cheaper draft path to propose several next tokens, then asks the main model to verify them so decode-heavy requests can finish with fewer expensive turns.
Opening summary
Speculative decoding is a latency-reduction technique for autoregressive serving. Instead of waiting for the main model to produce one token at a time, the serving stack lets a cheaper draft path guess several tokens, then asks the stronger verifier model to accept the matching prefix or reject the rest.
At a glance
Released
May 2023
System type
Serving
Related models
No related models listed yet.
Related modules
No related modules listed yet.
What It Is
Speculative decoding is a serving system around the same underlying model, not a new model architecture. Its job is to reduce reader-visible decode latency by pairing the main model with a cheaper draft model or draft path that proposes several likely next tokens before the stronger model checks them.Where It Sits
It sits inside the inference-serving runtime alongside batching, key-value cache management, routing, and request scheduling. The model weights still define the actual language model. Speculative decoding changes how the serving stack uses those weights during decode so one expensive verifier pass can sometimes accept more than one token.How It Works
The runtime starts from the same prompt prefix that the main model would normally decode from. A cheaper draft path proposes a short run of likely next tokens, then the stronger verifier model checks that proposal in one pass. The serving stack keeps the longest prefix that matches the verifier's own next-token choices, emits those accepted tokens, and discards the rest. If the verifier disagrees early, the runtime accepts only a short prefix or none of the draft at all, then resumes ordinary decoding from the stronger model.Speculative Decoding System Flow
Decode step startsCheap draft path proposes tokensMain model verifies draftEmit accepted prefixReject rest and resume strong decodeDecode step starts to Cheap draft path proposes tokensCheap draft path proposes tokens to Main model verifies draftMain model verifies draft to Emit accepted prefixMain model verifies draft to Reject rest and resume strong decode
Request and weight flow
Control flow