TL;DR
P-EAGLE advances speculative decoding by transitioning the popular EAGLE framework from sequential, autoregressive drafting to parallel multi-token prediction. To overcome the quadratic memory explosion that occurs when training parallel drafters on long sequences, the authors introduce amortized mask construction and within-sequence partitioning. The resulting framework scales effortlessly to 20K context lengths and delivers up to a 1.36× end-to-end inference speedup over EAGLE-3 within vLLM.
What Problem Does This Paper Address?
Speculative decoding accelerates large language model (LLM) inference by using a lightweight "draft" model to quickly predict a sequence of candidate tokens, which the massive "target" model then verifies or rejects in a single forward pass. EAGLE is a highly successful drafter because it builds upon the target model's top-layer hidden states. However, standard EAGLE drafts tokens autoregressively—meaning generating $K$ tokens still requires $K$ sequential forward passes through the draft layer.
Parallel drafting eliminates this sequential overhead by predicting multiple future tokens simultaneously. Unfortunately, training a parallel drafter on the long-context traces generated by modern reasoning LLMs is incredibly difficult.
As shown in Figure 1, modern reasoning workloads routinely cross the 10K token mark. When training for parallel prediction over long sequences, attention memory scales quadratically with the product of the sequence length and the prediction depth ($O((nK)^2)$). Existing parallel drafting methods either run out of memory or suffer massive data-loading bottlenecks when scaled beyond 4K tokens.
Methods
P-EAGLE restructures the EAGLE architecture to generate multiple draft tokens in a single parallel pass. It introduces a learnable shared hidden state ($h_{shared}$) and a mask token embedding to substitute for the missing future context during multi-token prediction (MTP).
To make long-context training computationally feasible, the authors developed two primary training innovations:
- Amortized Mask Construction: Instead of dynamically generating complex causal attention masks for every training example—a process that slows down data loading by 48× at longer contexts—P-EAGLE exploits the fact that the causal structure across prediction depths is position-invariant. The framework pre-computes a maximum-length mask once at initialization and uses constant-time tensor slicing to extract per-example masks during training.
- Sequence Partitioning: Standard gradient accumulation operates across different independent examples. When a single sequence is too long to fit into GPU memory, P-EAGLE splits the sequence itself into segments. It uses a specialized assignment propagation algorithm to ensure that cross-depth token dependencies (introduced by Conditional Drop-token sampling) are preserved across segment boundaries without breaking the causal attention graph.
Datasets
- Training Data: UltraChat, GSM-8K (train split), and OpenCodeInstruct.
- Evaluation Benchmarks: HumanEval (code generation), MT-Bench (multi-turn conversation), and GSM-8K (mathematical reasoning test split).
Key Insights and Ideas
- Position-Specific Hidden States are Redundant: Intuitively, one might think a parallel drafter needs unique, position-specific hidden states to predict tokens at different future depths (e.g., token +2 vs token +4). The authors mathematically prove that because modern LLMs use Rotary Position Embeddings (RoPE), absolute position information is already uniquely recoverable from the attention scores alone. A simple, shared hidden state actually outperforms complex position-aware variants by 7–15%.
- Unfreezing Embeddings is Crucial: Standard EAGLE freezes the target model's embedding layer. P-EAGLE unfreezes it so the model can explicitly learn a meaningful representation for its new
[mask]token, yielding a consistent ~5% boost in token acceptance length. - Over-Supervision Helps: Training the model with a deeper prediction horizon ($K_{train} = 8$) than used during inference ($K_{infer} = 5$) forces the drafter to learn more robust multi-step dependencies, improving acceptance rates for the earlier positions.
Key Results
- Scalability: While prior parallel drafting methods like ParallelSpec and PARD suffer from Out-Of-Memory (OOM) errors or become computationally infeasible at 8K+ context lengths, P-EAGLE scales smoothly up to 20K tokens.
- Acceptance Quality: P-EAGLE matches or exceeds the acceptance length of the highly optimized autoregressive EAGLE-3 baseline across all tested models, showing an average improvement of +4.5% on GPT-OSS 120B.
- End-to-End Speedups: When deployed in vLLM on an H200 GPU, P-EAGLE achieves consistent throughput improvements of 1.10×–1.36× over EAGLE-3 across GPT-OSS 120B, 20B, and Qwen3-Coder 30B.
Limitations and Future Work
- Architectural Overhead at Low Speculation Depths: Because P-EAGLE requires a deeper architecture to compensate for the lack of autoregressive context (4 layers vs. 1 layer in standard EAGLE), it can experience minor slowdowns at very low speculation depths ($K=3$) combined with low concurrency.
- MoE Bottlenecks: For Mixture-of-Experts (MoE) models at high concurrency, the expert routing overhead during the target model's verification phase becomes dominant, which can partially moderate the end-to-end latency savings provided by faster drafting.
Summary updated