Landscape illustration from NVIDIA's 17 November 2026 technical blog on co-designing sparse attention for long-context inference.
Image from NVIDIA's 17 November 2026 technical blog, 'Co-Designing Sparse Attention for Efficient Long-Context Inference.', NVIDIA

要点

  • On 17 November 2026, Timmy Liu, Nidhi Bhatia, Samkit Jain, Makesh Tarun Chandran and Bita Darvish Rouhani published "Co-Designing Sparse Attention for Efficient Long-Context Inference" on the NVIDIA Technical Blog. It is a primer for developers who train sparse attention into a model for NVIDIA GPUs, not drop-in methods applied after training, such as BLASST, MInference, or Quest.
  • Context lengths are moving from tens of thousands of tokens to hundreds of thousands. At those lengths, attention is the most expensive part of a transformer layer. Dense attention cost per query grows with context length N, and at 128K tokens it can take most of the prefill time in a layer, when the model reads the whole prompt at once.
  • In sparse attention, each query attends only to the k most relevant keys, typically a few thousand, so core attention stops scaling with context. The indexer that finds those keys still scores all N keys. The post states, "The cost does not disappear; it moves into the indexer."
  • Figure 1 compares per-layer prefill time at 128K tokens for DeepSeek-R1, which uses dense MLA, Multi-head Latent Attention, with DeepSeek V3.2, which uses DSA, DeepSeek Sparse Attention. The indexer and Top-k, which keeps the k highest scores, take 47% of the DeepSeek V3.2 prefill layer.
  • A production FP8 kernel swept indexer heads, dimensions, compression, and draft depth. NVIDIA reports that fusing Top-k into the indexer kernel removes a write and read of the scores, and that reusing the previous decode step's selection as a guess makes Top-k 2.1x to 2.4x faster on DeepSeek V3.2 and DeepSeek V4 decode than a standard top-score method.

On 17 November 2026, the NVIDIA Technical Blog published a primer by Timmy Liu, Nidhi Bhatia, Samkit Jain, Makesh Tarun Chandran and Bita Darvish Rouhani on designing sparse attention for NVIDIA GPUs. Software agents, long documents, and large codebases are pushing context lengths from tens of thousands of tokens to hundreds of thousands. At those lengths, the authors write, attention is the most expensive part of a transformer layer.

Sparse attention is the model-level answer they describe. Each query looks at only a short list of keys, typically a few thousand, instead of every token in the prompt. The post's warning is that this does not make the cost of long context go away. The work of scoring every key moves into a component called the indexer. In NVIDIA's Figure 1, at 128K tokens, the indexer and the Top-k step that follows it already take 47% of a DeepSeek V3.2 prefill layer. The advice is to design that indexer for the GPU's matrix units, rather than treat sparsity as a free saving.

[1]

Dense attention scores every query against every key, so the cost per query grows with the context length, N. At 128K tokens, the post says, that work can take most of the prefill time in a layer. Prefill is the first stage of inference, when the model reads the entire prompt at once. In the sparse design, each query attends only to the k most relevant keys, typically a few thousand. Core attention, the weighted mix of those keys and values, then stops scaling with N. The indexer still scores all N keys, and Top-k keeps the k highest scores. The last two stages scale with k. The indexer still scales with N.

Figure 1 shows per-layer prefill time at 128K tokens, comparing DeepSeek-R1, which uses dense MLA, with DeepSeek V3.2, which uses DSA. MLA, Multi-head Latent Attention, is DeepSeek's dense design, in which every query still scores every key. DSA, DeepSeek Sparse Attention, is the sparse successor. In that figure, NVIDIA says the indexer and Top-k take 47% of the DeepSeek V3.2 prefill layer. The company presents this as evidence that the cost has moved, not vanished. The post covers sparsity trained into the model, not drop-in methods such as BLASST, MInference, or Quest. The authors used a production FP8 kernel, which does the indexer math in 8-bit floating-point numbers, to sweep design choices and to time Top-k and core attention.

