Fast Inference from Transformers via Speculative Decoding
Yaniv Leviathan, Matan Kalman, Yossi Matias
ICML 2023 · arXiv 2211.17192 · Read the paper ↗
A small model drafts tokens and the big model checks them in one pass, with the same output distribution.
3 steps · 0 solved
Start: Expected speedup →- 1Expected speedupPick the draft length from the acceptance rate.Pick the best draft length for speculative decoding
- 2Verify a draftAccept the longest matching prefix.Verify a draft model's guesses in speculative decoding
- 3Speculative samplingAccept or reject with the probability ratio and resample.Accept or reject draft tokens in speculative sampling
More transformers and llms papers
- Attention Is All You Need 2017
- LoRA: Low-Rank Adaptation of Large Language Models 2021
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 2022
- RoFormer: Enhanced Transformer with Rotary Position Embedding 2021
- Direct Preference Optimization: Your Language Model is Secretly a Reward Model 2023
- Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity 2021
- LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale 2022