TAI BUI
Back to curriculum
LearnPython

EAGLE-3 Speculative Decoding in Production

Speculative decoding pairs a fast draft with the target model. The draft proposes K tokens, the target verifies them in a single forward, and the accepted ones come almost free. EAGLE-3 is the production-grade variant in 2026: it trains a draft head on the target model's hidden states instead of on raw tokens, which pushes acceptance rate alpha into the 0.6-0.8 band on general chat. The question to ask is not how fast the draft is but what alpha is on your traffic. Below roughly 0.55, speculative decoding is net negative at high concurrency, because every rejected draft costs a second target forward pass. Measure alpha first, then flip the flag.

TIME: ~60 minutesPREREQUISITES: Phase 17 · 04 (vLLM Serving Internals), Phase 10 · 18 (Multi-Token Prediction)

Learning Objectives

  • Name the three generations of speculative decoding and explain what EAGLE-3 changes from EAGLE-2 and from a classic draft model.
  • Define acceptance rate alpha, compute expected speedup from alpha and K (draft length), and identify the break-even alpha for your target concurrency.
  • Explain why speculative decoding is opt-in (not default) in vLLM 2026 and why turning it on without measuring alpha is a production anti-pattern.
  • Write a measurement plan: which benchmark, which prompt distribution, which concurrency point, which metric to gate on.

The Problem

Decode is memory-bound. On an H100 running Llama 3.3 70B FP8, each decoded token reads ~140 GB/s of weights and emits one token. The GPU compute sits mostly idle during decode, because the bottleneck is HBM bandwidth and not matmul throughput.

Speculative decoding exploits that gap. A cheap draft model generates K candidate tokens, then the target model verifies all K in a single forward pass. A verified token is nearly free, since it is amortized into a K-wide forward the target would have had to run anyway.

The classic approach uses a smaller model from the same family (Llama 3.2 1B drafting for Llama 3.3 70B). It works, but acceptance rate is mediocre because the small model's distribution diverges from the target's. EAGLE, then EAGLE-2, then EAGLE-3 train a light draft head directly on the target model's internal states, so the draft tracks the target much more closely. That is why alpha goes from 0.4 with a draft model to 0.6-0.8 with EAGLE-3.

The catch is that EAGLE-3 is opt-in in vLLM 2026. You have to set speculative_config explicitly, and without it you get no acceleration. Teams that flip it on without measuring alpha on their real traffic often see tail latency get worse, not better.

Warm-up0/3
1. In an LLM serving benchmark, what does TTFT measure?Warm-up
A timeline with four landmarks on a streamed response: request arrives, first token, more tokens stream, response complete. A question asks which two landmarks TTFT spans.
Everyday setup; no specific service named.
2. What does a P99 latency number tell you?Warm-up
A bar chart of request latencies sorted from fastest to slowest, with the last roughly one percent of bars marked in a different color near the slow end.
Illustrative distribution; no real benchmark figures.
3. You want to know whether a new serving setting helps your production traffic. What is the sound first step?Warm-up
A production setup box next to a new setting box marked currently off, with a question about the sound first step before deciding whether the setting helps.
Everyday setup; no lesson-specific numbers.
Check: The Problem0/4
1. Why does speculative decoding exploit a gap that exists in plain decode?Explain
Two unlabeled usage gauges for one decode step on an H100 running Llama 3.3 70B FP8: one for HBM bandwidth use, one for matmul compute use, both drawn empty with a question mark, next to boxes noting the step reads about 140 GB/s of weights and emits one token.
Figures from the lesson's Problem section; gauge levels are the question.
2. Why are verified draft tokens nearly free for the target model?Explain
K drafted tokens flowing into a single target-model forward pass that both verifies and emits, with the cost of that pass marked unknown, and a question about why checking K tokens is nearly free for the target.
The one-forward structure is the lesson's definition of speculative decoding; the reason it's cheap is the question.
3. Why does a classic same-family draft model reach a lower alpha (0.3-0.5) than an EAGLE head?Explain
Two boxes side by side, a classic draft model described as small and same family as the target with alpha 0.3-0.5, and an EAGLE head described as trained on the target's own states with alpha left unknown, next to a question about why the gap exists.
The classic alpha range is given in the stem; the EAGLE head's exact value is not needed for the why.
4. Why is speculative decoding opt-in (not default) in vLLM 2026?Explain
A box for speculative_config showing its default as unset, with a note that no config means no acceleration, and a question about why this is opt-in rather than a safe default.
The opt-in default is stated elsewhere in the lesson; the reasoning is the question.

