Before you start: words you need#
| Word | Plain meaning |
|---|---|
| Draft head | A small extra network attached to the target model itself, which proposes future tokens. No separate draft model. |
| Hidden state / feature | The vector a Transformer layer outputs for a token. The last hidden state feeds the language-model head that produces next-token probabilities. |
| Token tree | Several candidate continuations organised as a tree (top-3 for the next token, top-2 after each, and so on), verified together. |
| Tree attention | An attention mask that lets each candidate token see only its own ancestors in the tree, so a whole tree is verified in one forward pass. |
| Acceptance length (τ) | Average number of tokens accepted per target forward pass. Higher is better. |
| Typical acceptance | Medusa’s relaxed rule: accept a candidate if the target gives it reasonably high probability. Faster, but not lossless. |
| Self-distillation | Training the draft on text the target model itself generated, so the draft learns the target’s habits. |
1. The paper#
Two lines of work that replaced the separate draft model of 30.l:
- Medusa — Tianle Cai, Yuhong Li, Zhengyang Geng, Hongwu Peng, Jason D. Lee, Deming Chen, Tri Dao, “Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads”, ICML 2024. arXiv:2401.10774
- EAGLE — Yuhui Li, Fangyun Wei, Chao Zhang, Hongyang Zhang, “EAGLE: Speculative Sampling Requires
Rethinking Feature Uncertainty”, ICML 2024. arXiv:2401.15077
- EAGLE-2 (dynamic draft trees), EMNLP 2024. arXiv:2406.16858
- EAGLE-3 (training-time test, multi-layer features), NeurIPS 2025. arXiv:2503.01840
2. The problem#
Classic speculative decoding (30.l) needs a separate small model that shares the target’s tokenizer, is trained on similar data, and has its own weights and KV cache to manage. For many models no good draft exists. And small drafts often guess poorly, so acceptance is low.
Both groups asked: the target model has already computed a rich hidden state for the current token. Can a tiny network on top of that guess the next several tokens better than an independent small model?
3. The idea#
Medusa: several heads, each guessing a different future position.
- Add K extra heads on the last hidden state. Head k predicts the token k+1 steps ahead. Each head is one residual feed-forward layer plus an output projection.
- Take the top few candidates from each head, form a tree of combinations, and verify the whole tree in one forward pass with tree attention.
- Medusa-1 trains only the heads with the target frozen (lossless with standard verification). Medusa-2 fine-tunes heads and target together for higher accuracy, which changes the model. The optional typical acceptance rule trades exactness for speed.
EAGLE: autoregress on features, not tokens.
- Train a small draft network (about one Transformer layer) that takes the target’s second-to-top-layer feature and the next token, and predicts the next feature; the target’s own LM head turns predicted features into tokens. Repeat to draft several steps.
- Feeding the sampled token in removes the uncertainty of “which token was actually chosen”, which the paper argues is why feature prediction failed before.
- Verify with tree attention and the standard lossless speculative sampling rule.
EAGLE-2: make the tree dynamic. The draft’s confidence scores track acceptance well, so expand the branches it is confident about and prune the rest, per context.
EAGLE-3: stop predicting features. Predict tokens directly from a fusion of low, middle and high layer features, and train with “training-time test” — during training, feed the draft its own earlier outputs, as at inference, so it learns to recover from its own errors. This made the draft keep improving as training data grew.
flowchart LR T["Target forward pass: features from several layers"] --> D["EAGLE draft layer: predict next tokens autoregressively"] D --> TR["Dynamic token tree (EAGLE-2)"] TR --> V["Target verifies whole tree in one pass (tree attention)"] V --> A["Accept longest valid branch (lossless rule)"] A --> T class T,V compute class D,TR neutral class A io
4. How it works#
- Where the draft lives. Medusa heads and EAGLE layers are small (well under 1 B parameters for a 70 B target) and run on the same GPUs, reusing the target’s embeddings and LM head.
- Training cost. Medusa-1 heads for Vicuna-7B trained in about 5 hours on one A100. EAGLE’s draft for the 70 B model trained in 1–2 days on 4 × A100 40 GB, and for 7–33 B models on an RTX 3090 node in 1–2 days. EAGLE-3 is trained on much more data, and benefits from it.
- Tree verification. Flatten the tree into a sequence; give it an attention mask where each node attends to the prefix and its own ancestors; one target forward pass scores every node. Accept the longest root-to-leaf path that passes the acceptance rule; reuse the KV of accepted nodes.
- Lossless or not. EAGLE (all versions) and Medusa-1 with standard rejection sampling keep the target distribution exactly. Medusa-2 changes the target’s weights; typical acceptance changes the sampling. Know which one you are running.
The batch-size behaviour, tree shapes and tuning are taught in 13.n and 13.o; vLLM’s implementation in 18.f.
5. Results#
All are paper claims, mostly at batch size 1 on chat benchmarks such as MT-bench.
| Method | Headline result (paper) |
|---|---|
| Medusa-1 | over 2.2× speed-up without changing output quality (Vicuna 7B–33B) |
| Medusa-2 | 2.3–2.8× |
| EAGLE | LLaMA2-Chat 70B: 2.7–3.5× latency speed-up, throughput doubled; lossless |
| EAGLE-2 | 3.05–4.26×, 20–40% faster than EAGLE |
| EAGLE-3 | up to 6.5×, about 1.4× over EAGLE-2; in SGLang on an H100 (Llama-3.1-8B), 1.38× throughput at batch 64 |
The EAGLE-3 batch table is worth knowing (SGLang team’s measurement, MT-bench, H100, Llama-3.1-8B, throughput vs no speculation):
| Batch size | 2 | 8 | 16 | 32 | 64 |
|---|---|---|---|---|---|
| EAGLE | 1.40× | 1.23× | 1.02× | 0.94× | 0.99× |
| EAGLE-3 | 1.81× | 1.62× | 1.48× | 1.32× | 1.38× |
Older drafts stopped helping, or hurt, above batch 16. A draft accurate enough keeps paying at large batch.
6. What held up and what did not#
Held up
- Drafts that reuse the target’s internals beat separate small models. EAGLE-3 became the most widely deployed speculative method in open serving stacks in 2025–26; pretrained EAGLE-3 heads are published for many open models.
- Tree verification with tree attention is standard (13.o).
- Train the draft the way it is used (training-time test) generalised: drafters are now trained on the target’s own outputs, often at large scale.
- Multi-token prediction built into the model. DeepSeek-V3 (30.v) trained an MTP module with the model, which serves as a ready-made EAGLE-like draft (14.h, 18.f).
Did not, or changed
- Medusa is mostly legacy. Independent heads per position ignore what the earlier guesses were; EAGLE’s autoregressive draft is more accurate. Medusa-2 and typical acceptance are lossy, which many operators reject.
- Batch-1 speed-ups overstate production gains. At high load, speculation can reduce throughput; engines adapt or disable it (13.n).
- Parallel drafters (2026). P-EAGLE, DFlash and DSpark draft several tokens in one pass instead of autoregressively, cutting draft latency; supported in vLLM and the Speculators library since July 2026.
7. Where it lives in 2026#
- Taught in depth: speculative decoding in 12.n, practice in 13.n, variants (Medusa, EAGLE, MTP, tree shapes) in 13.o, vLLM’s implementation in 18.f.
- vLLM v0.32.0, SGLang and TensorRT-LLM support EAGLE/EAGLE-3 and MTP; vLLM also supports P-EAGLE,
DFlash and DSpark. The
speculatorslibrary (vLLM project) trains and packages drafters.
Checked on 13 November 2026.
8. Questions#
- What does a Medusa head predict, and why do independent heads limit accuracy?
- Why does EAGLE feed the sampled token into the draft along with the feature?
- How does tree attention verify many candidate continuations in one pass?
- Which of Medusa-1, Medusa-2 with typical acceptance, EAGLE and EAGLE-3 are lossless?
- What does EAGLE-2’s dynamic tree exploit?
- What is “training-time test”, and what problem does it fix?
- Look at the EAGLE-3 batch table. Why did EAGLE stop helping at batch 16 while EAGLE-3 did not?
9. Further reading#
- Medusa, arXiv:2401.10774.
- EAGLE, arXiv:2401.15077; EAGLE-2, arXiv:2406.16858; EAGLE-3, arXiv:2503.01840.
- SafeAILab/EAGLE on GitHub.
- 13.o and 18.f in this material.
- Next: Sarathi-Serve (30.t).