[1]

The indexer is one batched matrix multiply with a fused follow-up step. Query heads score the current query against a cache of indexer keys, and a short post-processing step turns those scores into one raw score, or logit, per key. The hardware that matters is the Tensor Core, the GPU's dedicated matrix-multiply unit, which processes work in chunks called tiles. The first guideline is that the group size G, the number of query heads that share one key head, multiplied by the tokens scored in one decode step, the draft proposals plus the real new token, should fit in one tile, about 200 rows, or 256 if the follow-up math uses FP16, a 16-bit format.

Using one key head, with a reduction across query heads, writes one score per key and, the post says, avoids the linear growth in decode time that appears when key heads are added. In the decode measurements, raising key heads from 1 to 8 increased runtime by 7.6 times, because each extra key head means another full read of the key cache. An indexer head dimension of 128 or 256 balances Tensor Core use against the extra memory traffic of wider keys in decode. Most designs in their table settle at 128. Table 1 already lists DeepSeek Sparse Attention with 64 query heads, one key head, and a head dimension of 128. Its compression ratio is 1, one indexer key per token, and it selects single tokens rather than blocks. Even with the head counts the hardware prefers, the indexer and Top-k still took 47% of that 128K prefill layer.

Compression, hierarchical indexing, or sharing an index across layers can cut the number of keys scored, and with it the work in both the indexer and Top-k, but does not change how much arithmetic is done per byte moved. Fusing Top-k into the indexer kernel removes a write and a later read of the full score matrix. Reusing the previous decode step's selection as a guess, the method NVIDIA calls Guess-Verify-Refine and has put in TensorRT LLM, is reported as 2.1x to 2.4x faster than a standard top-score method on DeepSeek V3.2 and DeepSeek V4 decode. The authors also point to a fused path in the open-source FlashInfer library.

[1]

These figures are NVIDIA's own. The 47% share is for one published model, DeepSeek V3.2, at 128K tokens, on NVIDIA's measurement of a prefill layer, not a universal law for every sparse model or every length. The 47% figure is taken from the blog text and the figure caption. The chart itself was not recovered as a readable image here, so no other bar heights or absolute times from Figure 1 are used.

The kernel sweeps use a stated setup unless otherwise noted, including an FP8 indexer, 64K indexer keys, a compression ratio of 4, meaning one indexer key for every four tokens, a head dimension of 128, and one key head. That is not the same setup as DeepSeek V3.2 in Figure 1, which Table 1 lists with a compression ratio of 1. The 2.1x to 2.4x Top-k gain is also NVIDIA's own measurement. This piece does not independently check the Guess-Verify-Refine paper, the TensorRT LLM repository, or the FlashInfer path. The post is about runtime on NVIDIA GPUs and does not report whether the sparse models in Table 1 match dense attention on quality.

[1]

A fair reading is that NVIDIA is not saying sparse attention is useless. Core attention no longer scales with context length, and a well-designed indexer can be much cheaper than scoring every key in the dense way. The 47% figure is there to show that the indexer can become the new bottleneck if it is designed without regard to the hardware, not to claim that sparsity failed. DeepSeek V3.2 is the sparse model in NVIDIA's comparison, and its indexer already follows several of the later hardware guidelines, which makes the remaining share harder to dismiss. The post tells model authors which knobs the GPU rewards, so that the saving in core attention is not spent again in the indexer and in Top-k.

[1]

The test over the next six months is whether new long-context models publish indexer and Top-k time as their own figures, rather than only a single "sparse versus dense" speedup, and whether open kernels, including TensorRT LLM and FlashInfer, show the fused Top-k gain outside NVIDIA's blog sweeps. If those breakdowns do not appear, the 47% figure will remain a vendor exhibit for one model at one length. If they do appear, and the indexer share stays large unless the heads, dimensions and group sizes are chosen for the tile, then the post's warning will have been right. Sparse attention moves the cost. It does not delete it.

[1]