The Concept

What speculative decoding actually buys

Without spec decode, each token costs one target forward. With draft length K and acceptance rate alpha, the expected number of tokens per target forward is 1 + K * alpha. The speedup is (1 + K * alpha) / (1 + epsilon), where epsilon is the draft-plus-verify overhead. For K=5, alpha=0.7: (1 + 5*0.7) / (1 + 0.1) = 4.5 / 1.1 = 4.1x. Real-world numbers cluster around 2-3x, because alpha is rarely that high on production traffic and epsilon grows at high batch size.

Why alpha comes first

Rejected tokens do not disappear. They force a second target forward for the first rejected token. On a workload where alpha drops to 0.4, you pay draft overhead, then verification, then the re-roll. At high concurrency (say 256 concurrent) the decode batch is already large enough that the memory-bandwidth gap between "target alone" and "target with verify" shrinks. Below alpha 0.55 on most 2026 hardware, spec decode is net negative.

Alpha varies by workload. On ShareGPT-style general chat, EAGLE-3 trained on ShareGPT hits 0.6-0.8. On domain-specific traffic (code, medical, legal) a draft head trained on general data drops to 0.4-0.6. Training a domain-specific draft head recovers alpha, and it is a light, quick job compared to finetuning the target.

EAGLE generations at a glance

  • Classic draft model: a small model of the same family. Alpha 0.3-0.5. The infrastructure is simple: two models loaded, and the draft runs K forwards per target forward.
  • EAGLE-1 (2024): a single draft head trained on the target's last-layer hidden states. Alpha ~0.5-0.6, with a small parameter overhead on top of the target.
  • EAGLE-2 (2025): adaptive draft length and tree-based drafts, so multiple branches get verified in one target pass. Alpha ~0.6-0.7, at the price of a more complex draft scheduler.
  • EAGLE-3 (2025-2026): a draft head trained on multiple target layers instead of just the last, which gives better alignment. Alpha ~0.6-0.8 on general chat.

The 2026 production recipe

  1. Ship the target model plain. Measure baseline TTFT, ITL, and throughput at your target concurrency.
  2. Enable the EAGLE-3 draft via vLLM speculative_config and re-run the benchmark.
  3. Log acceptance rate alpha. vLLM V1 reports it as spec_decode_metrics.accepted_tokens_per_request; divide by the requested draft length to get alpha.
  4. If alpha < 0.55 on your production traffic distribution, disable spec decode or train a domain-specific EAGLE-3 draft.
  5. Re-run at production concurrency and confirm P99 ITL did not get worse.

The production pitfall: P99 tail

Mean ITL drops with spec decode, but P99 can get worse if you do not tune. A rejected draft triggers a two-pass sequence (draft, verify-fail, reroll), and under a full batch those two passes serialize. Watch P99 ITL, not P50.

Where EAGLE-3 is already deployed

Google deployed speculative decoding in AI Overviews in 2025 (same quality, faster response). vLLM V1 ships speculative_config as the documented interface, and N-gram GPU speculative decoding in V1 is the variant that works with chunked prefill. SGLang supports EAGLE-3 as the recommended draft path for prefix-heavy workloads.

Break-even math in one line

Expected speedup is S(alpha, K) = (1 + K*alpha) / (1 + verify_overhead). Set S = 1 and solve for alpha: alpha_breakeven = verify_overhead / K. With a typical verify_overhead of ~0.15 and K=5, that gives alpha_breakeven = 0.03. But that is the raw decode math. At high concurrency the verify overhead rises and the decode batch already amortizes memory reads across sequences, so the effective alpha_breakeven climbs to ~0.45-0.55 in practice.

When not to use speculative decoding

  • Batch-1 offline generation where latency does not matter. Use the plain target.
  • Very short outputs (under 50 tokens). Draft overhead and verify cost dominate.
  • Specialized domains without a domain-trained draft head. Alpha is too low.
  • vLLM v0.18.0 with draft-model spec decode and --enable-chunked-prefill. This combination does not compile. The documented exception is N-gram GPU spec decode in V1.
