ProxyAttn: Guided Sparse Attention via Representative Heads

Yixuan Wang, Huang He, Siqi Bao, Hua Wu, Haifeng Wang, Qingfu Zhu, Wanxiang Che

Processing long documents with Large Language Models (LLMs) is notoriously expensive due to the quadratic complexity of the attention mechanism. While "sparse attention" methods—which skip unimportant computations—offer a solution, they often struggle to maintain model accuracy at high speedup rates.

A new paper from researchers at the Harbin Institute of Technology and Baidu, titled ProxyAttn, introduces a training-free algorithm that achieves a superior balance of speed and performance by rethinking how we estimate which parts of a text are "important."

TL;DR

ProxyAttn is a training-free sparse attention algorithm that leverages the high similarity between different attention heads to estimate importance scores using only a few "proxy heads." By combining these fine-grained scores with dynamic, per-head sparsity budgets, it achieves up to a 10.3x attention speedup and 2.4x end-to-end prefilling acceleration with minimal performance loss.

What Problem Does This Paper Address?

The bottleneck in long-context LLM inference is the pre-filling stage, where the model processes the input prompt. Standard attention requires every token to look at every other token ($O(N^2)$ complexity).

Existing sparse attention methods (like MInference or FlexPrefill) try to solve this by identifying "important" blocks of tokens and skipping the rest. However, to keep the estimation process fast, these methods usually compress the sequence dimension (e.g., pooling tokens together). This "coarse-grained" estimation often misses small, isolated clusters of high-importance tokens, leading to significant performance drops when trying to achieve high levels of sparsity.

Methods

ProxyAttn shifts the strategy from sequence compression to head compression. The authors made a key observation: while an LLM has many attention heads, they often focus on the same sets of tokens.

  1. Unified Score Estimation (Proxy Heads): Instead of calculating importance for every head, ProxyAttn groups heads and creates a "proxy head" by averaging the queries and keys within that group. This proxy head performs a token-level dot product. Because it's only one head (or a few), the cost is low, but the resulting importance map is "fine-grained" (token-level) rather than "coarse-grained" (block-level).
  2. Dynamic Budget Allocation: Although heads look at the same tokens, they differ in how much they attend to them (their sparsity). ProxyAttn uses an online method (Algorithm 1) to estimate a unique sparsity budget for each head based on the queries of the last block.
  3. Block-Sparse Execution: Once the importance map and budgets are set, the model uses a hardware-friendly block-sparse kernel to execute the actual attention computation, skipping the unimportant blocks entirely.
The ProxyAttn workflow vs. traditional coarse-grained methods.

Datasets

The authors evaluated ProxyAttn across several demanding benchmarks:

  • RULER: A synthetic benchmark testing context lengths from 4K to 128K tokens.
  • InfiniteBench: A collection of real-world long-context tasks including long-book QA and summarization.
  • LongBench-v2: A benchmark focused on complex reasoning over long documents.

The experiments were conducted on mainstream models including Llama3.1-8B/70B and Qwen2.5-7B.

Key Insights and Ideas

  • Head Consistency: The researchers found that in deeper layers, different attention heads focus on a large intersection of tokens. This is the "aha moment" that justifies using a single proxy head to represent dozens of others.
  • The Sparsity Paradox: Even if two heads look at the same tokens, one might be "sparse" (only looking at the most critical tokens) while another is "dense" (looking at a broader context). Figure 2c in the paper illustrates this beautifully, showing how sparse and dense heads share common focal points.
  • Token-Level Accuracy: By compressing the head dimension rather than the sequence dimension, ProxyAttn can afford to do token-level calculations during the estimation phase. This prevents the "overlooking" of high-scoring positions that plagues previous methods.
Figure 2: Observational study on Llama3.1-8B-Instruct using 8K-token data from the Needle in a Haystack (NIAH) Single-1 task of the RULER (Hsieh et al., 2024) dataset.

Key Results

ProxyAttn demonstrates a significant improvement in the Pareto front of performance vs. efficiency:

  • Speed: It achieves up to 10.3x acceleration for the attention operation at 256K tokens and 2.4x end-to-end prefilling speedup.
  • Accuracy: On the RULER benchmark (128K), ProxyAttn (with $\gamma=0.95$) maintained a score of 78.25, significantly outperforming MInference (70.74) and XAttention (72.64) at similar or better speeds.
  • Scalability: The method scales effectively to larger models like Llama3.1-70B, where it achieved a 2.08x end-to-end speedup without significant performance loss.
Figure 1: Performance and speedup results of different sparse attention methods on RULER.

Limitations and Future Work

  • Pre-filling Focus: The current work focuses primarily on the pre-filling stage. While this is the main bottleneck for long-context tasks, the authors note that extending this to the decoding phase is a key area for future research.
  • GQA Sensitivity: The number of proxy heads needed can vary by model architecture. For example, the Qwen model (which has a high Group-Query Attention ratio) required 4 proxy heads to reach optimal performance, whereas Llama only required 1.
  • Training-Free: While being training-free is a strength for deployment, the authors suggest that integrating these proxy head insights into the training process itself could yield even more "natively" sparse models.

Summary updated

BibTeX
@inproceedings{wang2026proxyattn,
  author = {Yixuan Wang and Huang He and Siqi Bao and Hua Wu and Haifeng Wang and Qingfu Zhu and Wanxiang Che},
  title = {{ProxyAttn: Guided Sparse Attention via Representative Heads}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=m3HXHQYmZu},
}
Figure