Lably
Skip to content

Speculative decoding

Machine learning technique

  • 3 min read
  • 5 chapters

Related on Lably

Through Inference, Large language model and Probability distribution

Background

Standard autoregressive decoding in large language models generates one token at a time. The model computes a probability distribution over its vocabulary, samples the next token, and feeds that token back as input. For large models, this process is bottlenecked by memory bandwidth rather than arithmetic throughput: loading the model's parameters from high-bandwidth memory (HBM) to the processor takes up most of the wall-clock time at each step. Because of this, a forward pass over one token and a forward pass over several tokens in a batch take roughly the same time. Speculative decoding relies on this property.

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Computing and communication