Check: The Concept0/26
1. What is speculative decoding?Define
A card naming the term "speculative decoding" tagged with the lesson section The Problem, under the note: Applied during decode on an H100 serving Llama 3.3 70B FP8, where the GPU sits mostly idle on compute. A question asks: The term describes:
2. What does the acceptance rate alpha measure?Define
A card naming the term "acceptance rate alpha" tagged with the lesson section Key Terms / The Concept, under the note: Across the techniques this lesson compares, reported values span roughly 0.3 to 0.8. A question asks: What does alpha measure?
3. What is draft length K in speculative decoding?Define
A card naming the term "draft length K", tagged Key Terms, with a note that typical production values run 4 to 8 shown as five dots, and a question asking what K counts.
4. What does the verify overhead epsilon represent?Define
A card naming the term "verify overhead epsilon" tagged with the lesson section Key Terms, under the note: It sits in the denominator of this lesson's speedup formula, alongside K and alpha. A question asks: What does epsilon represent?
5. What is EAGLE-3?Define
A card naming the term EAGLE-3, tagged with the lesson section EAGLE generations at a glance, above four named approaches in a row: classic draft, EAGLE-1, EAGLE-2 and EAGLE-3, the last one outlined. No description is given for any of the four.
The newest of four approaches this lesson names; what changed is the question.
6. What does `speculative_config` do in vLLM V1?Define
A card naming the term "speculative_config" tagged with the lesson section The 2026 production recipe, under the note: A field you set in vLLM before re-running the benchmark step. A question asks: What does speculative_config do?
7. What is N-gram speculative decoding?Define
A card naming the term "N-gram spec decode" tagged with the lesson section Key Terms, under the note: One of several named drafting approaches this lesson compares, alongside the classic model and EAGLE heads. A question asks: What is N-gram speculative decoding?
8. What is the break-even alpha?Define
A card naming the term "break-even alpha" tagged with the lesson section Break-even math in one line, under the note: A single number this lesson derives from a formula, not a measured rate. A question asks: What is break-even alpha?
9. What is the rejected-draft two-pass?Define
A card naming the term "rejected-draft two-pass" tagged with the lesson section Why alpha comes first, under the note: Something that happens during decode specifically when a drafted token turns out wrong. A question asks: What is the rejected-draft two-pass?
10. What did EAGLE-2 add over EAGLE-1?Explain
Two boxes, EAGLE-1 with alpha about 0.5 to 0.6 and EAGLE-2 with alpha about 0.6 to 0.7, joined by an arrow, with a question about what changed between them. No feature is named for either box.
Alpha ranges from the lesson's generation list; the feature that changed is the question.
11. Why does a rejected draft token make a request slower than plain decoding?Explain
Five drafted tokens d1 through d5 in a row; d1 and d2 are accepted, d3 is marked rejected, and d4 and d5 are dashed out as not yet resolved. A question asks what happens next and why the request is slower.
Schematic of one draft batch; which tokens follow a rejection is not specified.
12. Why is the practical alpha gate about 0.55 on most 2026 hardware, not close to zero?Explain
A number line with a point for the raw break-even formula's result near one end and a point for the practical 0.55 gate much farther along, with a dashed span between them marked gap and a question mark; the raw formula's exact value is not given.
The 0.55 gate is stated in the lesson text; the raw formula's own value is deliberately left out.
13. Why does speculative decoding help less at 256 concurrent requests than at low concurrency?Explain
Two horizontal bars comparing a small low-concurrency batch to a 256-request batch, with a note that speculative decoding's speedup shrinks as concurrency rises and a question about why.
Illustrative batch sizes; the figure 256 matches the lesson's high-concurrency case.
14. Alpha drops to 0.4-0.6 on code or legal traffic with a general-chat draft head. What is the cheaper fix?Explain
A head trained on general chat, where it reaches a higher alpha, run instead on code or legal traffic where alpha drops to 0.4 to 0.6, with a question about the cheapest fix compared to finetuning the whole target model.
The degraded alpha range is given in the stem; the fix itself is the question.
15. Which metric should you watch most closely after flipping EAGLE-3 on, even if mean ITL drops?Explain
A single stat tile showing mean ITL moving down, with a note that a serving dashboard tracks several other latency stats, and a question about which one deserves the closest watch.
Only the given stat (mean ITL) is drawn; the other candidates are not listed.
16. Which of these is a case where you should NOT use speculative decoding?Explain
Three unresolved axes stacked vertically, each followed by a question mark: estimated output length, measured alpha on this traffic, and whether a domain-trained draft head exists. A question asks which combination argues against using speculative decoding.
The three axes are real considerations from the lesson; none is given a value here.
17. vLLM V1 reports spec_decode_metrics.accepted_tokens_per_request = 3.5 with a requested draft length of 5. What is alpha?Apply
A table of two reported values, accepted_tokens_per_request 3.5 and requested draft length 5, above the formula alpha equals accepted tokens per request divided by requested draft length, with the result left as a question mark.
18. Using expected tokens per target forward = 1 + K*alpha, how many tokens does a forward yield with K=4 and alpha=0.5?Apply
A table giving K equals 4 and alpha equals 0.5, above the formula 1 plus K times alpha with the result left as a question mark.
19. Using the formula (1 + K*alpha) / (1 + epsilon), what speedup do K=5, alpha=0.7, epsilon=0.1 produce?Apply
A table giving K equals 5, alpha equals 0.7 and epsilon equals 0.1, above the speedup formula with the result left as a question mark.
20. With verify_overhead 0.15 and K=5, what does alpha_breakeven = verify_overhead / K give?Apply
A table giving verify_overhead equals 0.15 and K equals 5, above the formula alpha breakeven equals verify overhead divided by K, with the result left as a question mark.
21. After enabling EAGLE-3, mean ITL drops 25% but P99 ITL rises 15%. What explains this?Analyze
Two stat tiles, mean ITL down 25 percent and P99 ITL up 15 percent, with a question about why the two latency stats move in opposite directions.
Both figures are given in the stem.
22. Traffic is 70% chat (alpha 0.7) and 30% code (alpha 0.4). The team gates on blended alpha, ships, and code users report slowdowns. What went wrong?Analyze
Two bars, chat traffic at alpha 0.7 and code traffic at alpha 0.4, both plotted against a dashed gate line at 0.55, with a note that the rollout shipped on a blended average and code users reported slowdowns.
Per-slice alphas and the gate are given directly in the stem.
23. A team deploys an EAGLE-3 draft head alongside Llama 3.3 70B but throughput matches the baseline. What is the most likely cause?Analyze
A box for an EAGLE-3 draft head with its weights loaded next to a box showing measured throughput matching the baseline, with a note that no acceleration appeared and a question about the likely cause.
Loaded weights and flat throughput are given in the stem; the cause is the question.
24. On vLLM v0.18.0 a server with draft-model speculative decoding and --enable-chunked-prefill fails to compile. Which option does the lesson document as working?Analyze
A box for vLLM v0.18.0 with draft-model spec decode plus chunked prefill enabled, marked compile fails, above a dashed box for a documented alternative with a question mark, asking which configuration is documented as working instead.
The failing combination is stated in the lesson; the working alternative is not named here.
25. You enable EAGLE-3 on a code-assistant workload at 256 concurrent requests. Measured alpha is 0.45, mean ITL drops 20%, and P99 ITL rises 12%. What is the best next step?Design
A bar comparing a measured alpha of 0.45 against the 0.55 gate, with mean ITL down 20 percent and P99 ITL up 12 percent, and a question about the best next step.
All four figures are given directly in the stem.
26. Your product returns mostly 20-40 token answers, and a trained EAGLE-3 head reaches alpha 0.7 on your traffic. What should you do?Design
A token-length axis with a bar spanning 20 to 40 tokens and a marked line at the 50-token point, above a note that alpha is 0.7 on this traffic, and a question about what to do.
Length range and alpha are given in the stem.

