Manuscript Offprint

arXiv:2611.04313

Coarse Semantic Blocks for Efficient Training-Free Sparse Attention

Sosuke Kobayashi, Shoichiro Yamaguchi, Seiya Tokui

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

We introduce a training-free sparse attention method that builds a prompt-specific key index to accelerate both prefill and decoding. The method clusters the keys into large semantic blocks that group tokens from noncontiguous positions. Each query position selects blocks by scoring their centroids and attends to the original keys and values within them. Queries that select the same block are processed together, so prefill stays fast even though each query chooses its own blocks. Large blocks make centroid scoring and this grouped processing cheap, so each query can attend to more tokens in the same time. Larger blocks with a larger token budget can thus be both faster and more accurate on long-context tasks than smaller blocks with a smaller budget. We evaluate two hybrid LLMs, Qwen3.5-4B and 35B-A3B, on one NVIDIA H200. Including the cost of building and using the index, whole-model wall-clock speedups over dense attention are 2.3–2.4x for prefill and 1.7–2.0x for decoding at 512K tokens, and 2.9–3.0x for prefill at 1M. The 35B-A3B model stays close to dense attention on five RULER tasks through 1M, on LongBench-v2 overall, and on MRCR through 256K. The 4B model loses accuracy mainly on multi-key retrieval, yet outperforms dense Qwen3.5-2B, whose latency is similar at 512K, on all three benchmarks.

1 INTRODUCTION

Long contexts make attention expensive during both prefill and decoding. Sparse attention restricts each query to a subset of tokens, but it is faster only if choosing the tokens and preparing their keys and values costs less than the attention computation it saves. Methods with learned indexers, such as DSA (DeepSeek-AI, 2025), MSA (Lai et al., 2026), and QSA (Qiu et al., 2026), train the indexer and the model so that a small token budget suffices. For training-free methods, estimating token importance separately for each query during prefill is costly, and irregular selections are difficult to execute efficiently on GPUs (Nawrot et al., 2026). Existing methods therefore select contiguous blocks (Tang et al., 2024), whose tokens are often unrelated to one another, or share one selection across neighboring queries (Jiang et al., 2024; Lai et al., 2025; Jones et al., 2026; Fan et al., 2026a). Other methods cluster similar keys during dense prefill and use the resulting index only for decoding (Liu et al., 2025b; Zhu et al., 2026).

We show that, without training, a sparse prefill in which each query selects its own blocks can still run much faster than dense attention. Our method clusters the keys of each input prompt into large semantic blocks, groups of tokens with similar keys regardless of their positions in the sequence. Each query scores the cluster centroids and attends to the original keys and values of the blocks it selects. Unlike contiguous blocks, a semantic block gathers tokens that a query is likely to need together. We use the same index for both the prompt's own prefill and decoding.

Scoring one centroid per block makes selection cheaper than scoring every key individually. During prefill, queries that select the same block are processed together for that block, as in the KV-outer execution of MoBA and MSA (Lu et al., 2025; Lai et al., 2026). This lets the GPU reuse KV data in on-chip memory across queries while preserving each query's own block selection. Larger blocks make centroid scoring and block-wise attention cheaper but token selection less precise. The

Code: https://github.com/pfnet-research/semantic-block-sparse-attention/

Figure

Figure 1: Prefill and decode latency on one H200 with a token budget of L/16L/16 for a prompt of LL tokens. Whole-model latency is measured by wall clock, and full-attention layers (shaded) by GPU time. The rows are Qwen3.5-4B (top) and 35B-A3B (bottom). Dense (2B) is Qwen3.5-2B. Speedups are over dense attention (Tables 13 and 31).

time saved leaves room for a larger token budget, which can compensate for the coarser selection (Section 5.3).

We evaluate on hybrid models, which use full attention in only some layers and are increasingly common among top-tier LLMs (MiniMax, 2025; Qwen Team, 2026; Gemma Team, 2026). On Qwen3.5-4B and 35B-A3B, whole-model prefill is 2.3–2.4×2.3–2.4\times faster and decoding 1.7–2.0×1.7–2.0\times faster than dense attention at 512K tokens, and prefill is 2.9–3.0×2.9–3.0\times faster at 1M, with index construction included and dense attention run on the same inference stack (Figure 1). The 35B-A3B model stays close to dense attention on five RULER tasks (Hsieh et al., 2024) through 1M, on LongBench-v2 (Bai et al., 2025) overall, and on MRCR (OpenAI, 2025) through 256K. The 4B model, which loses accuracy mainly on the multi-key tasks in RULER, still outperforms dense Qwen3.5-2B, whose latency is similar at 512K (Table 1).

References (100)

Couldn't load all references. Reload the page to try again.