How Speculative Decoding Splits the Work Into Two Stages
What a Hugging Face post says speculative decoding accelerates and what the draft model and the target model each do.
For: Learners who know what a large language model is.
What speculative decoding does
Speculative decoding is a popular technique to accelerate the inference of large language models, while preserving their accuracy.[1]
The first stage
In the first stage, a fast, but less accurate draft model (AKA assistant) autoregressively generates a sequence of tokens.[1]
The second stage
In the second stage, a large, but more accurate target model conducts parallelized verification over the generated draft tokens.[1]
Sources
- Faster Assisted Generation with Dynamic Speculation (huggingface.co · checked )
More articles
- LearningWhat Assisted Generation Is and What Its Two Models DoWhat a Hugging Face post says assisted generation is also known as, what its core idea is and what the assistant and target models do each cycle.
- LearningHow Large LLMs Are and What They Need to Run FastWhat a Hugging Face post says about how large LLMs often are, an example with more than 100 billion parameters and what they need to run fast.
- LearningWhy LLM Generation Cannot Be Parallelized Per RequestWhat a Hugging Face post says about how LLMs generate text token by token and why that cannot be parallelized inside one request.