Long-Context Generalization with Sparse Attention
Pavlo Vasylenko, Hugo Pitorro, Andre F. T. Martins, Marcos V. Treviso
摘要
Transformer-based architectures traditionally employ softmax to compute attention weights, which produces dense distributions over all tokens in a sequence. While effective in many settings, this density has been shown to be detrimental for tasks that demand precise focus on fixed-size patterns: as sequence length increases, noninformative tokens accumulate attention probability mass, leading to dispersion and representational collapse. We show in this paper that dynamically sparse attention mechanisms using α-entmax can avoid these issues, due to their ability to assign exact zeros to irrelevant tokens. Furthermore, we introduce Adaptive-Scalable Entmax (ASEntmax), which endows α-entmax with a learnable temperature parameter, allowing the attention distribution to interpolate between sparse (pattern-focused) and dense (softmax-like) regimes. Our empirical evaluation on synthetic tasks and language modeling demonstrates that ASEntmax substantially outperforms softmax, scalable softmax, and fixed-temperature α-entmax baselines, achieving up to 1000× length extrapolation on synthetic benchmarks and superior long-context generalization on language modeling while preserving short-context performance, including better perplexity trends and higher retrieval accuracies at 8× training length. Source code: https://github.com/deep-spin/asentmax
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Efficient Streaming Language Models with Attention Sinks 引用了 PIQA: Reasoning about Physical Commonsense in Natural Language
- Efficient Streaming Language Models with Attention Sinks 引用了 Big Bird: Transformers for Longer Sequences
- Efficient Streaming Language Models with Attention Sinks 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Efficient Streaming Language Models with Attention Sinks 引用了 WinoGrande: An Adversarial Winograd Schema Challenge at Scale
- PIQA: Reasoning about Physical Commonsense in Natural Language 引用了 WinoGrande: An Adversarial Winograd Schema Challenge at Scale
- VideoNSA: Native Sparse Attention Scales Video Understanding 引用了 Efficient Streaming Language Models with Attention Sinks
- VideoNSA: Native Sparse Attention Scales Video Understanding 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 引用了 Big Bird: Transformers for Longer Sequences
- Modelling Attention with Aitchison Geometry: Token Distinguishability and Temperature Scaling 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- AdaSplash-2: Faster Differentiable Sparse Attention 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- TabICLv2: A Better, Faster, Scalable, and Open Tabular Foundation Model 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
引用它的顶会 Paper4
- TabICLv2: A Better, Faster, Scalable, and Open Tabular Foundation ModelJingang QU, David Holzmüller, Gael Varoquaux, Marine Le MorvanICML 2026 · 85 次引用
- VideoNSA: Native Sparse Attention Scales Video UnderstandingEnxin Song, Wenhao Chai, Shusheng Yang, Ethan Armand 等ICLR 2026 · 11 次引用
- AdaSplash-2: Faster Differentiable Sparse AttentionNuno M. T. Gonçalves, Hugo Pitorro, Vlad Niculae, Edoardo Ponti 等ICML 2026 · 3 次引用
- Modelling Attention with Aitchison Geometry: Token Distinguishability and Temperature ScalingSam Hilton-Jones, Timothy Norman, Zhanxing ZhuICML 2026
它引用的 Paper39
- Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie 等NeurIPS 2020 · 3,159 次引用
- WinoGrande: An Adversarial Winograd Schema Challenge at ScaleKeisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, Yejin ChoiAAAI 2020 · 3,037 次引用
- PIQA: Reasoning about Physical Commonsense in Natural LanguageYonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao 等AAAI 2020 · 2,916 次引用
- FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 次引用
- Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han 等ICLR 2024 · 1,714 次引用
相关 Paper
- Sparse and Continuous Attention MechanismsAndré F. T. Martins, António Farinhas, Marcos V. Treviso, Vlad Niculae 等NeurIPS 2020 · 55 次引用
- DAM: Dynamic Attention Mask for Long-Context Large Language Model Inference AccelerationHanzhi Zhang, Heng Fan, Kewei Sha, Yan Huang 等ACL Findings 2025 · 1 次引用
- Sparse Text GenerationPedro Henrique Martins, Zita Marinho, André F. T. MartinsEMNLP 2020 · 20 次引用
- AdaSplash: Adaptive Sparse Flash AttentionNuno Gonçalves, Marcos V. Treviso, André F. T. MartinsICML 2025
- Efficient Transformer Inference with Statically Structured Sparse AttentionSteve Dai, Hasan Genc, Rangharajan Venkatesan, Brucek KhailanyDAC 2023 · 11 次引用
