How does speculative decoding speed up generation without changing the output distribution of the main model?
- Exam domain
- Inference Concepts15% of the exam
- Difficulty
- Hard
- In this mock
- 8 questions on this domainPractise this domain
Why the exam asks this
Inference Concepts (15% of the exam)
Objective in the exam guide: Optimization techniques: quantization and precision tradeoffs, KV and prefix caching, speculative decoding, tensor parallelism, disaggregated serving, and context-length effects on GPU memory.
Speculative decoding is one of the named optimizations.
Why C is the answer
A small draft model proposes tokens that the main model verifies in parallel
A fast draft model guesses several tokens; the large model checks them in one pass and keeps the accepted ones, so fewer slow sequential steps are needed.
Remember: Speculative decoding: draft proposes, target verifies.
How it works
Speculative decoding uses a small draft model and parallel verification to reduce sequential decode steps.
In detail
- Draft proposes, target verifies.
- Output follows the target model.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. It removes the KV cacheWrong
KV cache is still used.
B. It skips the prefill phase entirely and starts generating before the prompt has been readWrongMost tempting
Prefill is still needed.
Why it tempts: Skipping work sounds like the source of the speedup.
C. A small draft model proposes tokens that the main model verifies in parallelRight
Speculative decoding: draft proposes, target verifies.
D. It lowers the temperature to zeroWrong
Temperature does not speed decoding.
Use case
An illustrative scenario, not a real incident.
Illustrative: a small draft model makes a large model generate about twice as fast on code completion.
See it in different ways
sequenceDiagram participant P0 as Draft model participant P1 as Target model participant P2 as Output P0->>P1: proposed tokens P1->>P2: accepted tokens P1-->>P0: continue from accepted point
How to read this chart
- 1. Draft model sends "proposed tokens" to Target model.
- 2. Target model sends "accepted tokens" to Output.
- 3. Draft model gets a reply from Target model: "continue from accepted point".
mindmap
root(("Optimizations"))
n1["Memory"]
n2["Quantization"]
n3["KV cache"]
n4["Speed"]
n5["Speculative decoding"]
n6["Prefix caching"]
n7["Scale"]
n8["Tensor parallelism"]
n9["Disaggregated serving"]How to read this chart
- The centre is "Optimizations".
- "Memory" covers "Quantization", "KV cache".
- "Speed" covers "Speculative decoding", "Prefix caching".
- "Scale" covers "Tensor parallelism", "Disaggregated serving".
Related questions
Learn more
- Our lesson: Inference concepts
- Practise Inference Concepts questions in the mock exam
- Source: Fast Inference from Transformers via Speculative Decoding (arXiv)
- TensorRT-LLM documentation
- NVIDIA Dynamo documentation
- Efficient Memory Management for LLM Serving with PagedAttention (arXiv)
- Fast Inference from Transformers via Speculative Decoding (arXiv)