Autoregressive decoding in Large Language Models (LLMs) suffers from a fundamental hardware utilization paradox. Generating $K$ sequential tokens from a standard causal Transformer requires $K$ serial forward passes through the entire network. During the prefill phase—when an incoming prompt is processed—the accelerator executes massive matrix-matrix multiplications (GEMMs) that saturate Tensor Core compute throughput. However, once generation transitions into token-by-token autoregressive decoding, each step processes only a single token per sequence. The computation degenerates into matrix-vector operations where the arithmetic intensity (FLOPs executed per byte transferred) collapses. As a consequence, modern AI accelerators spend the vast majority of each decoding step stalled on High-Bandwidth Memory (HBM) transfers, streaming billions of model weights from HBM into on-chip SRAM caches merely to emit a single token ID.
To break this sequential memory-bandwidth bottleneck without degrading output quality, Speculative Decoding (also formulated as Speculative Sampling) and Multi-Token Prediction (MTP) have become the foundational execution paradigm for low-latency LLM serving in 2026. Rather than treating every token generation step as an irreducible serial barrier, speculative execution separates token generation into two distinct phases: rapid drafting of $\gamma$ candidate future tokens, followed by parallel verification of all drafted tokens within a single target-model forward pass. Combined with modified rejection sampling, speculative decoding mathematically guarantees that the final emitted token sequence follows the exact probability distribution of the target model—making the acceleration completely lossless within hardware floating-point numerics.
- ✓Exact Distribution Preservation via Modified Rejection Sampling: Pioneered independently by Leviathan et al. (2022/2023) on T5-XXL (achieving 2x–3x speedup) and Chen et al. (2023) on 70B Chinchilla (achieving 2x–2.5x speedup), speculative sampling accepts draft tokens with probability $\min(1, p(x)/q(x))$ and resamples rejected tokens from the residual distribution $\text{norm}(\max(0, p(x) - q(x)))$, preserving the exact target distribution.
- ✓Eliminating Separate Draft Models with Medusa and Lookahead: Medusa augments the target backbone with multiple parallel decoding heads and tree-based attention verification (achieving over 2.2x lossless speedup in Medusa-1 and 2.3x–3.6x in Medusa-2), while Lookahead Decoding uses Jacobi iteration and n-gram caches to reach up to 1.8x speedup on MT-bench and 4x with multi-GPU strong scaling on code completion without any draft model.
- ✓Feature-Level Drafting & Dynamic Draft Trees (EAGLE-1 to EAGLE-3): EAGLE resolves feature uncertainty by advancing token inputs by one time step during second-to-top-layer autoregression (2.7x–3.5x speedup on LLaMA2-Chat 70B). EAGLE-2 introduces context-aware dynamic draft trees (3.05x–4.26x speedup, 20%–40% faster than EAGLE-1), and EAGLE-3 replaces feature prediction constraints with multi-layer feature fusion and training-time test to reach up to 6.5x speedup and 1.38x throughput gain at batch size 64 in SGLang.
- ✓Pre-Training with Multi-Token Prediction (Meta FAIR & DeepSeek-V3): Training models from scratch to predict multiple future tokens simultaneously improves both representation quality and inference speed—Meta FAIR's 13B 4-token prediction models solve 12% more HumanEval and 17% more MBPP problems with up to 3x faster inference, while DeepSeek-V3 (671B total parameters, 37B active per token, pre-trained on 14.8 trillion tokens) integrates sequential MTP modules natively into pre-training and speculative inference.
Measured wall-clock acceleration on T5-XXL over standard T5X with identical output distributions (arXiv:2211.17192).
Lossless decoding speedup across three LLM families and six evaluation tasks, 20%–40% faster than EAGLE-1 (arXiv:2406.16858).
Peak speedup via multi-layer feature fusion and direct token prediction, plus 1.38x throughput at batch size 64 (arXiv:2503.01840).
Total vs. active parameters trained on 14.8T tokens with native Multi-Token Prediction objective (arXiv:2412.19437).
The Memory-Bandwidth Roofline and Arithmetic Intensity Bottleneck of Autoregressive Decoding
To understand why speculative decoding yields substantial speedups without reducing total floating-point operations (and in fact while slightly increasing total FLOPs), one must analyze autoregressive Transformer inference through the lens of the hardware Roofline Model. Every modern GPU or AI accelerator is characterized by two physical ceilings: peak compute throughput (measured in TFLOPS or PFLOPS on Tensor Cores) and peak off-chip memory bandwidth (measured in terabytes per second between HBM and on-chip SRAM). The ratio of peak compute to peak memory bandwidth defines the hardware's ridge point (or critical operational intensity), expressed in FLOPs per byte of memory traffic.
During standard autoregressive generation at small or moderate batch sizes, the model takes the current context $x_{1:t}$—whose Key and Value projections are already stored in the KV cache—and computes the logits for token $x_{t+1}$. For every linear projection matrix $W \in \mathbb{R}^{d_{\text{in}} \times d_{\text{out}}}$ in the Transformer's attention and feed-forward blocks, the accelerator must read all $d_{\text{in}} \times d_{\text{out}}$ parameters from HBM into SRAM. However, when decoding a single token for a single request, that weight matrix only multiplies a single activation vector $h_t \in \mathbb{R}^{1 \times d_{\text{in}}}$, executing roughly $2 \cdot d_{\text{in}} \cdot d_{\text{out}}$ FLOPs. Regardless of whether the weights are stored in BF16/FP16 (2 bytes per parameter) or FP8/INT8 (1 byte per parameter), the operational intensity of single-token matrix-vector multiplication is approximately 1 to 2 FLOPs per byte. Because modern Tensor Core accelerators have ridge points ranging from 150 to over 300 FLOPs per byte, single-token autoregressive decoding operates deep inside the memory-bandwidth-bound regime, leaving over 98% of the accelerator's arithmetic units idle while waiting for HBM weight transfers.
Transformer Full Architecture Diagram (CC BY 4.0, dvgodoy)
Now consider what happens when the target Transformer evaluates $\gamma + 1$ contiguous tokens in parallel during a single forward pass—specifically, the last verified token plus $\gamma$ speculative draft tokens. The exact same weight matrices $W$ are fetched from HBM into SRAM once, but they now multiply a matrix of $\gamma + 1$ activation vectors $H \in \mathbb{R}^{(\gamma + 1) \times d_{\text{in}}}$. Because the computational cost scales linearly with $\gamma + 1$ while the HBM weight transfer cost remains virtually constant, the wall-clock latency of scoring $\gamma + 1$ tokens in parallel is almost identical to the latency of scoring a single token, provided that $(\gamma + 1) \times \text{batch\_size}$ remains below the hardware's compute-bound ridge point.
Speculative decoding does not reduce the theoretical FLOPs required to generate a sequence; instead, it converts wasted, idle Tensor Core cycles during HBM weight reads into productive parallel verification work. As long as the cost of generating $\gamma$ draft tokens is significantly smaller than the expected number of accepted tokens per verification pass, end-to-end wall-clock latency drops precipitously.
Watch this clear architectural walkthrough from IBM Technology explaining how speculative decoding uses a lightweight draft mechanism and parallel target verification to eliminate sequential decoding bottlenecks:
Foundational Speculative Decoding and Modified Rejection Sampling Mathematics (Leviathan et al. & DeepMind)
The formal mathematical foundation of speculative decoding was established independently by Yaniv Leviathan, Matan Kalman, and Yossi Matias at Google Research (Fast Inference from Transformers via Speculative Decoding, ICML 2023 Oral, arXiv:2211.17192) and by Charlie Chen, Sebastian Borgeaud, Geoffrey Irving, Jean-Baptiste Lespiau, Laurent Sifre, and John Jumper at DeepMind (Accelerating Large Language Model Decoding with Speculative Sampling, February 2023, arXiv:2302.01318). Both papers addressed a critical requirement: accelerating generation not only under deterministic greedy decoding ($T = 0$), where verification simply checks whether each drafted token matches $\arg\max_x p(x)$, but also under stochastic temperature sampling ($T > 0$, top-$k$, or nucleus top-$p$ sampling), without altering the output probability distribution of the target model $M_p$.
Step-by-Step Mechanics of Modified Rejection Sampling
Suppose we have a large target autoregressive language model $M_p$ that defines a conditional probability distribution $p(x_t \mid x_{<t})$ over vocabulary $\mathcal{V}$, and a fast approximation (draft) model $M_q$ that defines a conditional distribution $q(x_t \mid x_{<t})$. Given an existing prefix $x_{1:n}$, a single speculative decoding iteration with lookahead depth $\gamma \in \mathbb{Z}^+$ proceeds through three mathematical stages:
- Autoregressive Drafting ($\gamma$ Serial Steps on $M_q$): The lightweight draft model $M_q$ runs $\gamma$ sequential steps to sample a sequence of speculative tokens $\tilde{x}{n+1}, \tilde{x}{n+2}, \dots, \tilde{x}{n+\gamma}$, where each token is sampled according to $\tilde{x}{n+i} \sim q(x \mid x_{1:n}, \tilde{x}_{n+1:n+i-1})$ for $i = 1, \dots, \gamma$. The conditional probability tensors $q_i(x)$ are retained in memory.
- Parallel Target Scoring (1 Forward Pass on $M_p$): The large target model $M_p$ is invoked once on the concatenated sequence $[x_{1:n}, \tilde{x}{n+1}, \dots, \tilde{x}{n+\gamma}]$. Using causal self-attention, a single forward pass of $M_p$ simultaneously produces $\gamma + 1$ conditional probability distributions: $p_1(x) = p(x \mid x_{1:n})$, $p_2(x) = p(x \mid x_{1:n}, \tilde{x}{n+1})$, up to $p{\gamma+1}(x) = p(x \mid x_{1:n}, \tilde{x}_{n+1:n+\gamma})$.
- Sequential Verification and Residual Resampling: We iterate through the drafted tokens $i = 1, \dots, \gamma$ in order. At position $i$, we draw a uniform random number $r_i \sim \text{Uniform}(0, 1)$ and compare it against the ratio of target probability to draft probability for the drafted token $\tilde{x}{n+i}$: $$\text{Accept } \tilde{x}{n+i} \quad \text{if} \quad r_i \le \min\left(1, \frac{p_i(\tilde{x}{n+i})}{q_i(\tilde{x}{n+i})}\right)$$ - If $\tilde{x}{n+i}$ is accepted, we commit $x{n+i} = \tilde{x}{n+i}$ and advance to $i + 1$. - If $\tilde{x}{n+i}$ is rejected at step $i$, all subsequent draft tokens $\tilde{x}{n+i+1:\gamma}$ are immediately discarded because they were conditioned on an unaccepted prefix. Instead of wasting the target forward pass, we immediately sample a replacement token $x{n+i}$ directly from the residual (adjusted) probability distribution $p'i(x)$: $$p'_i(x) = \text{norm}\big(\max(0, p_i(x) - q_i(x))\big) = \frac{\max(0, p_i(x) - q_i(x))}{\sum{v \in \mathcal{V}} \max(0, p_i(v) - q_i(v))}$$ - Finally, if all $\gamma$ drafted tokens are accepted without a single rejection, the target model has already computed $p_{\gamma+1}(x) = p(x \mid x_{1:n+\gamma})$ during the same parallel forward pass! We sample one additional bonus token $x_{n+\gamma+1} \sim p_{\gamma+1}(x)$, yielding up to $\gamma + 1$ committed tokens from a single target model invocation.
Proof of Lossless Distribution Identity and Expected Speedup
Why does this accept/resample rule reproduce $p(x)$ exactly? For any token $x \in \mathcal{V}$ at position $i$, the total probability $P(X = x)$ that $x$ is emitted by one step of modified rejection sampling is the sum of two mutually exclusive events: either $x$ was drafted by $M_q$ and accepted, or some token was drafted by $M_q$, rejected, and $x$ was subsequently drawn from the residual distribution $p'(x)$:
$$P(X = x) = q(x) \cdot \min\left(1, \frac{p(x)}{q(x)}\right) + \left(1 - \sum_{v \in \mathcal{V}} q(v) \min\left(1, \frac{p(v)}{q(v)}\right)\right) \cdot \frac{\max(0, p(x) - q(x))}{\sum_{v \in \mathcal{V}} \max(0, p(v) - q(v))}$$
Noting that $q(x) \min(1, p(x)/q(x)) = \min(q(x), p(x))$ and $1 - \sum_{v} \min(q(v), p(v)) = \sum_{v} (p(v) - \min(q(v), p(v))) = \sum_{v} \max(0, p(v) - q(v))$, the normalization denominator cancels the overall rejection probability $(1 - \beta)$ exactly:
$$P(X = x) = \min(q(x), p(x)) + \max(0, p(x) - q(x)) = p(x)$$
Thus, the emitted token is distributed identically to $p(x)$ across the entire vocabulary. Furthermore, Leviathan et al. proved that if the average acceptance rate per step is $\alpha = \mathbb{E}[\min(1, p(x)/q(x))]$, and token acceptances are approximated as independent Bernoulli trials with success probability $\alpha$, the expected number of tokens generated per target forward pass of length $\gamma$ is given by the truncated geometric series:
$$\mathbb{E}[\text{Tokens per Target Pass}] = \frac{1 - \alpha^{\gamma + 1}}{1 - \alpha}$$
Letting $c$ denote the wall-clock cost ratio of a single draft model forward pass relative to a single target model forward pass ($c = T_{\text{draft}} / T_{\text{target}}$), the net wall-clock speedup factor over standard autoregressive decoding is:
$$\text{Speedup}(\alpha, \gamma, c) = \frac{1 - \alpha^{\gamma + 1}}{(1 - \alpha)(\gamma c + 1)}$$
In empirical evaluations, Leviathan et al. (arXiv:2211.17192) demonstrated a 2x to 3x wall-clock acceleration on T5-XXL compared to the standard T5X implementation with identical output distributions, while Chen et al. (arXiv:2302.01318) benchmarked speculative sampling on Chinchilla (70 billion parameters) in a distributed setup and achieved a 2x to 2.5x decoding speedup without modifying the target model weights or degrading sample quality.
import torch
import torch.nn.functional as F
def speculative_rejection_sampling_step(
draft_tokens: torch.Tensor, # Shape: [gamma], int64 token IDs drafted by M_q
draft_probs: torch.Tensor, # Shape: [gamma, vocab_size], q_1..q_gamma
target_probs: torch.Tensor, # Shape: [gamma + 1, vocab_size], p_1..p_{gamma+1}
) -> torch.Tensor:
"""Lossless modified rejection sampling (Leviathan et al., 2023 / Chen et al., 2023).
Verifies gamma draft tokens against target probabilities computed in a single
parallel forward pass and returns between 1 and (gamma + 1) accepted tokens.
"""
gamma = draft_tokens.shape[0]
accepted: list[int] = []
for i in range(gamma):
tok_id = int(draft_tokens[i].item())
q_val = draft_probs[i, tok_id]
p_val = target_probs[i, tok_id]
# Acceptance probability: min(1.0, p_i(x) / q_i(x))
accept_prob = torch.clamp(p_val / torch.clamp(q_val, min=1e-12), max=1.0)
u = torch.rand((), device=draft_tokens.device)
if u <= accept_prob:
accepted.append(tok_id)
else:
# Reject and resample from residual distribution norm(max(0, p_i - q_i))
residual = torch.clamp(target_probs[i] - draft_probs[i], min=0.0)
residual_sum = residual.sum()
if residual_sum > 0:
residual_dist = residual / residual_sum
else:
residual_dist = target_probs[i]
resampled_tok = int(torch.multinomial(residual_dist, num_samples=1).item())
accepted.append(resampled_tok)
return torch.tensor(accepted, dtype=torch.long, device=draft_tokens.device)
# All gamma tokens accepted: sample bonus token (gamma + 1) from p_{gamma+1}
bonus_tok = int(torch.multinomial(target_probs[gamma], num_samples=1).item())
accepted.append(bonus_tok)
return torch.tensor(accepted, dtype=torch.long, device=draft_tokens.device)Multi-Head Parallel Drafting and Tree Attention Verification: The Medusa Architecture
While classic two-model speculative decoding works off-the-shelf, deploying a separate draft model introduces operational challenges in production serving stacks:
- You must acquire or train a compatible small model that shares the exact same tokenizer and vocabulary as the target LLM.
- In distributed multi-GPU deployments, hosting two distinct models complicates tensor-parallel sharding, KV-cache memory allocation, and continuous batching schedulers.
To eliminate the external draft model altogether, Tianle Cai, Yuhong Li, Zhengyang Geng, Hongwu Peng, Jason D. Lee, Deming Chen, and Tri Dao introduced Medusa (Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads, arXiv:2401.10774). Instead of running a separate multi-layer Transformer to draft continuations, Medusa attaches $K$ lightweight feed-forward decoding heads directly onto the last hidden state $h_t$ of the base LLM. While the original Language Modeling (LM) head predicts the immediate next token at position $t + 1$, the $k$-th Medusa head is trained to predict the token at position $t + k + 1$ in parallel.
Tree-Based Attention Masking and Candidate Verification
Because each Medusa head predicts its future position independently conditioned only on $h_t$ (without knowing which specific tokens were sampled at intermediate positions $t+1, \dots, t+k$), a single greedy top-1 sequence across all $K$ heads exhibits lower multi-token acceptance rates than an autoregressive draft model. Medusa overcomes this limitation by taking the top-$s_k$ predictions from each head and constructing a Cartesian candidate tree of continuations. By crafting a non-causal, tree-structured attention mask within a single target forward pass, the backbone LLM evaluates dozens of candidate branches simultaneously without duplicating shared prefix computations in the KV cache.
Medusa-1 vs. Medusa-2 and Typical Acceptance
The authors introduced two distinct training regimes and two complementary inference extensions in arXiv:2401.10774:
- Medusa-1 (Frozen Backbone, Lossless Acceleration): The base LLM backbone weights remain completely frozen, and only the newly added Medusa heads are fine-tuned using a cross-entropy loss against the ground-truth future tokens (or via self-distillation when original pre-training data is unavailable). Because the backbone is untouched, Medusa-1 can be trained in a few hours on a single GPU and guarantees over 2.2x speedup without altering the base model's output quality.
- Medusa-2 (Joint Backbone + Heads Fine-Tuning): The Medusa heads are trained jointly alongside the backbone LLM using a specialized training recipe (combining differential learning rates, warmup strategies, and a weighted KL-divergence / cross-entropy objective) that improves the predictive accuracy of the Medusa heads while preserving the backbone's original capabilities. Medusa-2 pushes the measured decoding speedup to 2.3x–3.6x.
- Typical Acceptance Scheme: In addition to exact rejection sampling, Cai et al. proposed a typical acceptance criterion inspired by truncation sampling. Rather than rejecting high-probability plausible tokens whenever the draft distribution slightly miscalibrates a spiky target distribution, typical acceptance accepts candidate tokens whose target log-probability exceeds an entropy-adaptive threshold, boosting acceptance length at higher sampling temperatures while maintaining generation quality matching standard sampling.
Draft-Model-Free Parallel Jacobi Iteration: Lookahead Decoding
What if an engineering team cannot train extra Medusa heads and also cannot host an auxiliary draft model? In February 2024, Yichao Fu, Peter Bailis, Ion Stoica, and Hao Zhang introduced Lookahead Decoding (Break the Sequential Dependency of LLM Inference Using Lookahead Decoding, arXiv:2402.02057)—an exact, mathematically lossless parallel decoding algorithm that requires zero auxiliary models, zero additional fine-tuning, and zero external data stores.
Lookahead Decoding reformulates autoregressive generation as solving a system of nonlinear fixed-point equations via Jacobi iteration. In standard Jacobi decoding, one initializes a window of $W$ future token slots with random or previous token guesses and iteratively updates all $W$ positions in parallel using a single forward pass of the LLM until the fixed point converges. Alone, pure Jacobi iteration yields minor speedups on natural language because non-converged suffix trajectories are discarded after only one token advances per step.
Lookahead Decoding transforms Jacobi iteration into a high-throughput n-gram generator and verifier by dividing each forward pass into two concurrent 2D/staircase attention branches executed within the same FlashAttention-compatible kernel:
- The Lookahead Branch (2D Window of Size $W \times (N-1)$): Maintains a rolling 2D grid of token trajectories across the last $N - 1$ Jacobi iterations. In every step, it advances $W$ positions in parallel to harvest newly discovered $N$-grams—short multi-token sequences that represent exact fixed-point responses of the target model to specific token prefixes—and inserts them into an on-the-fly n-gram pool.
- The Verification Branch ($G$ Parallel Candidates): Searches the accumulated n-gram pool for up to $G$ candidate $N$-grams whose first token matches the most recently committed output token. Utilizing a tree-structured verification mask, the verification branch validates all $G$ candidate $N$-grams simultaneously in the same forward pass and commits the longest exact match.
By trading extra per-step $\log(\text{FLOPs})$ during the memory-bound decoding phase to shrink the total number of sequential decoding steps, Fu et al. (arXiv:2402.02057) demonstrated that Lookahead Decoding accelerates autoregressive inference by up to 1.8x on MT-bench and reaches up to 4x speedup with strong scaling across multiple GPUs on structured code completion tasks (where repetitive identifier and syntax n-grams populate the lookahead pool with high hit rates).
Feature-Level Autoregression and Dynamic Draft Trees: EAGLE-1, EAGLE-2, and EAGLE-3
While Medusa eliminates the external draft model by predicting $k$ tokens ahead in parallel from a single hidden state $h_t$, parallel heads suffer from a structural information bottleneck: the token sampled at $t+1$ profoundly alters the conditional distribution of the token at $t+2$. For example, if the prompt ends with "I bought an", the token at $t+1$ might be "apple" or "apartment", which completely bifurcates the valid continuations at $t+2$.
To restore sequential dependency inside the draft step while keeping draft latency negligible, Yuhui Li, Fangyun Wei, Chao Zhang, and Hongyang Zhang developed the EAGLE (Extrapolation Algorithm for Greater Language-model Efficiency) family of speculative sampling frameworks across three landmark papers: EAGLE-1 (ICML 2024, arXiv:2401.15077), EAGLE-2 (EMNLP 2024, arXiv:2406.16858), and EAGLE-3 (2025, arXiv:2503.01840).
EAGLE-1: Resolving Feature Uncertainty via Time-Advanced Token Concatenation
In EAGLE-1 (arXiv:2401.15077), the authors established two foundational empirical insights about Transformer representations:
- Feature-level autoregression is simpler than token-level autoregression: Predicting the continuous second-to-top-layer feature vector $f_{t+1}$ (the hidden state immediately prior to the final LM head linear projection) using a single lightweight Transformer decoder layer is significantly easier and more accurate than mapping discrete token IDs through a small multi-layer draft model.
- Sampling uncertainty in feature space must be explicitly resolved: Because $f_t$ precedes the stochastic sampling of discrete token $x_{t+1}$, predicting $f_{t+2}$ solely from the history of feature vectors $f_{1:t+1}$ fails to capture which discrete branch ($x_{t+1}$) was actually chosen during sampling.
EAGLE-1 solves this feature uncertainty by feeding its single-layer draft autoregressor a fused input combining the feature sequence $f_{1:t}$ with the discrete token embedding sequence advanced by one time step $e(x_{2:t+1})$. Once the draft layer predicts $\hat{f}{t+1}$, it multiplies $\hat{f}{t+1}$ by the target model's frozen LM head to obtain the draft distribution $q(x_{t+2})$, samples $\tilde{x}_{t+2}$, embeds it, and repeats the step autoregressively along a draft tree. Evaluated across the Vicuna series, the LLaMA2-Chat series, and the Mixture-of-Experts model Mixtral 8x7B Instruct on dialogue, code generation, mathematical reasoning, and instruction following, EAGLE-1 achieved a latency speedup ratio of 2.7x–3.5x on LLaMA2-Chat 70B and doubled overall throughput while maintaining the exact target output distribution.
EAGLE-2: Context-Aware Dynamic Draft Trees
In EAGLE-1 and Medusa, the topology of the draft verification tree (how many branches are expanded at depth 1, depth 2, etc.) is fixed ahead of time as a static tree. In EAGLE-2 (arXiv:2406.16858), Li et al. observed that the acceptance rate of draft tokens is heavily context-dependent rather than purely position-dependent, and crucially, that the EAGLE draft model is well-calibrated: its token confidence scores closely approximate true target acceptance rates with small errors.
EAGLE-2 replaces the static tree with a context-aware dynamic draft tree. At each drafting depth, EAGLE-2 computes the cumulative path confidence score of every candidate node (the product of draft probabilities along the branch from the root) and dynamically expands only the highest-confidence nodes, pruning unlikely branches during drafting and selecting the global top-$m$ nodes across all depths for parallel target verification. Across three LLM families and six benchmark tasks, EAGLE-2 achieved speedup ratios of 3.05x–4.26x, delivering a 20%–40% speedup improvement over EAGLE-1 while remaining 100% mathematically lossless.
EAGLE-3: Training-Time Test and Multi-Layer Feature Fusion
As LLM deployments scaled up synthetic training data for draft models, Li et al. discovered in EAGLE-3 (EAGLE-3: Scaling up Inference Acceleration of Large Language Models via Training-Time Test, arXiv:2503.01840) that EAGLE-1 and EAGLE-2 hit a scaling ceiling when trained on larger datasets. They traced this bottleneck to EAGLE's strict feature prediction constraint (forcing the draft layer to regress the exact top-layer feature vector $f_t$ via an $L_1$/regression loss alongside token cross-entropy) and its exclusive reliance on the top-layer hidden state, which discards lower- and middle-layer semantic representations.
EAGLE-3 removes the feature regression loss entirely in favor of direct token prediction and replaces single-layer feature input with multi-layer feature fusion (concatenating low-, middle-, and high-layer target hidden states and projecting them down before the draft layer). Because the draft layer no longer outputs an approximation of the target's top-layer feature $\hat{f}_{t+1}$ to feed into its own next drafting step, EAGLE-3 trains the draft model using a technique named Training-Time Test: simulating multi-step self-feeding rollouts during training so the draft layer learns to condition on its own internal hidden representations across steps $t+1, t+2, \dots, t+\gamma$. Evaluated on both chat models and reasoning models across five benchmark tasks, EAGLE-3 achieved a speedup ratio of up to 6.5x (approximately 1.4x faster than EAGLE-2), and inside the production SGLang serving framework, EAGLE-3 delivered a 1.38x throughput improvement even at a large batch size of 64.
Table 1: Architectural taxonomy and verified empirical speedups of speculative decoding and multi-token prediction frameworks from primary arXiv publications.
Native Pre-Training with Multi-Token Prediction (MTP): Meta FAIR and DeepSeek-V3
While post-hoc speculative decoding methods (such as Medusa and EAGLE) attach draft heads onto an already pre-trained next-token LLM, a major shift in foundation model pre-training has integrated multi-token prediction directly into the pre-training loss itself.
Meta FAIR's Multi-Token Prediction Architecture (Gloeckle et al., 2024)
In Better & Faster Large Language Models via Multi-token Prediction (arXiv:2404.19737), Fabian Gloeckle, Badr Youbi Idrissi, Baptiste Rozière, David Lopez-Paz, and Gabriel Synnaeve demonstrated that training a language model to predict $n$ future tokens simultaneously from every position $t$ in the training corpus acts as a powerful auxiliary inductive bias that improves sample efficiency and algorithmic reasoning.
Architecturally, given input prefix $x_{1:t}$, a shared Transformer trunk of $L - 1$ layers produces a latent representation $z_t$. Attached to $z_t$ are $n$ independent single-layer Transformer heads $H_1, H_2, \dots, H_n$, all sharing a single output unembedding (LM head) projection matrix $U \in \mathbb{R}^{d \times |\mathcal{V}|}$. Head $H_k$ predicts token $x_{t+k}$ independently:
$$\mathcal{L}{\text{MTP}} = -\sum{t=1}^{T} \sum_{k=1}^{n} \log P_\theta(x_{t+k} \mid z_t; H_k)$$
A naive implementation of $n$ output heads over a large vocabulary $|\mathcal{V}|$ would materialize $n$ massive logit tensors in GPU HBM simultaneously, causing severe Out-Of-Memory (OOM) bottlenecks during pre-training. Gloeckle et al. solved this by reordering the forward and backward pass of the output heads sequentially: for each head $k \in \{1, \dots, n\}$, the training step computes the logits $U \cdot H_k(z_t)$, evaluates the cross-entropy loss $\mathcal{L}k$, immediately computes the gradient $\partial \mathcal{L}_k / \partial z_t$, accumulates that gradient into $\nabla{z_t}$, and frees the logit tensor before moving to head $k+1$. Consequently, peak HBM activation memory matches standard single-token pre-training with no overhead in training time.
The empirical gains reported in arXiv:2404.19737 are twofold:
- Superior Downstream Reasoning and Coding Accuracy: Because predicting multiple tokens ahead forces the shared trunk $z_t$ to plan across multi-token syntactic structures and reduces teacher-forcing myopic local optima, MTP models develop stronger induction heads. At the 13B parameter scale, Meta FAIR's multi-token prediction models solved 12% more problems on HumanEval and 17% more problems on MBPP than baseline next-token models trained on the exact same token budget.
- Native Self-Speculative Inference Speedup: At inference time, the $n = 4$ pre-trained heads natively draft 4 tokens per forward pass without needing any external draft model, achieving up to 3x faster inference, even at large batch sizes.
DeepSeek-V3 Sequential Multi-Token Prediction (DeepSeek-AI, 2024/2025)
In the DeepSeek-V3 Technical Report (arXiv:2412.19437), DeepSeek-AI scaled native Multi-Token Prediction to a frontier Mixture-of-Experts (MoE) model comprising 671 billion total parameters with 37 billion parameters activated per token, pre-trained on 14.8 trillion tokens in 2.788M H800 GPU hours using Multi-head Latent Attention (MLA) and auxiliary-loss-free load balancing.
Unlike Meta FAIR's independent parallel heads (where head $H_k$ predicts $x_{t+k}$ from $z_t$ without conditioning on intermediate tokens $x_{t+1:t+k-1}$), DeepSeek-V3 preserves the complete causal chain across future prediction depths via sequential MTP modules. Specifically, for each additional prediction depth $k \in \{1, \dots, D\}$, DeepSeek-V3's $k$-th MTP module consists of:
- A shared embedding layer $\text{Emb}(\cdot)$ and shared output unembedding head $\text{OutHead}(\cdot)$ tied to the main 671B model.
- Two RMSNorm layers that normalize the $(k-1)$-th depth representation $h_i^{k-1} \in \mathbb{R}^d$ and the shifted ground-truth token embedding $\text{Emb}(t_{i+k}) \in \mathbb{R}^d$.
- A linear projection matrix $M_k \in \mathbb{R}^{d \times 2d}$ that fuses the concatenated representation $[\text{RMSNorm}(h_i^{k-1}); \text{RMSNorm}(\text{Emb}(t_{i+k}))]$ back to dimension $d$.
- A single dedicated Transformer block $\text{TRM}k(\cdot)$ that processes the fused sequence to emit $h_i^k$, which is fed into the shared output head to predict token $t{i+k+1}$.
Notice the structural convergence between DeepSeek-V3's sequential MTP module and EAGLE-1: both concatenate the previous hidden state representation with the time-shifted discrete token embedding before passing them through a lightweight single-layer Transformer block! During pre-training on 14.8 trillion tokens, DeepSeek-V3's MTP objective densifies the training signal at every sequence position. During production deployment, the MTP module can either be discarded entirely (so the base model runs as a standard autoregressive LLM) or retained as a built-in, pre-trained EAGLE-style draft head for lossless speculative decoding without requiring any post-training draft distillation.
Systems Engineering for Speculative Decoding in Production Serving (vLLM, SGLang, and TensorRT-LLM)
Deploying speculative decoding in a single-user local environment ($B = 1$) almost always yields dramatic latency reductions because the accelerator has abundant spare compute capacity. However, running speculative decoding inside high-concurrency production serving engines—such as vLLM, SGLang, and TensorRT-LLM—under continuous batching requires careful systems engineering around KV-cache allocation, custom tree attention kernels, and dynamic batch-size scheduling.
Before executing the parallel target verification pass on $\gamma$ draft tokens (or an $m$-node dynamic draft tree), the PagedAttention block manager must reserve $\gamma + 1$ physical KV slots per sequence. Once modified rejection sampling determines that $k \le \gamma$ tokens were accepted, the block manager compacts the accepted KV states into contiguous logical positions and immediately recycles rejected speculative KV slots back into the free block table with zero memory copy overhead.
Standard causal FlashAttention assumes a strict lower-triangular mask where token $i$ attends to all tokens $j \le i$. In tree-based speculative verification (Medusa, Lookahead, EAGLE-2, EAGLE-3), the flattened query tensor of $m$ tree nodes attends to a shared prefix KV cache plus a packed $m \times m$ tree ancestry mask. Specialized GPU kernels pack the prefix KV read with the sparse tree mask so verification avoids materializing a quadratic attention matrix in HBM.
As active batch size $B$ increases in continuous batching, the total number of tokens verified per forward pass scales as $B \times (\gamma + 1)$. Once $B \times (\gamma + 1)$ crosses the GPU's roofline ridge point, target verification shifts from memory-bandwidth-bound to compute-bound, causing verification latency to scale linearly with $\gamma + 1$. Production schedulers dynamically shrink $\gamma$ (or prune the EAGLE-2/EAGLE-3 dynamic tree width $m$) as batch concurrency rises.
When deploying ultra-large models across multi-node or multi-GPU clusters, tensor-parallel all-reduce synchronization adds fixed per-layer latency. Combining an ultra-compact single-layer feature draft head (EAGLE-3 or DeepSeek-V3 MTP) with an FP8- or INT4-quantized target backbone minimizes inter-GPU communication steps by cutting the total number of target forward passes by 3x to 6x.
Let us examine how the roofline batch-size crossover works quantitatively. Suppose a serving node runs an LLM at batch size $B$. During standard autoregressive decoding without speculation, each step processes $B$ tokens in parallel. If $B = 1$, operational intensity is ~1 FLOP/byte, and verifying $m = 16$ tree nodes increases total tokens processed per step to $1 \times 16 = 16$, which still lies well below a GPU's ~150–300 FLOP/byte ridge point—meaning the 16-node verification pass completes in virtually the same wall-clock time as a 1-token forward pass. However, if the continuous batching scheduler is already serving $B = 64$ concurrent requests, verifying a 16-node tree per request would force the GPU to compute $64 \times 16 = 1,024$ tokens per decoding step, pushing the GEMM deep into the compute-bound regime where rejected speculative tokens directly consume Tensor Core throughput. This is why EAGLE-3's high token acceptance accuracy and compact dynamic tree selection are so consequential: as demonstrated in arXiv:2503.01840, EAGLE-3 still achieves a 1.38x system throughput improvement at a batch size of 64 in SGLang because its multi-layer feature fusion yields high acceptance rates even with compact verification budgets.
Never pair a draft model and a target model with mismatched tokenizers or divergent special-token mappings without explicit token-to-token alignment; standard speculative rejection sampling requires $p_i(x)$ and $q_i(x)$ to be defined over the exact same vocabulary domain $\mathcal{V}$. Furthermore, for models with large vocabularies ($|\mathcal{V}| \ge 128,000$), the final LM head projection $h \cdot U$ can become a nontrivial fraction of draft latency—making shared-unembedding feature drafters (EAGLE-2, EAGLE-3, and native MTP modules) markedly faster than full standalone draft Transformers.
Decision Matrix: Selecting the Optimal Speculative Acceleration Strategy
Choosing the right speculative decoding or multi-token prediction architecture depends on whether you control model pre-training, whether you can run a post-training distillation stage for a lightweight draft head, and what batch-size regime your inference cluster targets:
- Pre-Training a Foundation Model from Scratch: Integrate Sequential Multi-Token Prediction (MTP) directly into the pre-training objective (following DeepSeek-V3, arXiv:2412.19437, or Meta FAIR's memory-efficient MTP heads, arXiv:2404.19737). You obtain superior downstream coding/reasoning representations at zero extra training-time memory overhead and gain a native self-speculative draft head out of the box.
- Serving an Existing Open-Weights LLM with Maximum Speedup (Latency & Throughput Critical): Deploy EAGLE-3 (arXiv:2503.01840) or EAGLE-2 (arXiv:2406.16858) in SGLang or vLLM. Because EAGLE reuses the target model's hidden features and advances token inputs by one step, its single-layer draft head adds minimal memory overhead (~1%–2% of target parameters) while delivering 3.05x–4.26x (EAGLE-2) to up to 6.5x (EAGLE-3) latency speedups and sustaining throughput gains up to batch size 64.
- Serving an Off-the-Shelf LLM with a Matching Smaller Family Model (Zero Training Allowed): If an official small sibling model from the same family and tokenizer exists (for example, pairing a 70B target model with a 1B–7B sibling draft model), use Classic Two-Model Speculative Decoding / Speculative Sampling (Leviathan et al., arXiv:2211.17192; Chen et al., arXiv:2302.01318) for an immediate 2x–3x drop-in speedup.
- Serving an Off-the-Shelf LLM Where No Draft Model Exists and Zero Training Is Permitted: Use Lookahead Decoding (Fu et al., arXiv:2402.02057) or prompt-lookup n-gram drafting. Lookahead Decoding requires zero extra weights and achieves up to 1.8x speedup on conversational benchmarks (MT-bench) and up to 4x on multi-GPU code completion by exploiting parallel Jacobi iterations and on-the-fly n-gram caching.
Frequently Asked Questions (FAQ) on Speculative Decoding and Multi-Token Prediction
Does speculative decoding degrade output accuracy or change the probability distribution of the target LLM? No. When executed with modified rejection sampling—as formulated by Leviathan et al. (arXiv:2211.17192) and Chen et al. (arXiv:2302.01318)—speculative decoding is mathematically lossless. At temperature $T = 0$ (greedy decoding), only tokens that exactly match the target model's top-1 argmax prediction are accepted. At temperature $T > 0$, accepting drafted tokens with probability $\min(1, p(x)/q(x))$ and resampling rejected tokens from the normalized positive residual $\text{norm}(\max(0, p(x) - q(x)))$ guarantees that every emitted token is distributed identically to $p(x)$ within hardware floating-point numerics. Optional relaxed schemes like Medusa's typical acceptance trade strict distributional identity for higher acceptance rates at elevated temperatures, but standard speculative sampling preserves the exact target distribution.
Why doesn't verifying $\gamma$ draft tokens in parallel take $\gamma$ times longer than generating a single token? Because single-token autoregressive decoding is bottlenecked by High-Bandwidth Memory (HBM) weight transfers, not by Tensor Core arithmetic (FLOPs). To compute a single token, the GPU must stream all model parameters from HBM into on-chip SRAM caches, achieving an operational intensity of only ~1–2 FLOPs per byte. When verifying $\gamma + 1$ tokens in parallel, the GPU streams the model weights from HBM once and reuses them in SRAM across all $\gamma + 1$ token vectors simultaneously. Until the total number of parallel tokens crosses the GPU's compute-to-bandwidth ridge point, the wall-clock duration of a parallel verification pass is nearly identical to a single-token forward pass.
How does EAGLE achieve higher speedups than Medusa when both eliminate the separate standalone draft model? Medusa (arXiv:2401.10774) attaches $K$ parallel feed-forward heads to the single hidden state $h_t$, meaning head $k$ must predict token $x_{t+k+1}$ without knowing which specific tokens were sampled at intermediate positions $t+1, \dots, t+k$. EAGLE (arXiv:2401.15077) resolves this uncertainty by executing lightweight autoregression using a single Transformer layer that takes both the target feature sequence and the discrete sampled token sequence advanced by one time step. EAGLE-2 (arXiv:2406.16858) adds context-aware dynamic draft trees (3.05x–4.26x speedup), and EAGLE-3 (arXiv:2503.01840) replaces top-layer feature regression with multi-layer feature fusion and training-time test to reach up to 6.5x speedup.
How can Lookahead Decoding accelerate LLM inference without using any draft model or extra decoding heads? Lookahead Decoding (Fu et al., arXiv:2402.02057) treats autoregressive generation as a nonlinear fixed-point system solved via parallel Jacobi iteration. Within each forward pass, it uses a specialized 2D staircase attention mask to run two branches concurrently: a lookahead branch that advances a $W \times (N-1)$ window of future token trajectories to harvest valid $N$-grams into a local pool, and a verification branch that validates matching candidate $N$-grams from that pool in parallel. It trades unused per-step FLOPs for fewer sequential decoding steps, reaching up to 1.8x speedup on MT-bench and 4x with multi-GPU strong scaling on code completion.
What is the difference between Meta FAIR's Multi-Token Prediction (MTP) and DeepSeek-V3's MTP objective? Meta FAIR's MTP framework (Gloeckle et al., arXiv:2404.19737) attaches $n$ independent parallel output heads onto a shared Transformer trunk $z_t$ to predict $n$ future tokens concurrently, using sequential gradient accumulation at the unembedding layer so peak HBM memory remains unchanged; at the 13B scale, it solves 12% more HumanEval and 17% more MBPP problems with up to 3x faster inference. DeepSeek-V3 (arXiv:2412.19437) instead uses sequential MTP modules that preserve the causal chain at each prediction depth by concatenating the RMSNorm-normalized hidden representation from depth $k-1$ with the RMSNorm-normalized embedding of token $t_{i+k}$ before passing them through a projection matrix and a dedicated Transformer block.
Why does speculative decoding speedup decrease at very large continuous batch sizes, and how do modern engines mitigate this? As the concurrent batch size $B$ increases, standard decoding already amortizes HBM weight reads across $B$ tokens per step. When speculative decoding verifies $m$ candidate draft tokens for each of the $B$ requests, the GPU must compute $B \times m$ tokens per forward pass. Once $B \times m$ exceeds the GPU's roofline ridge point, verification transitions from memory-bound to compute-bound, so rejected draft tokens waste active Tensor Core compute. Modern inference engines like SGLang and vLLM mitigate this by dynamically adapting the draft tree width $m$ based on current batch load and by employing high-acceptance feature drafters like EAGLE-3, which still delivers a 1.38x throughput improvement at a batch size of 64 (arXiv:2503.01840).
Primary Research Sources and Technical References
- Yaniv Leviathan, Matan Kalman, and Yossi Matias (ICML 2023 Oral), "Fast Inference from Transformers via Speculative Decoding" — https://arxiv.org/abs/2211.17192
- Charlie Chen, Sebastian Borgeaud, Geoffrey Irving, Jean-Baptiste Lespiau, Laurent Sifre, and John Jumper (DeepMind, 2023), "Accelerating Large Language Model Decoding with Speculative Sampling" — https://arxiv.org/abs/2302.01318
- Tianle Cai, Yuhong Li, Zhengyang Geng, Hongwu Peng, Jason D. Lee, Deming Chen, and Tri Dao (2024), "Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads" — https://arxiv.org/abs/2401.10774
- Yichao Fu, Peter Bailis, Ion Stoica, and Hao Zhang (ICML 2024), "Break the Sequential Dependency of LLM Inference Using Lookahead Decoding" — https://arxiv.org/abs/2402.02057
- Yuhui Li, Fangyun Wei, Chao Zhang, and Hongyang Zhang (ICML 2024), "EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty" — https://arxiv.org/abs/2401.15077
- Yuhui Li, Fangyun Wei, Chao Zhang, and Hongyang Zhang (EMNLP 2024), "EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees" — https://arxiv.org/abs/2406.16858
- Yuhui Li, Fangyun Wei, Chao Zhang, and Hongyang Zhang (2025), "EAGLE-3: Scaling up Inference Acceleration of Large Language Models via Training-Time Test" — https://arxiv.org/abs/2503.01840
- Fabian Gloeckle, Badr Youbi Idrissi, Baptiste Rozière, David Lopez-Paz, and Gabriel Synnaeve (Meta FAIR, ICML 2024), "Better & Faster Large Language Models via Multi-token Prediction" — https://arxiv.org/abs/2404.19737
- DeepSeek-AI (2024/2025), "DeepSeek-V3 Technical Report" — https://arxiv.org/abs/2412.19437