Block-Sparse Attention with Semantic-Geometric Decoupled Routing

Xinwei Long, Weigao Sun, Weibo Gao, Pengkun Jiao, Biqing Qi, Feida Zhu, Yiran Zhong, Steven Hoi, Bowen ZhouarXiv 2026

TL;DR

Traditional training-free block-sparse attention methods suffer from accuracy degradation because they pool token representations after applying Rotary Position Embeddings (RoPE), causing destructive phase interference. This paper introduces Semantic-Geometric Decoupled Routing (SGDR), which shifts semantic pooling to the pre-RoPE space and reconstructs geometric biases using an offline structural prior. This training-free approach maintains full-attention accuracy across context lengths up to 128K while achieving a 5.03× speedup over FlashAttention-2.

What Problem Does This Paper Address?

As Large Language Models (LLMs) scale to handle massive context windows (e.g., long documents, multi-turn conversations, and lengthy videos), standard dense self-attention becomes a massive computational bottleneck due to its quadratic scaling ($O(L^2)$) with sequence length.

Block-sparse attention is a hardware-friendly alternative that groups contiguous tokens into blocks and only computes attention between relevant query and key blocks. However, accurately routing these blocks without expensive token-level scanning is difficult. Existing training-free routers typically perform average pooling on token representations after RoPE has been applied. Because RoPE encodes positions via phase rotations, pooling these post-RoPE representations leads to destructive phase interference, which severely dampens high-frequency features and erases critical local positional cues.

Methods

To resolve this conflict, the authors propose Semantic-Geometric Decoupled Routing (SGDR), a training-free framework that mathematically separates semantic aggregation from geometric positioning:

  1. Pre-RoPE Semantic Pooling: SGDR shifts average pooling from the post-RoPE space to the pre-RoPE space. This prevents high-frequency phase cancellation and preserves the full semantic energy of the tokens.
  2. Offline Geometric Profiling: The spatial and geometric biases introduced by RoPE are invariant to specific inputs. SGDR calibrates a "Normalized Structural Spectrum" offline using a small, task-agnostic text corpus to capture distance-aware energy compensation and phase biases.
  3. Closed-Form Trigonometric Scoring: During online inference, the real-time pre-RoPE semantic features are combined with the pre-computed offline geometric priors into an explicit, closed-form trigonometric formula. This reduces the block relevance estimation from an $O(B^2)$ token-level operation to an ultra-fast $O(1)$ block-level calculation.

The authors also implemented custom Triton kernels to ensure the hardware efficiency of this decoupled block-level formulation.

Datasets

  • Offline Calibration: Paul Graham Essays (for text models) and VideoChatGPT snippets (for video models).
  • Long-Context Retrieval: RULER, which tests effective context windows and fact extraction up to 128K tokens.
  • Long-Context Understanding: LongBench, covering single/multi-doc QA, summarization, few-shot learning, and code synthesis.
  • Language Modeling: PG19, used to evaluate long-text perplexity scaling.
  • Long Video Reasoning: VideoMME and LongVideoBench (LVB), evaluating multi-choice accuracy across various video durations.

Key Insights and Ideas

  • The Post-RoPE Pooling Trap: Average pooling post-RoPE acts as an unintended low-pass filter. As shown in Figure 1, traditional post-RoPE pooling completely obliterates the root-mean-square (RMS) energy in high-frequency dimensions, whereas pre-RoPE pooling preserves it perfectly.
Figure 1: RMS energy decay across frequency dimen- sions for different pooling methods. Traditional Post- RoPE pooling (blue) causes severe high-frequency en- ergy loss, shown by the shaded area. Our Pre-RoPE pooling (red) mitigates this loss, closely matching the original token energy.
  • Geometry is Static, Semantics are Dynamic: Because the geometric transformations of RoPE depend entirely on relative token distances and the model's architecture, they can be profiled once offline. This leaves the online router with the sole task of computing dynamic semantic activations.
  • Restoring the Attention Diagonal: Without proper geometric modeling, block routers either lose positional awareness entirely or overly isolate the diagonal. SGDR successfully restores a natural, continuous diagonal attention pattern and preserves long-range semantic sinks.
Figure 4: Visual comparison of block routing scores. (a) Pure semantics loses positional awareness. (b) Post- RoPE dilutes context via high-frequency interference. (c) Center RoPE overly isolates the diagonal. (d) Ours perfectly restores a robust diagonal and natural local context using structural priors.

Key Results

  • Substantial Speedups: At a 128K context length, SGDR achieves a 5.03× speedup over FlashAttention-2, dropping prefill latency from 451.03 ms to just 89.59 ms.
Figure 2: Prefill latency (bars, left axis) and speedup (lines, right axis) from 8K to 128K sequence lengths. Our method achieves the lowest latency and highest speedup across all settings, reaching a 5.03× accelera- tion over FlashAttn at 128K. Although MInference at- tains comparable speed, its accuracy degrades at 128K, as shown in Tab. 1.
  • Negligible Routing Overhead: Unlike token-level search methods (e.g., XAttention, FlexPrefill) whose overhead balloons at scale, SGDR keeps block estimation time virtually flat and under 3.4 ms across all sequence lengths.
Figure 3: Estimation time overhead comparison. Our method keeps setup time near zero (under 3.4 ms) across all lengths, showing no major growth as sequences grow.
  • Maintained Accuracy: On the RULER benchmark, SGDR achieves the highest average scores among all approximate methods (87.55 on Llama-3.1-8B-Instruct and 86.09 on Qwen-3-8B), closely matching the performance of full dense attention.

Limitations and Future Work

  • Softmax Attention Dependency: SGDR is designed specifically for standard Softmax self-attention architectures. It cannot be directly applied to linear attention models or non-attention architectures (like Gated Delta Net or Lightning Attention) that eliminate the Softmax matrix entirely.
  • RoPE Specificity: The mathematical framework relies strictly on the geometric properties of RoPE and its variants (e.g., YaRN, M-RoPE). It cannot be easily adapted to models utilizing older or alternative position encodings, such as learnable absolute position embeddings.
  • Future Directions: The authors plan to explore extending this decoupled routing mechanism to world models and video generation frameworks.

Summary updated

BibTeX
@misc{long2026block,
  author = {Xinwei Long and Weigao Sun and Weibo Gao and Pengkun Jiao and Biqing Qi and Feida Zhu and Yiran Zhong and Steven Hoi and Bowen Zhou},
  title = {{Block-Sparse Attention with Semantic-Geometric Decoupled Routing}},
  year = {2026},
  eprint = {2609.22884},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.22884},
}
Figure