arXiv:2609.35629cs.LGSep 2026

Manuscript Offprint

arXiv:2609.35629

SANTA++: Sampling Attention through Representative Keys

Kyle Lee, Christian Z. Pratt, Ruoyu Fang, Heekyung Lee, Avinash Lohitsa, Ryan Modafe, Kerem Y. Camsari

ABSTRACT

Attention often concentrates on a small subset of tokens in the context, but which subset matters changes from one query to the next. To exploit this changing structure, we introduce SANTA++, a training-free stochastic attention method that uses representative keys for memory-efficient selection without scanning the entire key-value (KV) cache. Cached keys are organized into teams, and the query scores one representative from each team to decide which teams to sample. We compute exact attention scores within the sampled teams and reweight each team's contribution by the inverse of its inclusion probability. This importance sampling correction estimates attention over the full cache, with a sampling budget that lets us trade memory reads for accuracy. Remarkably, with 32 or 64 sampled teams, SANTA++ uses 16% to 22% of dense attention's KV reads and retains 94% to 99% of the dense-attention baseline's scores on LongBench v2 and HELMET's retrieval-augmented generation subset, and 85% to 91% on RULER, with Qwen2.5-7B-Instruct at 32K context. With 31 sampled teams, our GPU implementation delivers a 1.69× attention speedup over the dense FlashAttention baseline at 32K context. By reducing the number of cache entries read, SANTA++ in principle complements architectures with compressed KV representations, such as multi-head latent attention. Our kernels are available at: https://github.com/OPUSLab/santapp-kernel-demo.git.

1 INTRODUCTION

Which cached tokens make the largest contributions to attention depends on the current decoding query. At long context lengths, attention can concentrate on a small subset of cached tokens (Zhang et al., 2023; Tang et al., 2024), but identifying that subset from exact attention scores still requires reading every key. Selecting fewer tokens then saves value reads while leaving a full-key scan. When decoding is limited by memory bandwidth, these key-value (KV) cache reads are costly, and their cost grows with context length (Ribar et al., 2024). For example, with Qwen2.5-7B-Instruct at a 32K-token context, streaming bf16 keys and values amounts to about 64 MiB per layer for each generated token. To reduce both selection and evaluation reads, a sparse method must find useful entries without first scoring every key.

We introduce SANTA++, a training-free attention method that routes queries through actual-key representatives (Figure 1). After dense prefill, we divide prompt keys into parent groups, choose representative keys within each parent, and assign the remaining keys to their nearest representative. Each resulting team contains its representative. For each decoding query, we use each representative score and team size to estimate the team's attention mass, then sample teams according to these estimates. We then read the selected teams' keys and values and evaluate every selected member's exact query-key score. Newly generated tokens form a separate suffix evaluated exactly. SANTA constructs the exact attention distribution by scoring every cached key, then samples from that distribution (Lee et al., 2026). In the limiting case where every key forms its own team, each representative is the key itself, and SANTA++ recovers this exact-attention sampling distribution.

SANTA++ can therefore be viewed as a grouped generalization of SANTA, replacing the full-key scan with approximate routing to enable substantially lower KV access.

Once, after prefill

Build teams

Choose representatives

within each parent, then

assign members to teams.

Figure

Decode

Score representatives

Read one key per team

to guide sampling.

Sample and read

Read sampled K,V,

then compute exact scores.

Reweight and combine

Divide each team's mass and

weighted value sum by its

conditional inclusion probability.

Teams and representatives

Representative scores (few key reads)

Sampled teams S

Attention estimate

Figure 1: Representative-guided attention sampling. After prefill, parent groups cover the prompt, and actual member keys represent the teams built within each parent. For each decoding query, we form a routing weight for each team from its representative score and team size, and use these weights to sample teams S. Selected teams' keys and values are read in full, and their members' exact attention contributions are computed. Each team's unnormalized attention mass and weighted value sum are divided by its conditional inclusion probability cgc_g before the corrected sums are combined and normalized (Section 2).

Actual-key representatives avoid relying on a group’s exponentiated mean-key score to estimate its attention mass. Averaging logits before exponentiation can suppress a high-scoring member’s contribution. Representative scores guide selection, while exact member scores determine the selected teams’ contributions. Because teams have unequal chances of selection, we divide each selected team’s unnormalized attention mass and weighted value sum by its conditional inclusion probability before normalization (Section 2). This correction targets full-cache contributions rather than simply renormalizing an uncorrected selected subset.

The nominal budget S controls how many teams are selected, providing an adjustable accuracy–KV-access trade-off. Actual access also depends on team sizes, routing and suffix reads, and overlap across query heads. We form parent groups either with k-means or from contiguous token spans. K-means groups keys by similarity. Contiguous spans instead define parents directly from token positions, avoiding the k-means preparation step. Both use the same distance-based team construction, and every prompt team remains eligible for each query. For the Qwen2.5-7B-Instruct evaluations below, we fix the nominal parent size to P = 16 and use up to R = 4 representatives per parent. These values were chosen heuristically and kept fixed across benchmarks, budgets, and the k-means and contiguous grouping policies.

Our evaluation with Qwen2.5-7B-Instruct at 32K context shows that SANTA++ can retain most of dense attention's accuracy while reading much less of the KV cache. On LongBench v2 (Bai et al., 2025), it retains 99.07% of the dense baseline's score while using 16.68% of its KV reads. On HEL-MET's retrieval-augmented generation subset (Yen et al., 2025), it retains 98.00% of the dense score at 38.49% KV access. On RULER (Hsieh et al., 2024), increasing the sampling budget raises the retained score from 91.07% to 98.54% while KV access increases from 19.95% to 46.95%. Contiguous grouping avoids the k-means preparation step and remains competitive in several settings, providing a simpler alternative when clustering cost matters.

Separately, our Triton implementation gives a 1.69×1.69\times attention-operator speedup over Flash SDPA on a 32K-context, batch-one, FP16 workload from layer 14 of Qwen2.5-7B-Instruct on an NVIDIA GeForce RTX 5090 Laptop GPU (Section 4). The comparison uses 31 sampled teams per query head (nominal budget S=124S = 124), an implementation-specific setting described in Section 4. Appendix F tests the method's applicability to Multi-Head Latent Attention (MLA), and whether useful token sparsity remains in DeepSeek-V2-Lite-Chat after latent compression and head sharing.