Making Every Head Count: Sparse Attention Without the Speed-Performance Trade-off
Mingkuan Zhao, Wentao Hu, Jiayin Wang, Xin Lai, Tianchen Huang, Yuheng Min, Rui Yan, Xiaoyan Zhu
TL;DR
This work tackles the inefficiency of multi-head self-attention in Transformers by introducing SPAttention, a structured sparse attention mechanism that partitions the attention distance spectrum into balanced, non-overlapping bands assigned to each head. By enforcing completeness, exclusivity, and balance, SPAttention converts $H$ redundant $O(N^2)$ computations into a single $O(N^2)$ computation, achieving substantial throughput gains while preserving or improving performance on diverse benchmarks. The authors provide formal definitions, theoretical efficiency and regularization analyses, and extensive experiments showing roughly 2x training throughput and competitive or superior task performance across model scales up to 7B in the OLMoE framework, as well as favorable comparisons to leading sparse-attention methods. The results suggest that principled, hardware-friendly structural sparsity can break the traditional speed-performance trade-off and guide next-generation efficient LLM architectures.
Abstract
The design of Large Language Models (LLMs) has long been hampered by a fundamental conflict within their core attention mechanism: its remarkable expressivity is built upon a computational complexity of O(H N^2) that grows quadratically with the context size (N) and linearly with the number of heads (H). This standard implementation harbors significant computational redundancy, as all heads independently compute attention over the same sequence space. Existing sparse methods, meanwhile, often trade information integrity for computational efficiency. To resolve this efficiency-performance trade-off, we propose SPAttention, whose core contribution is the introduction of a new paradigm we term Principled Structural Sparsity. SPAttention does not merely drop connections but instead reorganizes the computational task by partitioning the total attention workload into balanced, non-overlapping distance bands, assigning each head a unique segment. This approach transforms the multi-head attention mechanism from H independent O(N^2) computations into a single, collaborative O(N^2) computation, fundamentally reducing complexity by a factor of H. The structured inductive bias compels functional specialization among heads, enabling a more efficient allocation of computational resources from redundant modeling to distinct dependencies across the entire sequence span. Our work demonstrates that thoughtfully designed structural sparsity can serve as an effective inductive bias that simultaneously improves both computational efficiency and model performance, opening a new avenue for the architectural design of next-generation, high-performance LLMs.
