cs.LGNov 22, 2026

QASparse: Query-Adaptive Sparse Attention with Tailored Budgets and Tokens

Authors: Zhiyuan Chen, Zihao Yang, Quanjiang Li, Haijiang Li, Jiancheng Pan, Qichao Zhao, Zihan Dong, Qiushi Shi, 

Organizations: 1Beijing Institute of Technology · 2Uppsala University · 3National University of Defense Technology · 4Nanjing University of Science and Technology · 

Abstract

Long-sequence inference in large language models is constrained by the high cost of prefilling, where dense attention scales quadratically with context length. Exploiting similarity across attention heads offers a way to reduce redundant computation. Prior approaches in this direction have relied on localized query observations to determine head-level computation reuse or budget allocation. However, inter-head similarity does not imply uniform query requirements, leaving adaptation to varying budget needs and selection preferences across query regions a key challenge. We introduce QASparse, a Query-Adaptive Sparse attention mechanism with hardware-efficient execution. QASparse preserves the efficiency of shared cross-head importance estimation while adapting computational budgets and token selections to query requirements, and it executes these dynamic sparse decisions through dedicated kernels. Its query adaptivity stems from two complementary innovations: Local Budget Regression models local variations in computational demand along query positions to estimate budgets for different query regions and attention heads; Boundary Voting lets queries within each head vote over candidates near the selection cutoff using actual query/key scores, refining the retained set while preserving the initial selection size. To reduce the execution overhead of dynamic budgets, we further design length-specialized selection kernels that efficiently support query-adaptive sparse patterns across context lengths. Together, these designs efficiently combine shared estimation with local decisions while adapting both how much attention is computed and which interactions are retained. Experimental results demonstrate improved benchmark scores and faster prefill attention computation compared with existing sparse attention baselines.

Figures & tables

Appendix figures & tables23 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Attend at the Right Resolution: Head-Adaptive Sparse Attention via Query-Key Interaction Structure

    Nov 6, 2026Wajih Hassan Raza, Ahsan Bilal, Yidan Shen +3Sparse AttentionEfficient Attention

  2. QUILT: Rethinking Sparse-Attention Prefill through Shared Query Execution

    Oct 8, 2026Zhenduo Zhao, Qihui Zhou, Mingcong Song +7LLM Inference AccelerationSparse Attention