TL;DR
This paper demonstrates that you don't need to train specialized "long-context" models to perform speculative decoding at million-token scales. By applying two simple, training-free inference tweaks—attention windowing and rotary index re-basing—frozen short-context drafters can maintain their speedup benefits all the way out to two million tokens.
What Problem Does This Paper Address?
Speculative decoding is a popular technique to speed up Large Language Model (LLM) inference. It uses a small, "cheap" drafter model to guess the next few tokens, which a larger "target" model then verifies in parallel.
However, this approach traditionally breaks down at "ultra-long" context lengths (e.g., 1M+ tokens). As the context grows, a drafter that attends to the entire history becomes increasingly expensive, eventually costing as much as the target model itself. The standard industry response has been to train or fine-tune specialized long-context drafters, which is computationally expensive and requires new checkpoints for every target model.
Methods
The authors propose two lightweight, inference-time mechanisms to fix short-context drafters for long-context use without touching a single model weight:
- Windowing: The drafter’s attention is restricted to a fixed window of the most recent $W$ tokens (e.g., 4096). This keeps the drafter's computational cost constant regardless of the total sequence length.
- Rotary Index Re-basing: Most modern LLMs use Rotary Positional Embeddings (RoPE). When a sequence exceeds the drafter's trained range ($P_{max}$), the positional math fails. The authors solve this by "re-basing" indices using a modulo operation ($m \pmod{P_{max}}$), effectively mapping distant positions back into a range the drafter understands.
Datasets
The researchers evaluated their method across several diverse corpora to ensure the results weren't just a fluke of specific text types:
- PG19: Long-form book text.
- LongBench (v1 & v2): A benchmark specifically designed for long-context understanding.
- BEAM / BEAM v2: Long-context multi-turn conversations.
- SPEED-Bench: A benchmark for speculative decoding efficiency.
- RULER: Used for "needle-in-a-haystack" retrieval tests.
Key Insights and Ideas
- Target-Conditioning is Key: The authors observe that modern drafters (like the EAGLE or DSpark families) are "target-conditioned." They don't just look at tokens; they look at the hidden states computed by the target model. Since the target model has already processed the entire long prefix, that "distant" information is already baked into the features the drafter receives.
- Verification is a Safety Net: Because speculative decoding always verifies the drafter's output against the full-context target model, any errors introduced by the drafter's limited window are automatically corrected. The drafter doesn't need to be perfect; it just needs to be "good enough" and cheap.
- The "Cliff" vs. "Decay": Without index re-basing, drafter performance doesn't just slowly degrade; it hits a "cliff" at the edge of its trained positional range and collapses. Re-basing eliminates this cliff.
Key Results
The primary finding is the "flatness" of the speedup curve. While unwindowed drafters see their speedup vanish as context grows, the proposed method retains nearly all of its efficiency.
- Retention: On the Kimi-K3 model, the "Inferact" drafter retained 90% of its 8k-context speedup at 2 million tokens. The "RadixArk" drafter actually showed 119% retention (relative to its 8k performance).
- Speedup: Across various models and datasets, the method consistently delivered 1.5x to 2.5x speedups even at million-token scales.
- Accuracy: In "needle-in-a-haystack" tests, the system maintained 100% accuracy, proving that the windowed drafter does not compromise the target model's ability to retrieve distant information.
Limitations and Future Work
- Drafter Architecture: The theory specifically applies to target-conditioned drafters. Standalone drafters that don't see the target's hidden states might not benefit as much from simple windowing.
- Greedy Focus: The experiments primarily focused on greedy decoding. While the theory covers sampling, extensive million-token sampling benchmarks remain for future work.
- Numerical Nondeterminism: The authors noted slight divergences between speculative and non-speculative outputs due to benign numerical noise (different batch shapes during verification), though this is a common issue in high-performance inference engines rather than a flaw in the drafting logic itself.
Summary updated