Fast Inference from Transformers via Speculative Decoding

By Yaniv Leviathan, Matan Kalman, Yossi Matias. International Conference on Machine Learning, 2022

1,765 citations recorded by the source corpus.

Inference from large autoregressive models like Transformers is slow - decoding K tokens takes K serial runs of the model. In this work we introduce speculative decoding - an algorithm to sample from autoregressive models faster without any changes to the outputs, by computing several tokens in parallel. At the heart of our approach lie the observations that (1) hard language-modeling tasks often include easier subtasks that can be approximated well by more efficient models, and (2) using speculative execution and a novel sampling method, we can make exact decoding from the large models faster, by running them in parallel on the outputs of the approximation models, potentially generating several tokens concurrently, and without changing the distribution. Our method can accelerate existing off-the-shelf models without retraining or architecture changes. We demonstrate it on T5-XXL and show a 2X-3X acceleration compared to the standard T5X implementation, with identical outputs.

Subfields: Artificial Intelligence, Hardware and Architecture, Information Systems and Management, Large Language Models

View Paper: https://arxiv.org/abs/2211.17192

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Sergey Levine
  2. Percy Liang
  3. Furu Wei
  4. Jianfeng Gao
  5. Mohit Bansal
  6. Quoc V. Le
  7. Luke S. Zettlemoyer
  8. Chelsea Finn

In Hardware and Architecture

  1. David Lopez-Paz
  2. James Lee-Thorp
  3. Xinyun Chen
  4. Peiyi Wang
  5. Percy Liang
  6. Elias Frantar
  7. J. Ainslie
  8. Tianyu Liu

In Information Systems and Management

  1. Furu Wei
  2. Dan Alistarh
  3. Elias Frantar
  4. Peiyi Wang
  5. Percy Liang
  6. Ahmed Hassan Awadallah
  7. Yuhui Li
  8. Fangyun Wei

In Large Language Models

  1. Xinyun Chen
  2. Denny Zhou
  3. Furu Wei
  4. Tengyu Ma
  5. Xuezhi Wang
  6. Tao Ge
  7. Zhihong Shao
  8. Elias Frantar

Citations in the corpus