Use It

code/main.py simulates a decode loop with and without speculative decoding across a range of alpha values and draft lengths K. It prints the break-even alpha, the speedup, and the tail behavior. Run it on a few (alpha, K) combinations and see where speculative decoding stops paying.

Check: Use It0/3
1. The toy in main.py scales verify overhead by (1 + concurrency/256) from a base of 0.15. With K=5, what break-even alpha does it print at concurrency 128?Apply
A table giving base verify_overhead 0.15, K equal 5 and concurrency 128, above a question for the break-even alpha the toy prints at that concurrency.
Scaling rule and inputs are from main.py; the printed figure is the question.
2. A teammate cites main.py's break-even alpha of 0.045 at concurrency 128 to argue that alpha 0.2 is safe to ship. What is wrong with that argument?Analyze
A box stating the toy prints a break-even alpha of 0.045 at concurrency 128, with an arrow to a claim that alpha 0.2 is therefore safe, and a question about whether that comparison is the right one.
Both figures (0.045 and 0.2) are given directly in the stem.
3. In main.py's output every row gets a TAIL tag, even at alpha 0.80 with K=5. How should you read that?Analyze
A single captured output row from main.py for alpha 0.80, K=5, concurrency 256, tagged TAIL, with a question about how to read that tag.
Captured by importing the lesson's main.py; repeated spaces collapsed.

