[Paper Review] EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty
EAGLE introduces a feature-level autoregressive drafting phase with one-step-ahead token information to address uncertainty in speculative sampling, yielding significant latency speedups (2.1x–3.8x on MT-bench) while preserving the target LLM’s output distribution without fine-tuning.
Autoregressive decoding makes the inference of Large Language Models (LLMs) time-consuming. In this paper, we reconsider speculative sampling and derive two key observations. Firstly, autoregression at the feature (second-to-top-layer) level is more straightforward than at the token level. Secondly, the inherent uncertainty in feature (second-to-top-layer) level autoregression constrains its performance. Based on these insights, we introduce EAGLE (Extrapolation Algorithm for Greater Language-model Efficiency), a simple yet highly efficient speculative sampling framework. By incorporating a token sequence advanced by one time step, EAGLE effectively resolves the uncertainty, enabling precise second-to-top-layer feature prediction with minimal overhead. We conducted comprehensive evaluations of EAGLE, including all models from the Vicuna and LLaMA2-Chat series, the MoE model Mixtral 8x7B Instruct, and tasks in dialogue, code generation, mathematical reasoning, and instruction following. For LLaMA2-Chat 70B, EAGLE achieved a latency speedup ratio of 2.7x-3.5x, doubled throughput, while maintaining the distribution of the generated text.
Motivation & Objective
- Motivate faster autoregressive decoding for large language models (LLMs) without altering the output distribution.
- Reexamine speculative sampling by focusing on feature-level autoregression and uncertainty handling.
- Propose a lightweight drafting framework (EAGLE) that uses a one-step token shift to resolve feature-level uncertainty.
Proposed method
- Proposes EAGLE, a speculative sampling framework with a drafting phase operating on second-to-top-layer features rather than tokens.
- Introduces a token sequence advanced by one time step as input to the draft model to address sampling uncertainty in features.
- Uses a three-module draft model (Embedding, LM Head, Autoregression Head) and a tree-structured draft with tree attention.
- Trains the Autoregression Head with a combined regression and classification loss, using a fixed dataset and lightweight data augmentation to mitigate feature error accumulation.
- Implements a verification phase that uses the target LLM with tree attention to maintain the output distribution, following a recursive speculative sampling procedure.
- Provides a low-cost training regime (1–2 days on A100s for 70B models) and shows compatibility with other acceleration methods like gpt-fast.
Experimental results
Research questions
- RQ1Can autoregression at the feature level outperform token-level autoregression in speculative sampling for LLMs?
- RQ2How does addressing feature-level uncertainty with a one-step-ahead token input affect accuracy and speedup?
- RQ3What are the latency gains and distribution-preserving guarantees of EAGLE across diverse models and tasks?
- RQ4How does EAGLE interact with other acceleration techniques (e.g., quantization, compilation) and batch-size regimes?
- RQ5Is EAGLE robust to training data selection and feature noise during drafting?
Key findings
- EAGLE achieves substantial speedups across Vicuna and LLaMA2-Chat families, e.g., 2.7x–3.5x latency speedup on LLaMA2-Chat 70B, with doubled throughput while preserving the output distribution.
- Drafting at the feature level with a one-step-ahead token input improves accuracy and speed compared to token-only drafting and prior methods (Lookahead, Medusa).
- Tree attention in the draft/verification stages yields modest additional gains over chain drafts but does not change the maximum forward passes, increasing tokens per pass.
- EAGLE outperforms Lookahead (1.7x–2.1x faster) and Medusa (1.5x–1.6x faster) on MT-bench; it also shows 2x–3x throughput improvements in certain settings and remains distribution-preserving in greedy and non-greedy modes.
- EAGLE integrates with gpt-fast to push LLaMA2-Chat 7B decoding to 160.4 tokens/s on an RTX 3090; training costs are low (sub-1B parameters in the Autoregression Head; 1–2 days on A100s for 70B models).
- Ablation studies show the importance of addressing randomness via feature&shifted-token inputs and that fixed-dataset training performs nearly as well as target-LM-generated data, underscoring low data sensitivity.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.