Distributed Speculative Inference (DSI): Speculation Parallelism for Provably Faster Lossless Language Model Inference

Nadav Timor, J. Mamou, Daniel Korat, Moshe Berchansky, Oren Pereg +4 more
5/1/2024

No official code found. Best implementation: keyboardAnt/distributed-speculative-inference (13 stars, Apache-2.0, last commit 2025-03-08).

Abstract

This paper introduces distributed speculative inference (DSI), a novel inference algorithm that is provably faster than speculative inference (SI) [leviathan2023, chen2023, miao2024, sun2025, timor2025] and standard autoregressive inference (non-SI). Like other SI algorithms, DSI operates on frozen language models (LMs), requiring no training or architectural modifications, and it preserves the target distribution. Prior studies on SI have demonstrated empirical speedups over non-SI--but rely on sufficiently fast and accurate drafters, which are often unavailable in practice. We identify a gap where SI can be slower than non-SI if drafters are too slow or inaccurate. We close this gap by proving that DSI is faster than both SI and non-SI--given any drafters. DSI is therefore not only faster than SI, but also unlocks the acceleration of LMs for which SI fails. DSI leverages speculation parallelism (SP), a novel type of task parallelism, to orchestrate target and drafter instances that overlap in time, establishing a new foundational tradeoff between computational resources and latency. Our simulations show that DSI is 1.29-1.92x faster than SI in single-node setups for various off-the-shelf LMs and tasks. We open-source all our code.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

The fastest off-the-shelf inference algorithm for LLMs (ICLR’25)

133Python, DockerfileJun 4, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{timor2024distributed,
  title  = {Distributed Speculative Inference (DSI): Speculation Parallelism for Provably Faster Lossless Language Model Inference},
  author = {Nadav Timor and J. Mamou and Daniel Korat and Moshe Berchansky and Oren Pereg and Moshe Wasserblat and Tomer Galanti and Michal Gordon and David Harel},
  year   = {2024},
  eprint = {2405.14105},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2405.14105},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.14105.svg)](https://codeofpaper.com/paper/2405.14105)

Discussion