Full Attention Strikes Back: Transferring Full Attention into Sparse within Hundred Training Steps

Yanke Zhou, Yiduo Li, Hanlin Tang, Maohua Li, Kan Liu, Tao Lan, Lin Qu, Yuan Yao, Xiaoxing MaNeurIPS 2026

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.

Figure 1: A teaser view of the efficiency and accuracy gains of RTPURBO.

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:

  1. 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.
  2. 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).
  3. 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.
  4. 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.
Figure 3: Retrieval-head behavior is strongly query-dependent. (a) The query token “Galápagos” induces diffuse retrieval over many semantically related earlier tokens: about 8k tokens are needed to recover 90%+ attention mass, while top-4k recovers only about 75%. (b) For a needle-in-a-haystack query, retrieval is highly concentrated: two tokens recover 96.6% attention mass, whereas top-4k retains many unnecessary tokens.
  • 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

Abstract

Long-context inference in large language models is bottlenecked by the quadratic cost of full attention. Existing efficient alternatives often rely either on native sparse training or on heuristic token eviction, creating an undesirable trade-off among efficiency, training cost, and accuracy. In this work, we show that full-attention LLMs are already intrinsically sparse and can be transformed into highly sparse models with only minimal adaptation. Our approach is built on three observations: (1) only a small subset of attention heads truly requires full long-context processing; (2) long-range retrieval is governed primarily by a low-dimensional subspace, allowing relevant tokens to be retrieved efficiently with a 16-dimensional indexer; and (3) the useful token budget is strongly query-dependent, making dynamic top-$p$ selection more suitable than fixed top-$k$ sparsification. Based on these insights, we propose RTPurbo, which retains the full KV cache only for retrieval heads and introduces a lightweight token indexer for sparse attention. By exploiting the model's intrinsic sparsity, RTPurbo achieves sparsification with only a few hundred training steps. Experiments on long-context benchmarks and reasoning tasks show that RTPurbo preserves near-lossless accuracy while delivering substantial efficiency gains, including up to a 9.36$\times$ prefill speedup at 1M context and about a 2.01$\times$ decode speedup. These results suggest that strong sparse inference can be obtained from standard full-attention training without expensive native sparse pretraining.
BibTeX
@inproceedings{zhou2026full,
  author = {Yanke Zhou and Yiduo Li and Hanlin Tang and Maohua Li and Kan Liu and Tao Lan and Lin Qu and Yuan Yao and Xiaoxing Ma},
  title = {{Full Attention Strikes Back: Transferring Full Attention into Sparse within Hundred Training Steps}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=bR3PWtkIml},
}
Figure