Lune

NeurIPS2023Top-tier venue

SpecTr: Fast Speculative Decoding via Optimal Transport

Ziteng Sun, Ananda Theertha Suresh, Jae Hun Ro, Ahmad Beirami, Himanshu Jain, Felix X. Yu

Abstract

Autoregressive sampling from large language models has led to state-of-the-art results in several natural language tasks. However, autoregressive sampling generates tokens one at a time making it slow, and even prohibitive in certain tasks. One way to speed up sampling is speculative decoding\textit{speculative decoding}: use a small model to sample a draft\textit{draft} (block or sequence of tokens), and then score all tokens in the draft by the large language model in parallel. A subset of the tokens in the draft are accepted (and the rest rejected) based on a statistical method to guarantee that the final output follows the distribution of the large model. In this work, we provide a principled understanding of speculative decoding through the lens of optimal transport (OT) with membership cost\textit{membership cost}. This framework can be viewed as an extension of the well-known maximal-coupling\textit{maximal-coupling} problem. This new formulation enables us to generalize the speculative decoding method to allow for a set of kk candidates at the token-level, which leads to an improved optimal membership cost. We show that the optimal draft selection algorithm (transport plan) can be computed via linear programming, whose best-known runtime is exponential in kk. We then propose a valid draft selection algorithm whose acceptance probability is (1−1/e)(1-1/e)-optimal multiplicatively. Moreover, it can be computed in time almost linear with size of domain of a single token. Using this newdraftselectionnew draft selection algorithm, we develop a new autoregressive sampling algorithm called SpecTr\textit{SpecTr}, which provides speedup in decoding while ensuring that there is no quality degradation in the decoded output. We experimentally demonstrate that for state-of-the-art large language models, the proposed approach achieves a wall clock speedup of 2.13X, a further 1.37X speedup over speculative decoding on standard benchmarks.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

59 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • DistillSpec: Improving Speculative Decoding via Knowledge Distillation cites Fast Inference from Transformers via Speculative Decoding
  • Fast Best-of-N Decoding via Speculative Rejection cites Language Models are Few-Shot Learners
  • Fast Best-of-N Decoding via Speculative Rejection cites Fast Inference from Transformers via Speculative Decoding
  • EAGLE-3: Scaling up Inference Acceleration of Large Language Models via Training-Time Test cites Fast Inference from Transformers via Speculative Decoding
  • Language Model Cascades: Token-Level Uncertainty And Beyond cites Language Models are Few-Shot Learners
  • Language Model Cascades: Token-Level Uncertainty And Beyond cites Fast Inference from Transformers via Speculative Decoding
  • Language Model Cascades: Token-Level Uncertainty And Beyond cites The Curious Case of Neural Text Degeneration
  • Skeleton-of-Thought: Prompting LLMs for Efficient Parallel Generation cites Language Models are Few-Shot Learners
  • Skeleton-of-Thought: Prompting LLMs for Efficient Parallel Generation cites Fast Inference from Transformers via Speculative Decoding
  • Language Models are Few-Shot Learners cites The Curious Case of Neural Text Degeneration
  • Fast Inference from Transformers via Speculative Decoding cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers59

  1. EAGLE-3: Scaling up Inference Acceleration of Large Language Models via Training-Time TestYuhui Li, Fangyun Wei, Chao Zhang, Hongyang ZhangNeurIPS 2025 · 347 citations
  2. Fast Best-of-N Decoding via Speculative RejectionHanshi Sun, Momin Haider, Ruiqi Zhang, Huitao Yang et al.NeurIPS 2024 · 144 citations
  3. DistillSpec: Improving Speculative Decoding via Knowledge DistillationYongchao Zhou, Kaifeng Lyu, Ankit Singh Rawat, Aditya Krishna Menon et al.ICLR 2024 · 143 citations
  4. Language Model Cascades: Token-Level Uncertainty And BeyondNeha Gupta, Harikrishna Narasimhan, Wittawat Jitkrittum, Ankit Singh Rawat et al.ICLR 2024 · 119 citations
  5. Skeleton-of-Thought: Prompting LLMs for Efficient Parallel GenerationXuefei Ning, Zinan Lin, Zixuan Zhou, Zifu Wang et al.ICLR 2024 · 105 citations

Builds on3

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
  3. Fast Inference from Transformers via Speculative DecodingYaniv Leviathan, Matan Kalman, Yossi MatiasICML 2023 · 1,472 citations

Related papers

  1. Global Resolution: Optimal Multi-Draft Speculative Sampling via Convex OptimizationRahul Krishna Thomas, Arka PalICLR 2026 · 2 citations
  2. SpecHub: Provable Acceleration to Multi-Draft Speculative DecodingRyan Sun, Tianyi Zhou, Xun Chen, Lichao SunEMNLP 2024
  3. Towards Optimal Multi-draft Speculative DecodingZhengmian Hu, Tong Zheng, Vignesh Viswanathan, Ziyi Chen et al.ICLR 2025
  4. A Theoretical Perspective for Speculative Decoding AlgorithmMing Yin, Minshuo Chen, Kaixuan Huang, Mengdi WangNeurIPS 2024 · 36 citations
  5. LK Losses: Direct Acceptance Rate Optimization for Speculative DecodingAlexander Samarin, Sergei Krutikov, Anton Shevtsov, Sergei Skvortsov et al.ICML 2026 · 11 citations
Dusk over the sea between two cliffs drawn in fine vertical lines