TL;DR
Processing million-token contexts in Large Language Models (LLMs) usually forces an unpleasant choice: pay the massive computational cost of full attention, pretrain a sparse model from scratch, or rely on lossy heuristics that drop tokens. This paper reveals that standard, full-attention LLMs are already intrinsically sparse under the hood. By applying a tiny bit of surgical post-training—just a few hundred steps—the authors unlock up to a 9.36$\times$ speedup in prompt processing while keeping the model's accuracy virtually untouched.
What Problem Does This Paper Address?
At the heart of modern LLMs lies the self-attention mechanism, where every word (token) looks back at every previous word to gather context. This works brilliantly, except its cost scales quadratically: double the document length, and you quadruple the compute. When reading entire codebases or generating 30,000-token reasoning chains, full attention becomes a severe bottleneck.
To dodge this wall, researchers generally take one of two routes. Some redesign the architecture to be sparse from day one (native sparse training), which requires expensive pretraining from scratch. Others take existing models and forcefully evict tokens on the fly using hand-crafted rules, which is cheap but often causes the model to forget crucial details on complex tasks. The authors ask a delightfully simple question: What is the minimal surgery required to turn an existing full-attention LLM into a fast, sparse one without losing its smarts?
Methods
The authors introduce RTPurbo, a framework that separates what an LLM's attention heads do and gives each group the exact resources it needs:
- Offline Head Calibration: Building on known interpretability findings, they pass a single document containing repeated "needle" phrases through the model to see which attention heads actually look far into the past. The top 15% are labeled retrieval heads; the remaining 85% are local heads.
- Split-Path Execution: Local heads only ever get a standard sliding window (8,192 tokens) plus 4 initial "sink" tokens. Retrieval heads build a full key-value (KV) memory cache while reading the prompt (prefill), then switch to a novel sparse search while generating answers (decode).
- 16D Pre-RoPE Indexing & Top-$p$ Routing (Novel): Instead of scoring every past token using full-sized vectors, each retrieval head compresses queries and keys down to tiny 16-dimensional vectors before positional encodings (RoPE) are applied. Rather than grabbing a fixed number of top-$k$ tokens, RTPurbo dynamically selects tokens until their cumulative attention probability hits $p = 0.9$, then runs exact full-dimensional attention only on those winners. They fuse this scoring and sorting into a custom GPU kernel.
- Two-Stage Micro-Training: First, they freeze the LLM and train just the tiny 16D projectors to mimic full attention. Second, they run end-to-end self-distillation for ~600 steps, training the sparse student model to match the top-10 output logits of its dense self.
Datasets
No new benchmarks are introduced; the method is trained and tested on established datasets:
- Training / Calibration: FineWeb and Dolma 3 Longmimo Mix (using sampled documents between 32K and 80K tokens, totaling only ~1M label tokens for alignment).
- Long-Context Evaluation: LongBench and RULER (tested from 32K up to ultra-long 512K contexts).
- Reasoning Evaluation: AIME24, AIME25, and MMLU-PRO, which feature short prompts (<300 tokens) but massive generation traces (10K–32K tokens).
Key Insights and Ideas
- RoPE Geometry Explains Why 16 Dimensions Are Enough: Rotary Position Embeddings (RoPE) encode token positions by rotating vector channels at different speeds. High-frequency channels spin wildly over long distances, turning long-range similarity scores into distance-sensitive noise. Long-range retrieval naturally lives in the stable, slow-rotating (low-frequency) subspace—meaning you can strip away RoPE and route long-range attention using a tiny 16D projection with over 90% recall.
- Sparsity Must Follow the Query, Not a Fixed Budget: Fixed top-$k$ selection is fundamentally mismatched to language. A broad query like "Galápagos" scatters attention across ~8,500 related tokens, whereas a specific password lookup locks onto just 2 tokens. Dynamic top-$p$ thresholding expands and contracts on the fly.
- Self-Distillation Avoids Data Headaches: Aligning the sparse model directly to the dense model's own predictions prevents overfitting and eliminates the tedious guesswork of tuning data mixtures, converging in roughly 600 steps.
Key Results
Tested on Qwen3-Coder-30B-A3B and Qwen3-30B-A3B-Think, RTPurbo achieves near-lossless accuracy with major speedups:
- Speedups: Compared to FlashAttention-2, single-layer prefill speedups climb from 2.83$\times$ at 32K context to 9.36$\times$ at 1M context. Decode speedups reach 2.01$\times$ at 1M context.
- Long-Context Accuracy: On LongBench, RTPurbo scores 54.24%, slightly edging out Full Attention (53.80%). On RULER (64K), it hits 85.49% vs. Full Attention's 86.23%, while a static top-$k$ baseline drops to 70.53%. At 512K context, RTPurbo dynamically prunes over 97.1% of compute while preserving high accuracy where competing sparse methods collapse.
- Long-Horizon Reasoning: On AIME24 and AIME25, RTPurbo matches the dense baseline's exact 86.67% score (whereas training-free sparse baselines Quest and SnapKV drop below 47%).
Limitations and Future Work
Not discussed in the paper.
Summary updated