Manuscript Offprint

arXiv:2610.19026

Joint Subspace Sparse Attention for Efficient Long-Context Decoding

Jiwon Song, Yoongon Kim, Jae-Joon Kim

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

ABSTRACT

Sparse attention reduces the KV-cache traffic that dominates long-context LLM decoding, but practical methods largely operate at coarse granularity. Token-level selection offers finer control, yet presents two challenges: low-dimensional scoring may lose query-key structure needed for accurate ranking, while gathering scattered selected tokens can offset the resulting latency benefit. We introduce Joint Subspace Sparse Attention (JSSA) to address both challenges. For selection quality, JSSA learns a shared low-dimensional query-key subspace by minimizing token-score preservation error. We upper-bound the resulting non-convex objective with a tractable marginal objective that admits a closed-form spectral solution; direct refinement of the exact objective provides no measurable improvement in the tested settings. For execution efficiency, we develop a gather-free token-level indexed-attention kernel that supports distinct per-KV-head selections under the standard grouped-query attention (GQA) KV-cache layout. Across standard GQA, hybrid sliding-window/global attention, and Multi-head Latent Attention (MLA) models, JSSA consistently remains close to full-KV accuracy while avoiding the substantial generation-length inflation and architecture-dependent failures observed with competing methods. On an NVIDIA B200 GPU, JSSA achieves up to 6.43×6.43\times the decoding throughput of full-KV attention at 128K context. JSSA achieves reasoning accuracy comparable to model-native DSA without model training and reaches 96–99% of its decoding throughput even at 700B scale large models.

1 INTRODUCTION

Long-context autoregressive decoding is often bottlenecked by repeatedly accessing the growing KV cache. With full attention, each decoding step scores the current query against the entire context and reads all the corresponding values, causing memory traffic to grow linearly with sequence length. Because attention is typically memory-bandwidth-bound in this regime, reducing KV accesses is one of the most direct ways to accelerate long-context decoding. Sparse attention reduces KV access by selecting only part of the context at each decoding step. Block- or page-level methods (Tang et al., 2024; Gao et al., 2026) align naturally with paged KV-cache layouts and block-sparse kernels, whereas token-level methods (Wu et al., 2025; Ribar et al., 2024) such as Loki (Singhania et al., 2024) and FASA (Wang et al., 2026) select individual positions. Token-level selection can represent finer-grained sparse patterns, yet this flexibility has not translated reliably into either higher accuracy or lower latency. This finer granularity creates two challenges. First, objectives that preserve queries or keys independently may not preserve the bilinear scores used for token ranking. Second, token-level selection produces irregular per-KV-head index sets in grouped-query attention (GQA). Gathering them into a contiguous buffer adds overhead, and forcing all KV heads to share one selected set can degrade accuracy.

We introduce Joint Subspace Sparse Attention (JSSA), a training-free method that addresses both challenges. For selection, JSSA learns a shared query-key subspace by minimizing bilinear score error through a closed-form spectral surrogate; directly refining the exact objective provides no

∗^{*}Equal Contribution

Per-KV-head view

  1. Token Selection

  2. Gather-Free Attention

Figure

Figure 1: JSSA at one decoding step for a single KV head. The mean of its associated query heads scores a projected-key cache in a shared low-dimensional subspace to select the top-B token positions. The query heads share this index set, and gather-free indexed attention accesses the corresponding original full-dimensional keys and values.

measurable selection benefit in the tested settings. For execution, JSSA preserves distinct per-KV-head token sets and consumes them directly through a gather-free indexed-attention kernel under the standard GQA KV-cache layout. Together, these components provide an end-to-end token-level sparse-decoding path across GQA and MLA (Liu et al., 2024) models.

Our main contributions are:

• Score-preserving joint query-key projection. We formulate an exact bilinear score-error objective, derive a tractable marginal upper bound with a closed-form spectral solution, and show that direct refinement provides no measurable selection benefit in the tested settings.

• Gather-free per-KV-head token-level attention for GQA. We design, to the best of our knowledge, the first indexed-attention kernel that supports distinct per-KV-head selections under the standard GQA KV-cache layout without physically gathering selected entries.

