TL;DR
EAGLE (Extrapolation Algorithm for Greater Language-model Efficiency) is a way to make a large language model (LLM) write faster without changing what it writes. A small extra network, the draft head, guesses several future tokens from the big model's internal state, and the big model checks all the guesses in one pass. The paper's two observations are that guessing the internal state is simpler than guessing words, and that the guess improves once the head also sees the word sampled one step earlier. On LLaMA2-Chat 70B the method reached a 2.7x to 3.5x speedup, and the output distribution is preserved.
Builds on: Speculative Decoding, Transformer, Autoregressive Model, Softmax · Leads to: the head-based alternatives it is measured against, Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads and Accelerating Large Language Model Decoding with Speculative Sampling
Why it mattered
Chat assistants and code tools generate one token at a time, and each token needs a full pass through a model with billions of weights. The bottleneck is reading those weights from memory, not the arithmetic. Speculative sampling attacks this by letting a cheap draft propose several tokens that the expensive model verifies together. EAGLE was one of the more widely cited methods in that family in 2024, and it keeps the output distribution equal to the big model's own output. The paper reports 2.7x to 3.5x speedups for LLaMA2-Chat 70B and about 2x throughput. Its training is cheap: a draft head under 1 billion parameters, trained in one to two days on four A100 (40G) GPUs for the 70B model.
Speculative sampling normally uses a separate small draft model. The paper notes that for LLaMA2 7B there is no suitable smaller sibling, and that a 7B draft for a 13B target gave no speedup in its tests.
The problem
Speculative decoding needs a draft that is much cheaper than the target model and still often agrees with it. Two obstacles made this hard for the LLaMA2 and Vicuna families.
- Cheap drafts were inaccurate. Medusa predicts tokens from the big model's features with a set of small heads and reaches an acceptance accuracy of about 0.6. Lookahead is lower still. A wrong draft wastes the verification pass.
- Training a new small model from scratch is expensive. The paper compares TinyLLaMA, trained on 3,000 billion tokens, with EAGLE, trained on 2 to 4 billion tokens.
The question the paper asks is how to make a draft accurate using only the big model's own features and a small training budget.
How it works
Take one tiny instance. The prompt so far ends with the word "I", and the model must choose the next word. Two words are likely, "am" and "always". Plain decoding runs the whole model once to choose one word, then again for the next.
-
The big model reads the prompt. For the position of "I" it produces a feature vector . A feature is the second-to-top layer's hidden state, the vector just before the output layer. The output layer (the LM head) turns into probabilities over all words.
-
The draft head guesses the next feature. EAGLE's draft head is one transformer decoder layer. Its input is the feature together with the embedding of a candidate word. For the candidate "am" it predicts a feature from , and for "always" it predicts from . Check: two candidates, two predicted features, one extra input each.
-
Why the candidate word is part of the input. Features are continuous vectors, and the feature after "I" depends on which word actually follows. "am" and "always" lead to different feature vectors, so alone cannot say which comes next. Adding the word tells the head which branch it is on. This is the paper's main idea. The paper's ablation (Figure 4, Vicuna 7B, temperature 0) finds that adding the shifted token to the features gives the largest gain of the input choices it tests.
-
The LM head turns features into words, and the draft grows a tree. The big model's LM head, shared and not retrained, converts each predicted feature into word probabilities. The draft samples words from them and feeds the new (feature, word) pair back in. Each draft pass extends the tree one level deeper. Check: a draft tree of depth comes from draft passes and holds more than tokens.
-
The big model checks the whole tree at once. Tree attention lets each candidate token see only its own ancestors in the tree. One forward pass of the big model gives the true probabilities at every node.
-
Accept or reject. Walk down the branches. A candidate word is accepted with a probability that compares the big model's probability with the draft's. If it is rejected, a replacement word is drawn from the part of the big model's distribution the draft missed. Accepted words stay, and the next draft starts from the last accepted feature.
-
Output. Each big-model pass now produces several words, not one. On MT-bench with Vicuna 7B at temperature 0, the average is 3.94 accepted tokens per pass (Table 2), against 1 for plain decoding.
The flow of one round:
flowchart LR A[Accepted features and words] --> B[Draft head predicts next features] B --> C[LM head samples candidate words, grows a tree] C --> D[Big model verifies the whole tree in one pass] D --> E[Accept or resample each word] E --> A
The acceptance step is where randomness meets the big model's probabilities. For a word that the draft proposed with probability 0.5, the chance of keeping it depends on the big model's probability for that word:
- draft probability 0.5
- draft probability 0.2
The math
A feature is the hidden vector at position , just before the LM head. A token is a word, and its embedding is the learned vector for it. The big model maps the token sequence to features , and the LM head maps to a distribution over the next word. The draft model's guesses carry a hat: and .
Step 1 in symbols: the big model's distribution
For a position , the target distribution is , and vanilla decoding samples from it. This costs one expensive pass per word.
Step 2 in symbols: the draft prediction
The draft head takes the feature history and the tokens shifted one position ahead:
is the feature history, and is the token sequence advanced by one position, so it includes the word sampled for position . The draft word distribution is .
Step 3 in symbols: training the draft head
The loss has two parts. The regression loss matches the predicted feature to the true one. The Smooth L1 distance acts like squared error for small gaps and like absolute error for large ones:
The classification loss matches the predicted word distribution to the big model's:
The total is with . The paper chooses this weight because the classification loss is about ten times larger in value. Training uses a fixed set of ShareGPT dialogues rather than text generated by the big model. During training, uniform noise from is added to the big model's features so that small errors do not build up over several draft steps.
Step 4 in symbols: the acceptance rule
A candidate word with draft probability is accepted with probability
If it is rejected, a replacement is drawn from the normalised positive part of the difference:
where norm divides by the total so the numbers sum to 1. This is the speculative sampling rule. The paper relies on the proof that the combined procedure samples exactly from the big model, so EAGLE needs no approximation.
Worked numbers
Words: am, always, the. The big model gives . The draft gives . Both sum to 1.
- The draft proposes "am", with draft probability .
- Acceptance probability: .
- With probability 0.4 "am" is kept. With probability 0.6 it is rejected.
- Residual after rejection: . Its total is 0.3.
- Normalised: , so the replacement is "always" for certain.
Check that the output matches the big model. The chance of "am" overall is , which equals . The chance of "always" is from the draft's own proposal (accepted with probability 1, because exceeds 1) plus from rejected "am" steps, a total of . The word "the" gets , matching .
Table 2 gives Vicuna 7B at temperature 0 on MT-bench an average of accepted tokens per pass of the big model. Plain decoding gives 1 token per pass.
- Gain counting only passes: times more tokens per big-model pass.
- Measured gain at batch size 1 for the same model and benchmark (Table 7): 2.90 times.
- The gap is . Each token costs about 36 percent more time than the pass count suggests.
- The paper does not break the gap down. A likely source is the cost of running the draft head and checking a larger tree.
Try it: the tree version has and the chain version has (Table 5, Vicuna 7B). How many extra accepted tokens per pass does the tree add? Answer: , the "+0.74" the paper reports.
Suppose a reply of 300 tokens from LLaMA2-Chat 70B, and suppose vanilla decoding runs at 20 tokens per second (an assumed number for this example, not a measurement). Table 7 gives speedups of 3.01 at batch size 1 and 2.40 at batch size 4.
- Vanilla time: seconds.
- With EAGLE at batch size 1: seconds.
- The same reply when the server handles four requests together, at a 2.40 speedup: .
- Compute the denominator first: .
- Divide: seconds.
- Interpretation: batching shrinks the advantage, because the GPU is busier and has less spare capacity to fill.
Try it: with batch size 4 at a speedup of 2.40, how long does a 300-token reply take at 20 tokens per second? Answer: 6.25 seconds.
Results
- Speed at temperature 0 on MT-bench. LLaMA2-Chat 70B reached 2.7x to 3.5x. For LLaMA2-Chat 13B the range was 3.01x to 3.76x, and at temperature 1 it was 2.66x to 2.89x. Against the other head-based methods on the same benchmark, EAGLE was 1.70x to 2.08x faster than Lookahead and 1.47x to 1.60x faster than Medusa.
- Other tasks (Table 1, temperature 0). Vicuna 7B reached 3.33x on HumanEval, 3.01x on GSM8K and 2.79x on Alpaca. Code was the best case, which the paper credits to fixed templates in code that are easy to draft.
- Acceptance length (Table 2). The big model produced 3.2 to 4.5 tokens per pass across the models tested.
- Mixture of experts (Table 3). Mixtral 8x7B Instruct reached 1.50x, with an average acceptance length of 3.25. A verification pass can touch more experts than a single token would, which cuts the gain.
- Combined with fast kernels (Table 4). LLaMA2-Chat 7B on one RTX 3090 went from 24.5 tokens per second (plain Hugging Face, FP16) to 100.2 with EAGLE in FP16 and to 160.4 with EAGLE plus gpt-fast int4.
- Tree attention (Table 5). The tree added about 0.6 to 0.8 to the acceptance length, and about 0.3 to 0.5 to the speedup.- Batch size and throughput (Table 7). Throughput reached 1.97x for Vicuna 7B and 1.99x for LLaMA2-Chat 70B. At batch size 1 the speedups were 2.90x and 3.01x, falling to 2.76x and 2.40x at batch size 4.
- Training data (Table 6). A fixed dataset gave 2.78x, and data from the target model gave 2.88x. The gap is small, which supports the cheap fixed dataset.
- Baseline check. With a 7B model as the draft for the 33B and 70B models, the paper reports 1.12x and 1.88x. The limitation is the draft's overhead, not its accuracy.
Limits. Most results are at batch size 1 and on specific GPUs, so the numbers describe those settings. Memory matters: on a 24 GB RTX 3090 with Vicuna 7B, the largest batch was 8 for plain decoding and 7 for EAGLE. The method preserves the distribution by construction, so the paper does not score output quality. Its speedups are also smaller on mixture-of-experts models and at larger batch sizes.
Reading guide
- Introduction and Figures 1 to 4. The two observations and the headline numbers. Needs Speculative Decoding.
- Section 2, Preliminaries. Notation for features and the LM head, and the speculative sampling rule. Needs Transformer, Autoregressive Model and Softmax.
- Section 3.1, Drafting phase. The draft head and the tree. Needs Attention Mechanism and Embedding Layer for the token inputs.
- Section 3.2, Training. The regression and classification losses and the noise augmentation. Needs Cross-Entropy Loss.
- Section 3.3, Verification. Tree attention and the per-node acceptance. Needs the Step 4 rule above.
- Section 4, Experiments. Tables 1 to 7. Read the batch-size results alongside the limits paragraph.
- Section 5, Related work. Where Medusa, Lookahead and DistillSpec sit. Needs Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads and Accelerating Large Language Model Decoding with Speculative Sampling.
Check yourself
QuestionRecall: what are the two inputs the EAGLE draft head receives at each step?Show answer
The feature of the current position from the big model, and the token embedding of a word advanced by one position (the word sampled for the next step). Giving it the word resolves the uncertainty that comes from the next feature depending on which word is sampled.
QuestionA draft proposes a word with draft probability , and the big model gives it . What is the acceptance probability?Show answer
. The word is kept with probability 0.4.
QuestionWhy does the output stay the same as the big model's, even though a draft is used?Show answer
The acceptance rule keeps a draft word with probability , and on rejection draws a replacement from . Together these sample exactly from the big model's distribution, so the draft changes how many passes are needed, not the distribution of the output.
QuestionWhy does the speedup fall as batch size rises, and what does that suggest about where it comes from?Show answer
Speculative decoding wins when one token per pass leaves the GPU underused. With more requests in a batch the GPU is already busy, so verifying extra tokens costs more, and the speedup falls (3.01 at batch size 1, 2.40 at batch size 4 for LLaMA2-Chat 70B). The gain comes from spare compute, not from less work per token.
QuestionScenario: a team serves one 13B chat model to one user at a time on a single GPU. Is EAGLE's training cost likely worth it?Show answer
Probably yes. The paper trains a 13B draft head of about 0.37 billion parameters in one to two days on an RTX 3090 node, and batch size 1 is where its speedups are largest. The team should still measure on its own workload, because the paper's numbers come from its benchmarks.