Ship It

This lesson produces outputs/skill-eagle3-rollout.md. Give it a target model, a traffic distribution description, and a concurrency target, and it returns a staged EAGLE-3 rollout plan: benchmark the baseline, enable the config, measure alpha, gate on alpha >= 0.55, and watch P99 ITL.

Check: Ship It0/1
1. You roll out EAGLE-3 for a support bot (general chat plus code snippets) at 128 concurrent requests. Which measurement plan fits?Design
A box for support-bot traffic made of chat and code snippets, a note that the target concurrency is 128, and a question mark for the measurement plan.
Traffic mix and concurrency are given in the stem; the plan itself is not described here.
Author's Note

I'd run main.py and read it with some suspicion. Its break-even alpha comes out at 0.034, 0.045, and 0.060 for concurrency 32, 128, and 256, because it only scales verify overhead by 1 + concurrency / 256. That is nowhere near the 0.55 gate in the production recipe. The gate comes from how real servers behave under load, which the toy does not model. The closing "KEY FINDING" text in the output also quotes ~0.1 and ~0.4, and the table above it does not back those up. Trust the table.

The same goes for the TAIL tags. Every row gets one, even at alpha 0.80, because the simulator charges a reroll on any batch where fewer than K drafts are accepted, and at K=5 that is most batches. Treat it as a picture of why mean ITL and P99 ITL can move in opposite directions, and not as a P99 measurement.

My bet is that the habit worth keeping is gating per traffic slice. The code splits nothing by workload, but the body's own numbers (0.6-0.8 on chat, 0.4-0.6 on code) show how a blended alpha can look fine while one slice sits under the line. I'd log alpha separately for each slice before deciding to ship.

Exercises

  1. Run code/main.py. At K=5, what alpha do you need for a 2x speedup? For a 3x speedup? How sensitive is that to verify_overhead?
  2. Imagine production traffic splits 70% general chat, 30% code. General chat hits alpha 0.7 with EAGLE-3 trained on ShareGPT; code hits alpha 0.4. What is blended alpha and is spec decode net-positive?
  3. Read the vLLM speculative_config documentation. Name the three modes (draft model, EAGLE, N-gram) and which one is compatible with chunked prefill.
  4. You see mean ITL drop 25% after enabling EAGLE-3 but P99 ITL went up 15%. Diagnose and propose a mitigation.
  5. Compute the memory cost of the EAGLE-3 draft head for Llama 3.3 70B. How does it compare to running Llama 3.2 1B as a classic draft?

Key Terms

TermWhat people sayWhat it actually means
Speculative decoding"draft plus verify"Propose K tokens with a cheap model, verify all K in one target forward
Acceptance rate alpha"spec accept rate"Fraction of draft tokens accepted by the target; the only metric that matters
Draft length K"spec k"How many tokens the draft proposes per target forward; typical 4-8
Verify overhead epsilon"spec overhead"Extra cost to verify-and-reroll vs a plain target forward; grows with batch
EAGLE-3"latest EAGLE"2025-2026 variant; trains draft head on multiple target layers; alpha 0.6-0.8 on general chat
speculative_config"vLLM spec config"The explicit opt-in in vLLM V1; no default means no acceleration
N-gram spec decode"N-gram draft"GPU-side draft using N-gram lookups in the prompt; chunked-prefill-compatible
Break-even alpha"no-op alpha"Alpha at which spec decode gives zero speedup; watch this at production concurrency
Rejected-draft two-pass"reroll cost"Two target forwards when drafts reject; drives P99 tail

Further Reading

Code

Ships With