Fast Inference from Transformers via Speculative Decoding
Yaniv Leviathan, Matan Kalman, Yossi Matias

TL;DR
This paper introduces speculative decoding, a method to accelerate autoregressive transformer inference by parallelizing token generation using approximate models, achieving 2-3 times faster results without altering outputs.
Contribution
The paper presents a novel speculative decoding algorithm that enables faster inference from large transformers by parallelizing token sampling without retraining or modifying the original models.
Findings
Achieves 2-3X speedup on T5-XXL
Maintains identical output quality to standard decoding
Operates without retraining or architecture modifications
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Topic Modeling · Scientific Computing and Data Management
