Closer Look at Efficient Inference Methods: A Survey of Speculative Decoding

Hyun Ryu, Eric KimarXiv 2024 · DOI

Introduction

Speculative decoding (SD) has emerged as a critical "cheat code" for accelerating Large Language Model (LLM) inference without compromising output quality. Standard autoregressive decoding is inherently inefficient; it is a memory-bound process where the GPU spends significant time moving billions of parameters for each single token generated. Speculative decoding breaks this sequential bottleneck by using a fast "drafter" to predict sequences and a large "target" model to verify them in parallel, often achieving 2x–3x speedups in real-world applications.

A timeline illustrating the evolution of speculative decoding methods from 2018 to 2024, highlighting the shift from model-centric to draft-centric approaches.

Taxonomy of Speculative Decoding

The landscape of speculative decoding can be broadly categorized into two primary philosophies: Model-Centric (focusing on draft creation) and Draft-Centric (focusing on verification optimization).

A comprehensive taxonomy of speculative decoding methods, categorized by Model-Centric (Drafting) and Draft-Centric (Verification) strategies.

1. Model-Centric (Drafting)

These methods innovate on how the draft sequence is generated:

  • Independent Drafters: Utilize a separate, smaller model (e.g., using OPT-125M to draft for OPT-7B).
  • Dependent Drafters: Modify the target model itself. For instance, Medusa adds multiple heads to the final layer to predict future tokens, while LayerSkip utilizes a subset of the model's layers for drafting.

2. Draft-Centric (Verification)

These methods optimize the pool of candidates for the target model to verify:

  • Tree & Graph-Based: Methods like EAGLE-2 or GSD generate a tree of possible paths, allowing the target model to verify multiple branches simultaneously, increasing the likelihood of acceptance.
  • Search Optimization: Techniques like LazyLLM prune the draft space to save computation during the drafting phase.

Key Insights

  • The Memory-Compute Trade-off: SD leverages "spare" GPU compute cycles during memory transfers to verify guesses. Even if the drafter is only right 50% of the time, parallel verification remains faster than sequential generation.
  • Alignment is Critical: The drafter must closely mimic the target model's distribution; poor alignment leads to high rejection rates and fallback to slow sequential decoding.
  • From Lines to Trees: A major trend is the shift from linear sequences to tree-based drafting, which allows for better exploration of the probability space and higher average acceptance lengths.

Performance and Evaluation

Evaluation typically relies on SpecBench, a comprehensive suite covering conversation, translation, and RAG tasks. Key results from the survey include:

  • Speedups: Systems like EMS-SD report up to 2.85x speedups over vanilla decoding.
  • Utilization: BASS (Batched Attention-optimized Speculative Sampling) achieved 10x higher GPU utilization by optimizing multi-request handling.
  • Efficiency: PPD (Parallel Prompt Decoding) maintains a negligible memory overhead—just 0.004%—making it suitable for resource-constrained environments.

Challenges and Future Work

Despite its promise, the authors identify several "frontier" challenges:

  • Generalizability: Drafters often struggle when moving between domains (e.g., chat to code).
  • Throughput vs. Latency: While SD reduces latency for individual requests, the increased compute during verification can lower overall system throughput.
  • Long Context Management: Managing the KV cache for long documents during speculation remains expensive, though new methods like MagicDec are exploring sparse cache solutions.
  • Hardware Constraints: Many SD methods require high-end High Bandwidth Memory (HBM) to be effective, leaving a gap for consumer-grade hardware optimization.

Summary updated

BibTeX
@misc{ryu2024closer,
  author = {Hyun Ryu and Eric Kim},
  title = {{Closer Look at Efficient Inference Methods: A Survey of Speculative Decoding}},
  year = {2024},
  eprint = {2411.13157},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.13157},
}
Figure