Efficient Tree Draft for Long-Context Speculative Decoding

Brian J Chan, Ning-Chi Huang, Kai-Chiang WuNeurIPS 2026

TL;DR

When large language models generate text over long contexts, reading memory becomes a massive bottleneck—even when using a tiny "draft" model to guess multiple future words in a branching tree. FastDraft fixes a hidden flaw in how GPUs process these draft trees: by splitting the problem into a single shared history and tightly packed branch tips, it stops redundant memory reads while keeping the GPU running on pure autopilot. The result is a drop-in upgrade that makes drafting up to 2.92× faster and boosts overall generation throughput by up to 1.86×, without changing a single model weight.

What Problem Does This Paper Address?

Generating text one token at a time is notoriously memory-bound: for every single word, the GPU has to haul the entire conversation history—the KV cache (stored Key and Value vectors)—out of memory. Speculative decoding speeds this up by having a small, fast "draft" model guess several tokens ahead, which the massive target model then verifies in a single batch. To get higher hit rates, modern systems draft trees of branching possibilities rather than a single linear guess.

Here is the catch: existing serving frameworks (like SGLang) store the shared prompt history only once, but their attention kernels still treat every branch of the draft tree as an independent query. If your draft tree has 16 branches over a 50,000-token document, the draft model re-reads those same 50,000 tokens 16 separate times!

Why not just use existing "prefix-aware" kernels designed for tree structures? Two reasons:

  1. They break CUDA Graphs: Because draft models are tiny, CPU scheduling overhead easily dominates execution time. CUDA Graphs solve this by recording GPU operations and replaying them without the CPU—but they require static data shapes. Existing tree kernels dynamically regroup nodes as the tree grows, forcing slow CPU recalculations at every step.
  2. Tensor-Core Padding Waste: GPU tensor cores process data in tiles of at least 16 rows. A single tree branch only contributes a tiny handful of query rows (e.g., 4 rows in Grouped-Query Attention), meaning up to 75% of the compute tile is wasted on empty padding.

Methods

Instead of tracking every internal split inside a draft tree, the authors introduce FastDraft, built around a clean two-level decomposition: a massive shared prefix (the prompt and verified tokens) and a shallow branching suffix (the flattened root-to-leaf paths of the draft tree).

Figure 1: Queries and KV entries in draft phase of tree-based speculative decoding.

While splitting prefixes and suffixes is standard in techniques like Hydragen, FastDraft innovates in how it executes this during drafting:

  • Single Persistent Kernel: Rather than launching separate kernels for the prefix and suffixes, FastDraft schedules prefix chunks and suffix items into a single work queue on the GPU, combining partial results via standard online softmax math.
  • Padding-Free Suffix Packing: Because every branch in a draft step has the exact same depth, FastDraft packs multiple branches together into a single 16-row tensor-core tile using a block-diagonal mask so branches only attend to themselves. Zero wasted padding!
  • Plan-Once CUDA Graph Replay: Because there is always one shared prefix and a fixed number of suffix branches, the structural "plan" never changes across draft steps. FastDraft allocates buffers for the maximum draft depth upfront and simply patches active lengths on the GPU during replay—keeping the CPU completely out of the loop.

Datasets

No model training is required. For end-to-end evaluation across long contexts (ranging from 10K to 100K tokens), the authors use three established benchmarks:

  • GovReport (long document summarization)
  • NarrativeQA (reading comprehension over books and movie scripts)
  • PG-19 (long-range language modeling over Project Gutenberg books)

Key Insights and Ideas

  • Less cleverness is faster (Why two levels beat multi-level): You might think sharing intermediate sub-paths inside the draft tree would save even more memory. Using an analytical cost model and micro-benchmarks, the authors prove this is a trap. Every extra grouping level adds merge traffic and fragments GPU workloads. Because practical speculative trees are shallow (depths of 6 to 10), internal sharing simply doesn't save enough memory to pay for its own overhead.
Figure 2: Two-level vs. multi-level attention speedup across tree width W and depth D (L = 50K, Hq/Hkv = 32/8, d = 128). Heatmaps of speedup ratio Tmulti/Ttwo-level (blue = two-level wins)
  • Dynamic kernels can actually slow you down: In end-to-end tests, sophisticated tree-attention baselines (like FastTree, DeFT, and Hydragen) actually ran slower than SGLang's naïve, redundant-read baseline! Why? Because losing CUDA Graph compatibility due to dynamic tree shapes incurs a massive CPU scheduling penalty that wipes out their memory-saving gains.

Key Results

Implemented as a plug-and-play module in SGLang (tested across A6000, RTX Pro 6000, and H100 GPUs on Llama-3 and Qwen3 models from 4B to 70B, using both standalone drafters and EAGLE-3 heads):

  • Isolated Kernel Speed: Up to 4.92× faster than standard PagedAttention at 32K context length (batch size 8, width 16) on an H100, beating prior tree kernels like FastTree by 1.1–1.6×.
  • Faster Drafting & Throughput: Achieves up to a 2.92× speedup in the draft phase and 1.86× higher end-to-end token throughput over SGLang's default tree-drafting backend (e.g., jumping from 103.97 to 193.18 tokens/s on two A6000s at batch size 4).
  • Exactness: Leaves token acceptance lengths and verification times completely unchanged—meaning identical output quality for free speed.

Limitations and Future Work

The optimality of FastDraft’s two-level design relies on the assumption that draft trees are relatively shallow. Both the authors' mathematical cost model and empirical heatmaps show that if draft trees become substantially deeper (e.g., depth $D \ge 16$ with heavy sub-path sharing, which occasionally appears in specialized CPU-offloading setups like Sequoia), multi-level grouping begins to cross over and slightly outperform the two-level scheme (around 0.98× speedup ratio). Specific directions for future work are not explicitly discussed in the paper.

Summary updated

Abstract

Speculative decoding is an effective technique for accelerating autoregressive models in memory-bound regimes. Prior work has explored tree-based drafting to speculate multiple candidates at each step, improving verification acceptance rates. However, existing systems fail to fully realize the potential of tree-based drafting, leaving significant performance overhead. In this paper, we present FastDraft, a plug-and-play module that improves the efficiency of tree-based drafting in long-context speculative decoding. FastDraft exploits both the shared-prefix I/O pattern across draft branches and the constrained tree structure of speculative decoding, enabling specialized kernels that reduce draft-phase overhead while preserving compatibility with existing inference frameworks. FastDraft requires no modifications to the target model, draft model, or sampling logic. We implement FastDraft within SGLang and compare it against SGLang's vanilla tree-based drafting backend, demonstrating substantially faster draft execution: up to 2.92$\times$ speedup in the draft phase and 1.86$\times$ higher throughput over SGLang under long-context settings. Code is available at https://github.com/brian030128/fast-draft/tree/master.
BibTeX
@inproceedings{chan2026efficient,
  author = {Brian J Chan and Ning-Chi Huang and Kai-Chiang Wu},
  title = {{Efficient Tree Draft for Long-Context Speculative Decoding}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Sg8rYQS4Lz},
}
Figure