AI Hardware & Software Stack

Which describes the idea of speculative decoding for speeding up LLM inference?

  1. AGuessing answers randomly and outputting them directly
  2. BA small model drafts several tokens ahead, the large model verifies them together in one pass, and the correct ones are accepted at once
  3. CUsing the large model with half its layers removed
Show answer and explanation

Answer: B. A small model drafts several tokens ahead, the large model verifies them together in one pass, and the correct ones are accepted at once

Decode is memory-bound, so the large model spends nearly the same time reading weights whether it computes one token or several. So a light, small model predicts the next few tokens, the large model checks them all in a single forward pass, and the correct ones are accepted at once. If the predictions are often right, the large model is invoked fewer times, speeding up output without changing its quality.

  • A. Drafts are always verified by the large model.
  • B. Correct. The output can match the large model alone.
  • C. The large model is used intact.
Practice this topic Back to topic

More AI Hardware & Software Stack questions

  1. Why are lookups in the large embedding tables used by recommendation models and similar hard for AI hardware?
  2. Which orders the AI software stack from the layer closest to users down to the layer closest to hardware?
  3. What is the difference between training and inference for a neural network?
  4. Which is NOT a reason training needs much more memory than inference for the same model?
  5. A 7-billion-parameter (7B) model is trained with weights, gradients and Adam's two states all held in FP32 (4 bytes). Excluding activations, roughly how much memory is needed?