Stratified Sparse Attention: Reducing the Sparse-to-Dense Gap at Extreme Sparsity

Sahil Joshi, Prithvi Dixit, Aryan Katiyar, Agniva Chowdhury, Joseph E. Gonzalez, Anshumali Shrivastava, Aditya Desai, Kumar Krishna Agrawal

Rice University · UC Berkeley · Stanford University · Indian Institute of Technology Bombay

Published October 20, 2026 · on the feed October 22, 2026 · ▲ 6 · arXiv 2610.28441

Efficiency & inferenceRetrieval, memory & search Full code arXiv ↗Hugging Face ↗Dataset ↗

The abstract

Large Language Model inference over long contexts is increasingly bottlenecked by the cost of attending to a growing Key-Value (KV) cache. Sparse attention reduces this cost by accessing only a fraction of the cache, but existing methods face a trade-off between deterministic retrieval, which captures high-scoring tokens but discards residual attention mass, and sampling, which improves coverage at the cost of higher variance. Hybrid methods combine top-k retrieval with uniform sampling, yet still exhibit a substantial gap from dense attention at aggressive sparsity. We introduce Stratified Sparse Attention (SSA), a unified framework combining deterministic retrieval with score-guided sampling. SSA deterministically attends to high-scoring tokens while sampling the residual using proxy attention scores and correcting for their inclusion probabilities, thereby recovering attention mass beyond the retrieval set. SSA encompasses top-k, top-p, and hybrid top-k+sampling as special cases. Across RULER, LongBench, LOFT, and AIME, and five models ranging from 3B to 27B parameters, SSA consistently improves over the baselines at matched sparsity. On RULER-HARD with Ministral-3-8B, SSA improves accuracy over the strongest practical baseline from 81.8\% to 84.2\% at 32K and from 63.8\% to 69.3\% at 128K under 50times attention sparsity, recovering 94\% and 85\% of dense-attention performance, respectively. With optimized CUDA kernels, SSA achieves up to 2.96times decode speedup over FlashInfer at 1M context, demonstrating that its accuracy gains translate into practical long-context inference acceleration. We open-source our code at https://github.com/skylight-org/SSA-Paper-Code.

The Brief

2:47

A short podcast summary of the paper. Written and voiced by AI.

Transcript

Stratified Sparse Attention. Reducing the Sparse-to-Dense Gap at Extreme Sparsity. By Sahil Joshi and seven others, from Rice University, UC Berkeley, and two other institutions. Published on the twentieth of October. Its code repository is worked out: about fifty source files, with a readme and a licence.

Long-context inference in large language models is increasingly limited by the cost of attending to a Key-Value cache that keeps growing. Sparse attention cuts that cost by reading only a fraction of the cache, and existing methods face a trade-off in choosing which fraction. Deterministic retrieval captures the high-scoring tokens but throws away the residual attention mass spread over everything else. Sampling improves coverage of that residual, at the price of higher variance. Hybrid methods combine top-k retrieval with uniform sampling, yet at aggressive sparsity they still sit well short of dense attention.

Stratified Sparse Attention, or SSA, treats the two approaches as strata of one estimate rather than rivals. The high-scoring tokens are attended to deterministically. The rest is sampled, but not uniformly: sampling is guided by scores, and the result is corrected so that what was sampled stands in properly for what was not.

In practice SSA uses proxy attention scores to sample the residual, and corrects for each sampled token's inclusion probability. That correction is what lets it recover attention mass beyond the retrieval set rather than simply ignoring it. The framework is general enough to contain its predecessors: top-k, top-p, and hybrid top-k plus sampling each appear as special cases of it. Optimized CUDA kernels carry it into actual decoding.

Evaluation spans RULER, LongBench, LOFT and AIME, on five models ranging from three billion to twenty-seven billion parameters, and SSA consistently improves over the baselines at matched sparsity. The sharpest numbers come from RULER-HARD with Ministral-3-8B at fifty times attention sparsity.

At thirty-two thousand tokens of context, accuracy over the strongest practical baseline rises from eighty-one point eight percent to eighty-four point two. That recovers ninety-four percent of dense-attention performance.

At one hundred and twenty-eight thousand tokens, accuracy rises from sixty-three point eight percent to sixty-nine point three, recovering eighty-five percent of dense performance. On speed, SSA reaches up to two point nine six times faster decoding than FlashInfer at a context of one million tokens.

The gain comes from refusing to discard the tail. Retrieval alone leaves the residual attention mass on the table, and uniform sampling spends its budget blindly. Sampling that residual by score, and correcting for how likely each token was to be picked, narrows the gap to dense attention exactly where sparsity is most extreme, and the kernels show that the accuracy does not cost speed.

More with an account

Listen to every day’s papers

Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.

Join free
KipQuest: the day’s AI research, as podcasts and quests. All papers Android app Privacy Contact Episodes are written and voiced by AI from each paper. Summaries can contain mistakes: the paper is the source.