mlsanityData to 14 Oct 2026

Trainable Dynamic Mask Sparse Attention

arXiv 2508.02124 ↗First posted 4 Aug 2025cs.AI cs.CL cs.LGcited by 6

Not on the map. Why?

Abstract (arXiv)

The increasing demand for long-context modeling in large language models (LLMs) is bottlenecked by the quadratic complexity of the standard self-attention mechanism. The community has proposed sparse attention to mitigate this issue. However, position-aware sparse attention methods rely on static sparse structures that lack adaptability to diverse query contexts, while content-aware sparse attention methods depend on heuristic key-value selection, hindering full differentiability. We introduce a trainable dynamic mask sparse attention mechanism, a method that merges the advantages of both position-aware and content-aware approaches. Dynamic Mask Attention (DMA) achieves this through three key innovations: First, it leverages value vector representations to generate content-aware dynamic masks, enabling the model to adaptively identify and attend to critical information. Second, it computes position-aware sparse weights in a hardware-friendly manner, efficiently skipping unnecessary computational regions. Finally, we demonstrate that the introduced dynamic mask and sparse weights do not obstruct gradients, supporting end-to-end training. We have validated the performance of DMA through comprehensive experiments. A large body of experimental evidence shows that DMA consistently holds a Pareto advantage over state-of-the-art sparse attention baselines in tasks including scaling laws, multi-query associative recall, standard benchmarks, and needle in a haystack tests, while also delivering up to a 10x overall speedup. These results highlight its ability to effectively balance model efficiency with long-context modeling capabilities. Our computational kernel code is now open-source at https://github.com/SmallDoges/flash-dmattn to encourage further research and application by the community.

Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 44 of its 59 references that are in the map. First posted on arXiv 4 Aug 2025.

Builds on

44 of 59 references.

References · 44

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Measuring Massive Multitask Language Understandingcited by 7,963
  3. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
  4. 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
  5. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
  6. 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
  7. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
  8. 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,568
  9. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
  10. 2020Longformer: The Long-Document Transformercited by 3,413
  11. 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,955
  12. 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,883
32 more
  1. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
  2. 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,164
  3. 2024Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameterscited by 1,986
  4. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
  5. 2017Decoupled Weight Decay Regularizationcited by 1,831
  6. 2020Big Bird: Transformers for Longer Sequencescited by 1,684
  7. 2019Generating Long Sequences with Sparse Transformerscited by 1,546
  8. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
  9. 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,336
  10. 2016The LAMBADA dataset: Word prediction requiring a broad discourse contextcited by 992
  11. 2022In-context Learning and Induction Headscited by 964
  12. 2024SnapKV: LLM Knows What You are Looking for Before Generationcited by 880
  13. 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 832
  14. 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 713
  15. 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inferencecited by 501
  16. 2023Model Tells You What to Discard: Adaptive KV Cache Compression for LLMscited by 474
  17. 2025Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attentioncited by 407
  18. 2016From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classificationcited by 341
  19. 2023Effective Long-Context Scaling of Foundation Modelscited by 303
  20. 2015Unitary Evolution Recurrent Neural Networkscited by 294
  21. 2024CodeAgent: Enhancing Code Generation with Tool-Integrated Agent Systems for Real-World Repo-level Coding Challengescited by 282
  22. 2023Zoology: Measuring and Improving Recall in Efficient Language Modelscited by 204
  23. 2024InfLLM: Training-Free Long-Context Extrapolation for LLMs with an Efficient Context Memorycited by 197
  24. 2024Flex Attention: A Programming Model for Generating Optimized Attention Kernelscited by 185
  25. 2024Scaling Laws and Compute-Optimal Training Beyond Fixed Training Durationscited by 170
  26. 2024SeerAttention: Learning Intrinsic Sparse Attention in Your LLMscited by 124
  27. 2021CKConv: Continuous Kernel Convolution For Sequential Datacited by 120
  28. 2024MagicPIG: LSH Sampling for Efficient LLM Generationcited by 111
  29. 2024ClusterKV: Manipulating LLM KV Cache in Semantic Space for Recallable Compressioncited by 65
  30. 2024HashAttention: Semantic Sparsity for Faster Inferencecited by 24
  31. 2024LLM×MapReduce: Simplified Long-Sequence Processing using Large Language Modelscited by 17
  32. 2025DAM: Dynamic Attention Mask for Long-Context Large Language Model Inference Accelerationcited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 2; 2026: 4.

6 papers.