EAGLE-4: speculative decoding that changes its draft tree with batch size and hardware

EAGLE-4 adds a calibrated cost model to EAGLE-style speculative decoding: it drafts wide trees when verification is cheap and narrow chains when the GPU is busy. We explain the method, the reported speedups (3.4x at one request, 1.35x at 64 on SGLang), the source-available license, and give a runnable toy model of the trade-off.
In short
EAGLE-4 is the fourth version of the EAGLE speculative-decoding method. It was published on 20 October 2026 with inference code for SGLang and vLLM and a drafter for Qwen3.8-27B. Its main new idea is that the shape of the draft (a single chain of guesses or a wider tree of alternatives) is not fixed. A cost model, calibrated once on the target hardware, decides at every step whether a wider or deeper draft is worth its verification cost. This matters because speculative decoding gives large speedups for single users but often little at high batch sizes, and EAGLE-4 tries to adapt between these two cases automatically.
How it works
Speculative decoding in one paragraph. A large model (the target) normally produces one token per forward pass. In speculative decoding, a small, fast drafter first guesses several next tokens. The target then checks all guesses in a single forward pass and keeps the longest prefix that it agrees with, plus one token of its own. With the right acceptance rule, the output has exactly the same probability distribution as normal decoding; only the speed changes.
EAGLE drafters. Since its first version, EAGLE does not use a separate small language model. Its drafter is a light network that reads the target's own hidden states together with token embeddings. According to the EAGLE-4 documentation, the drafter reads three hidden states of the target, like EAGLE-3. Two changes reduce the drafter's own cost in the released Qwen3.8-27B drafter:
- Sliding-window attention: the drafter only attends to a recent window of tokens plus the current branch of the draft tree.
- Low-rank candidate head: the drafter first scores the vocabulary in a small, low-rank space, picks a few candidates, and computes exact logits only for those. It does not run the full vocabulary output layer for every draft step.
Adaptive tree. Instead of one chain of guesses, the drafter can propose several alternatives at each position, which forms a tree. The target verifies the whole tree in one pass with a tree attention mask, where each node only sees its own ancestors. A tree raises the chance that at least one branch is accepted, but it also makes the verification pass larger.
Analogy: when you are not sure which train your friend will take, you can wait at one platform (a chain) or ask several people to wait at several platforms (a tree). Extra helpers are cheap when the station is empty and expensive when it is crowded.
Under the hood
When is a wider tree worth it? At batch size 1, a GPU is limited by memory bandwidth: it must read all weights for each forward pass, whether it processes 1 token or 16. Extra draft tokens are almost free to verify. At large batch sizes, the GPU is limited by compute, and every extra verified token costs real time. A fixed tree that is good for one regime is wasteful in the other.
EAGLE-4's harness. A one-time offline calibration measures the verify latency on the target GPU type and parallelism setup, as a table indexed by batch size, context length and number of candidates. During decoding, the harness estimates how much cumulative acceptance probability a deeper or wider level would add, and divides this by the measured marginal cost. It keeps growing the tree only while that ratio is above a threshold. A node's score is its parent's score multiplied by its own probability, and the verify set is the best-scoring nodes. The result, according to the authors, is a wide and deep tree at batch size 1 or long context, and a narrow tree or plain chain at large batch sizes. The documentation does not publish the exact cost formula, threshold value, window size or the rank of the candidate head.
Reported speedups (Qwen3.8-27B, temperature 0, 4× NVIDIA B300, SPEED-Bench client, relative to the same engine without speculation; from the repository README).
| Engine | 1 request | 8 concurrent | 64 concurrent |
|---|---|---|---|
| SGLang | 3.40× | 1.91× | 1.35× |
| vLLM | 2.99× | 1.70× | 1.16× |
| TokenSpeed (experimental) | not measured | 2.02× | 1.42× |
On one AMD MI355X with SGLang, the README reports 2.07× at 8 and 1.56× at 32 concurrent requests. The pattern is the expected one: the speedup shrinks as the batch grows, because verification is no longer free.
Tree versus chain (fal and Fireworks analysis, 20 October 2026). With a verification budget of 16 tokens, the mean acceptance length was 21–26% higher than for a chain, depending on the benchmark. On prompts with the highest entropy (where the next token is hardest to predict), the acceptance length was 2.66 tokens per step, versus 2.97 on the lowest-entropy quartile. At one concurrent request, the harness reached 660.6 tokens per second, 1.63× faster than the fastest alternative drafter that was tested (DSpark, DFlash2 or a static chain).
Limits.
- All numbers come from the authors and their partners, on one target model and very new hardware.
- The paper is a preprint PDF in the repository; we found no peer-reviewed version.
- The code is source-available, not open source: the Eagle 4 Source-Available License requires a separate license for competing offerings and has a USD 20 million revenue threshold for other commercial use.
- Speculative decoding saves time, not compute: rejected draft tokens are wasted work, which is one reason the benefit drops at high load.
Try it yourself
Without a GPU: a toy cost model. The script below uses the classic expected-length formula for speculative decoding. If each level is accepted with probability a and the draft has d levels, the expected number of tokens per verify step is (1 − a^(d+1)) / (1 − a). We add a simple verify-cost model in which the GPU is free up to 256 tokens per pass and then becomes linear. All parameters are assumptions for illustration, not EAGLE-4 measurements. Tested with Python 3.13, no packages needed.
def expected_tokens(a, depth):
return (1 - a ** (depth + 1)) / (1 - a)
def verify_cost(width, batch):
return max(1.0, batch * width / 256) # assume the GPU saturates at 256 tokens per pass
def speedup(a, depth, k, batch, draft_cost=0.05):
width = 1 + depth * k # root + k candidates per level
cost = verify_cost(width, batch) / verify_cost(1, batch) + depth * draft_cost
return expected_tokens(a, depth) / cost
for batch in (1, 64):
print(f"batch={batch}")
for name, a, k in (("chain, top-1", 0.70, 1), ("wide, top-4", 0.85, 4)):
best = max(range(1, 13), key=lambda d: speedup(a, d, k, batch))
print(f" {name:13s} best depth={best:2d} speedup={speedup(a, best, k, batch):.2f}x")
Expected output:
batch=1
chain, top-1 best depth= 6 speedup=2.35x
wide, top-4 best depth=10 speedup=3.70x
batch=64
chain, top-1 best depth= 3 speedup=2.20x
wide, top-4 best depth= 1 speedup=1.42x
The wide draft wins clearly at batch size 1 and loses at batch size 64. This is the trade-off that EAGLE-4's cost model tries to resolve per step. Change the saturation point (256) to match your own GPU and watch where the crossover moves.
With real hardware. The repository targets Linux with four NVIDIA GPUs and a CUDA 13 driver (tested on B300) and about 70 GB of disk. Its Docker example starts SGLang with --speculative-algorithm EAGLE_HARNESS and the drafter EAGLE-Corp/Qwen3.8-27B-EAGLE4. Measure tokens per second with and without the speculative flags, at 1 and at 64 concurrent requests. We did not run this part ourselves.
Sources
What should happen next with this?
One click per article, no account needed. “Go deeper” feeds the research queue.