Speculative Streaming: Fast LLM Inference without Auxiliary Models

Nikhil Bhendawade, Irina Belousova, Qichen Fu, Henry Mason, Mohammad Rastegari, Mahyar Najibi

Abstract

Large Language Model (LLM) inference is primarily limited by memory bandwidth rather than computational capacity. While Speculative Decoding (SD) addresses this by using a smaller draft model to predict future tokens, it introduces significant complexity and memory overhead. We present Speculative Streaming, a novel acceleration technique that integrates the drafting process directly into the target LLM. By employing multi-stream attention and lightweight stream embeddings, Speculative Streaming achieves 1.8x to 3.1x speedups with 10,000x fewer additional parameters than existing single-model approaches like Medusa.

Introduction

In the current landscape of generative AI, the inference speed of Large Language Models (LLMs) remains a critical bottleneck. This latency is fundamentally a "memory-bound" problem: for every token generated, the entire model's weights must be fetched from memory, while the actual arithmetic operations performed are minimal.

Speculative Decoding (SD) was proposed to alleviate this by using a tiny, fast "draft" model to propose multiple future tokens, which the larger "target" model then verifies in parallel. However, standard SD introduces its own set of challenges, including the need to manage and align two distinct models, increased memory footprints on resource-constrained devices, and diminishing returns when the drafting overhead offsets the gains from speculation. This paper introduces Speculative Streaming, a parameter-efficient, single-model speculative system designed for seamless deployment.

Methods

Speculative Streaming unifies speculation and verification into a single forward pass of the target model, eliminating the need for an auxiliary draft model.

Multi-Stream Attention (MSA)

The core architectural innovation is Multi-Stream Attention. The authors replace the final layers of a standard transformer with MSA layers. While the "main stream" predicts the immediate next token ($t+1$), $\gamma$ additional "speculative streams" are trained to predict tokens further into the future ($t+2, t+3, \dots, t+\gamma$).

Stream Identifier Embeddings (SE)

To distinguish between these concurrent streams without adding heavy prediction heads, the model utilizes lightweight Stream Identifier Embeddings. These embeddings allow the model to "plan" for future tokens within the existing architecture, maintaining a minimal parameter footprint.

Tree Drafting and Parallel Pruning

Rather than predicting a single linear sequence, the model generates a "tree" of potential future tokens, increasing the probability that the target model will find a valid path to accept. To prevent the computational cost of this tree from growing exponentially, the authors implement a low-rank "early-exit" head. This head prunes unlikely branches before they reach the final layers, ensuring the batch size remains manageable and the process stays memory-bound rather than compute-bound.

Training Objective

The model is fine-tuned using Low-Rank Adaptation (LoRA). The training objective minimizes a dual loss: the standard next-token cross-entropy loss and a future $n$-gram prediction loss, encouraging the model to develop internal representations that support multi-token planning.

Experimental Setup

The researchers evaluated Speculative Streaming across four open-source models—Phi-1.3B, OpenLlama-7B, and OPT (1.3B and 6.7B). The evaluation spanned several diverse tasks:

  • Summarization: Dialogsum dataset.
  • Structured Queries: sql-create-context and SPIDER (text-to-SQL).
  • Meaning Representation: e2e-nlg (structured data to natural language).

Key Insights and Results

The "Free" Compute Principle

Speculative Streaming exploits the "slack" in memory-bound regimes. Since the processor is frequently idle while waiting for data from memory, adding the speculative streams costs almost zero additional wall-clock time. This increases the "arithmetic intensity" of the inference process, making better use of the hardware's computational power.

Performance and Efficiency

  • Speedups: The method consistently delivered 1.8x to 3.1x faster inference compared to standard autoregressive decoding.
  • Parameter Minimalism: Compared to Medusa, which requires large MLP heads for each speculative position (often totaling hundreds of millions of parameters), Speculative Streaming uses shared adapters and tiny embeddings. This results in a ~10,000x reduction in extra parameters (e.g., ~40K vs ~400M), making it ideal for edge devices like smartphones.
  • Quality Preservation: Generation quality, measured by ROUGE scores and Exact Match accuracy, remained stable. In some cases, quality improved slightly, likely due to the multi-token planning objective during fine-tuning.

Limitations and Future Work

While Speculative Streaming offers significant advantages, it currently requires task-specific fine-tuning via LoRA, meaning it is not yet a "plug-and-play" solution for any pre-trained model. Additionally, there is a physical limit to the speculative tree size before the model becomes compute-bound. Future research may explore "soft" matching for verification—accepting semantically similar tokens rather than exact matches—to further increase acceptance rates and speedups.

Conclusion

Speculative Streaming represents a significant step toward efficient LLM deployment. By integrating the drafting mechanism into the main model architecture, it provides a high-performance, low-overhead alternative to traditional speculative decoding, particularly suited for resource-constrained environments.

Summary updated

BibTeX
@inproceedings{bhendawade2024speculative,
  author = {Nikhil Bhendawade and Irina Belousova and Qichen Fu and Henry Mason and Mohammad Rastegari and Mahyar Najibi},
  title = {{Speculative Streaming: Fast LLM Inference without Auxiliary Models}},
  booktitle = {ENLSP},
  year = {2024},
}
Figure