The N-Grammys: Accelerating Autoregressive Inference with Learning-Free Batched Speculation

Lawrence Stewart, Matthew Trager, Sujan Kumar Gonugondla, Stefano Soatto
11/6/2024
cs.LG

No confident code implementation found for this paper.

Abstract

Speculative decoding aims to speed up autoregressive generation of a language model by verifying in parallel the tokens generated by a smaller draft model.In this work, we explore the effectiveness of learning-free, negligible-cost draft strategies, namely $N$-grams obtained from the model weights and the context. While the predicted next token of the base model is rarely the top prediction of these simple strategies, we observe that it is often within their top-$k$ predictions for small $k$. Based on this, we show that combinations of simple strategies can achieve significant inference speedups over different tasks. The overall performance is comparable to more complex methods, yet does not require expensive preprocessing or modification of the base model, and allows for seamless `plug-and-play' integration into pipelines.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{stewart2024ngrammys,
  title  = {The N-Grammys: Accelerating Autoregressive Inference with Learning-Free Batched Speculation},
  author = {Lawrence Stewart and Matthew Trager and Sujan Kumar Gonugondla and Stefano Soatto},
  year   = {2024},
  eprint = {2411.03786},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.03786v1}
}

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/2411.03786.svg)](https://codeofpaper.com/paper/2411.03786)

Discussion