NeurIPS 2026QuestionsPapersAreasAboutMarkdown

DashAttention: Differentiable and Adaptive Sparse Hierarchical Attention

Yuxiang Huang, Nuno Gonçalves, Federico Alvetreti, Lei Li, Xu Han, Edoardo Ponti, André Martins, Marcos Treviso

NeurIPS page · Open on the map

Category: Efficient LLM Inference & Training › Sparse Long-Context Attention · Type: new method · Keywords: hierarchical attention, adaptive sparsity, α-entmax, long-context modeling, GPU-aware implementation, speedup over FlashAttention

Areas: Long Context › Long-context mechanisms › Attention optimizations; Model Architectures & Sequence Modeling › Language Model Architectures › Sparse Attention

Summary

DashAttention introduces a differentiable and adaptive sparse hierarchical attention that uses α-entmax to select a variable number of key-value blocks per query, providing a prior for a second-stage softmax attention, keeping the whole hierarchy fully differentiable, non-dispersive, and achieving up to 3.3× speedup over FlashAttention-3.

Explained to a 5-year-old

Computers read long texts by paying attention to the most important parts. The old method always picks the same number of parts, which can be too many or too few. The new idea lets the computer decide how many parts to look at based on what it’s trying to understand. It uses a special math rule that can choose a variable number of parts for each question. This makes the program learn better and run faster, so it can understand longer stories without slowing down.

Explained to a 5-year-old, longer

Computers read long texts by paying attention to the most important parts. The old attention method always picks the same number of parts, like always choosing five. This can be wasteful if you need more information or not enough if you need less. The new idea lets the computer decide how many parts to look at based on what it’s trying to understand. It uses a special math rule that can choose a variable number of parts for each question. This makes the learning process smoother because the computer can get gradients from both stages. The new method also avoids spreading attention too far, which helps it focus better. As a result, the program can handle longer texts more accurately. It also runs faster, so it doesn’t take as much time to process big documents. This helps big language models work more efficiently on long inputs. The approach keeps the whole system fully connected, so training is more stable. It also works well when only a few parts of the text are needed. Overall, the new method makes long-text understanding easier and quicker.

For a technical reader

The method replaces a fixed top-k selection with an adaptively sparse α-entmax transformation that chooses a variable number of key-value blocks per query. This prior informs a second-stage softmax attention, making the entire hierarchy fully differentiable and eliminating dispersion. Experiments show comparable accuracy to full attention at 75% sparsity, a better Pareto frontier than existing hierarchical methods, and up to 3.3× speedup over FlashAttention-3 using a Triton implementation.

Problem

Existing hierarchical attention methods rely on a fixed top-k selection of key-value blocks, which limits adaptability, blocks gradient flow between sparse and dense stages, and hampers effective long-context modeling.

Method

The approach employs an adaptively sparse α-entmax transformation to choose a variable number of KV blocks per query, which serves as a prior for a second-stage softmax attention, ensuring the entire hierarchy remains fully differentiable and non-dispersive.

Results

The approach attains comparable accuracy to full attention with 75% sparsity, surpasses NSA and InfLLMv2 on the Pareto frontier (especially at high sparsity), and runs up to 3.3× faster than FlashAttention-3 at inference.

Contributions

It introduces a fully differentiable hierarchical attention scheme that adaptively selects a variable number of key-value blocks using α-entmax, ensures non-dispersive behavior for better long-context modeling, and provides a GPU-aware Triton implementation with significant speedups.

Practical relevance

It offers a cost-effective way to handle long contexts in large language models, enabling faster inference and better scalability.

Research questions this paper is counted under

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction