[2211.17192] Fast Inference from Transformers via Speculative Decoding
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 show a 2X-3X acceleration compared to the standard T5X implementation, with identical outputs.
View PDF HTML (experimental) 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…
saved by
related reading
- Fast Inference from Transformers via Speculative Decodingarxiv.org
- Fast Inference from Transformers via Speculative Decodingarxiv.org
- Looking back at speculative decodingresearch.google
- Speculative Decoding - philkravphilkrav.com
- [2404.16710] LayerSkip: Enabling Early Exit Inference and Self-Speculative Decodingarxiv.org
- Speculative Speculative Decodingarxiv.org
- Speculative Decoding: How It Evolved, When It Stays Lossless, and What's Nextneurips2026-speculative-decoding.vercel.app
- [2402.12374] Sequoia: Scalable, Robust, and Hardware-aware Speculative Decodingarxiv.org
- How speculative decoding makes LLMs go brrr – Leonie Monigattileoniemonigatti.com
- [2508.16201] SpecVLM: Enhancing Speculative Decoding of Video LLMs via Verifier-Guided Token Pruningarxiv.org
- Matryoshka Language Model Suitesarxiv.org
- 2302.01318arxiv.org