The computational cost of softmax-based attention in transformers limits their applicability to long-context tasks. Adaptive sparsity, of which $α$-entmax attention is an example, offers a flexible data-dependent alternative, but existing implementations are inefficient and do not leverage the sparsity to obtain runtime and memory gains. In this work, we propose AdaSplash, which combines the efficiency of GPU-optimized algorithms with the sparsity benefits of $α$-entmax. We first introduce a hybrid Halley-bisection algorithm, resulting in a 7-fold reduction in the number of iterations needed to compute the $α$-entmax transformation. Then, we implement custom Triton kernels to efficiently handle adaptive sparsity. Experiments with RoBERTa and ModernBERT for text classification and single-vector retrieval, along with GPT-2 for language modeling, show that our method achieves substantial improvements in runtime and memory efficiency compared to existing $α$-entmax implementations. It approaches -- and in some cases surpasses -- the efficiency of highly optimized softmax implementations like FlashAttention-2, enabling long-context training while maintaining strong task performance.
Efficiently Dispatching Flash Attention For Partially Filled Attention Masks
University of Tübingen(蒂宾根大学);Tübingen AI Center(蒂宾根人工智能中心);ELLIS Institute Tübingen(ELLIS蒂宾根研究所);Max Planck Institute for Intelligent Systems(马克斯·普朗克智能系统研究所)
DashAttention: Differentiable and Adaptive Sparse Hierarchical Attention
Tsinghua University(清华大学);Instituto Superior Técnico, Universidade de Lisboa(里斯本大学理工学院);Instituto de Telecomunicações(电信研究院);Carnegie Mellon University(卡内基梅隆大学);Sapienza University of Rome(罗马萨皮恩扎大学);University of Edinburgh(爱丁堡大学);TransPerfect(TransPerfect公司);ELLIS Unit Lisbon(里斯本ELLIS单位)
Block-Sparse Attention with Semantic-Geometric Decoupled Routing
Tsinghua University(清华大学);Alibaba Group(阿里巴巴集团);University of Science and Technology of China(中国科学技术大学);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)
SeerAttention: Learning Intrinsic Sparse Attention in Your LLMs
The University of Hong Kong(香港大学);University of Washington(华盛顿大学);Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));Microsoft Research(微软研究院);NVIDIA(英伟达)
SAS: Simple Attention Sparsification via End-to-End Optimization of Context Ranking
Tencent HY LLM Frontier(腾讯混元大模型前沿团队);Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));Hong Kong University of Science and Technology(香港科技大学)