• Validation across architectures and scales. JSSA remains close to full-KV accuracy across GQA, hybrid local/global attention, and MLA models, and achieves up to 6.43×6.43\times the decoding throughput of full-KV attention at 128K context on a B200 GPU. We further show that JSSA attains reasoning accuracy comparable to model-native DSA (DeepSeek-AI, 2025) on 700B-parameter scale models, without any model training.

References (75)

  • LongBench: A bilingual, multitask benchmark for long context understanding (opens the publisher in a new tab)
  • Sparse attention adaptation for long reasoning
  • Gemma 4 Technical Report
  • The Llama 3 Herd of Models
  • Squeezed attention: Accelerating long context length llm inference
  • RULER: What's the Real Context Size of Your Long-Context Language Models?
  • MInference 1.0: Accelerating pre-filling for long-context LLMs via dynamic sparse attention
  • Flexprefill: A context-aware sparse attention mechanism for efficient long-sequence inference
  • Kq-svd: Compressing the kv cache with provable guarantees on attention fidelity (opens arXiv in a new tab)
  • Flashmla: Efficient multi-head latent attention kernels
  • Snapkv: Llm knows what you are looking for before generation
  • Let's verify step by step
  • Aixin Liu, Bei Feng, Bin Wang, Bingxuan Wang, Bo Liu, Chenggang Zhao, Chengqi Dengr, Chong Ruan, Damai Dai, Daya Guo, et al. Deepseek-v2: A strong, economical, and efficient mixture-of-experts language model. arXiv preprint arXiv:2405.04434, 2024. (opens arXiv in a new tab)
  • Alexander H Liu, Kartik Khandelwal, Sandeep Subramanian, Victor Jouault, Abhinav Rastogi, Adrien Sadé, Alan Jeffares, Albert Jiang, Alexandre Cahill, Alexandre Gavaudan, et al. Ministral 3. arXiv preprint arXiv:2601.08584, 2026. (opens arXiv in a new tab)
  • Triattention: Efficient long reasoning with trigonometric kv compression (opens arXiv in a new tab)
  • Sals: Sparse attention in latent space for kv cache compression
  • Sparse winnowed attention for reduced inference memory via decompression-free kv-cache compression (opens arXiv in a new tab)
  • Compressive transformers for long-range sequence modelling (opens arXiv in a new tab)
  • GPQA: A Graduate-Level Google-Proof Q&A Benchmark
  • SparQ attention: Bandwidth-efficient LLM inference
  • Eigen attention: Attention in low-rank space for kv cache compression
  • Loki: Low-rank keys for efficient sparse attention
  • Kv cache transform coding for compact storage in llm inference
  • QUEST: Query-aware sparsity for efficient long-context LLM inference
  • FASA: FREQUENCY-AWARE SPARSE ATTENTION
  • Tokenselect: Efficient long-context inference and length extrapolation for llms via dynamic token-level kv cache selection
  • Xattention: Block sparse attention with antidiagonal scoring
  • Qwen3 Technical Report
  • Hardware-aligned and natively trainable sparse attention
  • American invitational mathematics examination (aime) 2025, 2025
  • Heavy-hitter oracle for efficient generative inference of large language models
  • LongBench, RULER, and PG-19 use LLaMA-3.1-8B-Instruct, Qwen3-14B, and Ministral-3-8B-Instruct-2512, enabling direct comparison of sparse-selection behavior across long-context understanding and language modeling
  • For GLM-4.7-Flash, token selection operates over the shared MLA cache, and sparse attention is executed using FlashMLA
  • PG-19 is evaluated using teacher-forced
  • Checkmarks indicate the evaluations performed for each model
  • The query heads associated with a KV head share the token set selected using their mean projected query
  • Sparse attention is executed using FlashMLA
  • We apply the same token budget to every sparse-attention layer and head
  • We then compute one projection basis per layer and KV head using the closed-form solution in Equation 20
  • As shown in Section 4.7, JSSA requires calibration sequences that cover the intended deployment context range
  • Packed calibration uses 128K-token sequences, whereas plain calibration uses the original unmodified examples
  • >JSSA</td><td>LongAlign</td><td>49.16</td><td>49.06</td></tr><tr><td>Qasper</td><td>49.13</td><td>49.15</td></tr><tr><td rowspan=
  • FASA is substantially more sensitive to input construction
  • JSSA is calibrated on packed 128K-token LongAlign sequences so that calibration covers the deployment context range, whereas FASA is calibrated on plain LongAlign examples
  • Because FASA does not specify the selection granularity for GQA, we perform scoring and token selection independently for each KV head using the mean of its associated query heads
  • CUDA graph capture is enabled, and each run generates 128 new tokens from the target input context
  • They exclude model loading, JSSA calibration, kernel compilation, and warm-up
  • We define the selection objective over independent draws
  • The calibration objective therefore measures the projected-score error $\bar{q}^{\top}(I-P)k$ across the query-key combinations that may be compared during inference
  • Thus, for any functions f and g
  • It does, however, determine the relative weighting of the query and key marginals in the tractable surrogate
  • Although the absolute gains are modest, normalization prevents the marginal surrogate from being dominated by the larger key second moment and preserves its intended joint query–key character
  • Their normalized commutator ratio on LLaMA-3.1-8B is $0.470$ on average and $0.476$ at the median, confirming that the shared-eigenbasis special case does not hold empirically
  • For LLaMA-3.1-8B-Instruct, we optimize all 256 layer-KV-head-specific bases in parallel, with one independent objective and basis for each layer-KV-head pair
  • For Gemma4-26B-A4B-It, refinement is evaluated at the default rank $r = 64$ over the five global-attention layers to which JSSA is applied
  • ><tr><td rowspan=
  • They support using $M_{\mathrm{marg}}^{\star}$ directly in practice, while not establishing either the tightness of the marginal bound or the global optimality of the spectral solution
  • ><tr><td>Model</td><td>$B$</td><td>JSSA</td><td>Loki</td><td>FASA</td></tr><tr><td rowspan=
  • To isolate whether this asymmetric score-preserving factorization is also effective for dynamic token selection, we adapt its factorization to JSSA's scoring pipeline rather than using KQ-SVD as a compression method
  • >LLaMA-3.1-8B-Instruct</td><td>Asymmetric (KQ-SVD)</td><td>84.25</td><td>81.77</td><td>73.23</td></tr><tr><td>JSSA</td><td>86.35</td><td>82.55</td><td>75.38</td></tr><tr><td rowspan=
  • >Model</td><td rowspan=
  • The asymmetric variant remains competitive in several RULER settings and recovers at larger reasoning budgets, but degrades sharply under aggressive sparsity on reasoning benchmarks
  • Here we provide the complete experimental setup, additional context, and full throughput sweeps for both model families
  • Given the small numerical differences involved and the potential for evaluation variance, we interpret these results as showing comparable reasoning accuracy rather than a consistent advantage for any individual method
  • We follow the measurement protocol in Appendix A.7
  • At shorter contexts and smaller batches, scoring and top-B selection can offset part of the reduction in KV access, particularly on Qwen3-8B
  • For JSSA, projecting the newly generated key is negligible, accounting for at most 3.2% of pipeline latency and less than 1% at larger batches
  • On Gemma4-26B-A4B-It, the two methods are comparable at small batches, but JSSA becomes faster as the batch increases, reaching 0.91 ms versus 1.07 ms for QUEST at batch size 64
  • To isolate the effect of scoring-cache quantization, we compare FP8 and BF16 projected-key caches on LLaMA-3.1-8B-Instruct, Qwen3-14B, and Ministral-3-8B-Instruct-2512 at the default projection rank $r = 32$
  • We compare this design with a head-shared alternative inspired by TokenSelect Wu et al. (2025), which aggregates head-specific token preferences through soft voting before forming a single token set for the entire layer
  • $\Delta$ denotes head-shared minus per-KV-head accuracy
  • >LLaMA-3.1-8B-Instruct</td><td>Per-KV-head</td><td>86.35</td><td>82.55</td><td>75.38</td></tr><tr><td>Head-shared soft vote</td><td>86.03</td><td>80.82</td><td>70.09</td></tr><tr><td>Δ</td><td>-0.32</td><td>-1.73</td><td>-5.29</td></tr><tr><td rowspan=
  • Table 21 separately reports the corresponding generation lengths relative to full-KV attention
  • >Method</td><td colspan=
  • Lower is better