↑↓ move Enter open ⌘K find from any page 256 of 256 tabs
Loading the recording…

Drafting at the feature level

Speculative decoding drafts a few tokens cheaply and lets the large model check them all in one forward. Medusa's heads draft every position independently from one hidden state; a separate small language model drafts autoregressively but has to understand the text from scratch. EAGLE sits between the two. Its draft model is one transformer layer that runs autoregressively on the large model's own features, the hidden state just before the LM head, which the paper calls the second-to-top-layer feature. Predicting the next feature turns out to be easier than predicting the next token, and Vicuna's own LM head turns each predicted feature into a token distribution.

The page runs the EAGLE draft for Vicuna-7B v1.3 with EAGLE-2's dynamic tree on the Medusa tab's prompt, greedily, in float16 on the Mac's GPU, so the two tabs compare step for step.

The draft model

A feature alone does not say which token was sampled from it, and the next feature depends on that choice. EAGLE removes this uncertainty by feeding the draft the feature together with the embedding of the token one place later, :

Here maps the 8,192 concatenated numbers back to Vicuna's width of 4,096, Layer is one Llama decoder layer, and the embedding and LM head are Vicuna's own, frozen. The layer and fc have 236 M parameters, run here in float32. The paper trains them with a regression loss on the predicted feature plus a cross-entropy loss on the token it implies. The Draft model panel draws this pipeline.

Catch-up, then drafting

Each step starts with a catch-up: the draft reads Vicuna's true features for the tokens accepted in the last step, paired with their next tokens, so its own key-value cache stays in line with what Vicuna really computed. Then it drafts on its own predictions, feeding each predicted feature back in with the embedding of the token drafted from it.

The Draft feature vs Vicuna's panel compares, along the path Vicuna accepted, the draft's predicted features with Vicuna's real ones, with their cosine similarity per depth. Errors compound: each depth builds on the previous prediction, not on Vicuna's feature.

A dynamic draft tree

EAGLE-2 observed that the draft's confidence approximates how likely a token is to be accepted, so the tree can follow the context instead of having a fixed shape. Each candidate gets a path score, the sum of the draft's log-probabilities from the root:

In each of five expansion rounds the 10 best of the newest nodes are fed back through the draft and each proposes its 10 most likely children. After the rounds, all candidates are ranked by path score and the best 60 form the tree that Vicuna checks. The Depth 1 and Growing the tree panels show this ranking at the current step, and the Draft tree panel shows the result: deep where the draft is sure, wide where it is not.

Verification

Verification is Medusa's: the 60 tokens go through Vicuna in one forward under a tree attention mask (each sees the cached prefix, its ancestors and itself), a draft is kept when it equals Vicuna's argmax after its parent, and the path with the longest kept prefix wins. Vicuna's argmax after the last kept token is the next root, and Vicuna's features at the kept nodes feed the next catch-up.

The answer is the same 75 tokens as plain greedy decoding and as the Medusa tab's. EAGLE takes 18 Vicuna forwards after the prompt, 4.17 tokens per forward, where Medusa takes 31 and greedy 75. One step kept no draft, one kept one, six kept two, two kept three, three kept four, three kept five and two kept six; the Decoding steps strip draws EAGLE's steps above Medusa's on one scale.

Time on this Mac

Each step costs six forwards of the draft layer plus one Vicuna forward over the 60-token tree. Measured on this Mac, a step took 76 ms drafting and 327 ms verifying on average, against 197 ms for one greedy token: 10.34 tokens per second against greedy's 5.09. A draft forward reads 0.7 GB of weights (its layer and Vicuna's LM head) against 13.5 GB for a Vicuna forward. The Mac paged 3.8 GB in while these were timed, which slows greedy's many forwards most, so the counted forwards are the fairer comparison. On GPUs the EAGLE paper reports 2.7–3.5× lower latency for LLaMA2-Chat 70B, and EAGLE-2 3.05–4.26× speed-ups.

Where it came from

Li, Wei, Zhang and Zhang introduced EAGLE in 2024 and the dynamic tree in EAGLE-2 the same year. EAGLE-3 (2025) dropped the feature-regression loss, fed the draft a fusion of the target's low, middle and high-layer features instead of the top one alone, and trained it on its own predictions (training-time test) so that acceptance keeps improving with more training data. The block drafters on the DFlash and DSpark tabs keep EAGLE-3's multi-layer features but draft a whole block in one forward instead of one token at a time; the MTP tab drafts with a model's own multi-token-prediction layer.

Papers

  1. EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty Yuhui Li, Fangyun Wei, Chao Zhang, Hongyang Zhang · ICML 2024 The draft model on this page: one layer that predicts the next second-to-top-layer feature from the current one and the next token's embedding.
  2. EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees Yuhui Li, Fangyun Wei, Chao Zhang, Hongyang Zhang · EMNLP 2024 The context-dependent tree this page builds: expand the best nodes by path score, then keep the best candidates for verification.
  3. EAGLE-3: Scaling up Inference Acceleration of Large Language Models via Training-Time Test Yuhui Li, Fangyun Wei, Chao Zhang, Hongyang Zhang · NeurIPS 2025 Fuses features from several layers, drops the feature loss and trains on the draft's own outputs; the base of the DFlash and DSpark drafters.
  4. Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads Tianle Cai et al. · ICML 2024 Independent heads and a fixed tree, the comparison on this page, and the tree attention EAGLE verifies with.
  5. Fast Inference from Transformers via Speculative Decoding Yaniv Leviathan, Matan Kalman, Yossi Matias · ICML 2023 The draft-then-verify scheme and the acceptance rule that keeps the target model's output distribution.
  6. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena Lianmin Zheng et al. · NeurIPS Datasets and Benchmarks 2023 The paper Vicuna's model card cites for Vicuna, the base model whose features the EAGLE draft predicts.

See also