Microsoft's CLSA Slashes Long-Context AI Decoding by 7.6x With One Trick
Microsoft Research's CLSA architecture computes sparse attention routing once and shares it across all decoder layers, hitting 17.1x throughput gains at 128K context with near-zero quality loss.
ProTakeaways
- CLSA computes sparse top-k attention routing once per forward pass and shares the result across all cross-decoder layers, eliminating redundant per-layer routing overhead.
- Built on YOCO's decoder-decoder architecture, CLSA inherits its KV cache memory savings and prefill speedups while adding a new decoding speedup.
- At 128K context on NVIDIA B200 GPUs, CLSA achieves 7.6x decoding speedup and 17.1x overall throughput vs. a standard Transformer baseline.
- Quality is nearly lossless: CLSA matches or beats dense baselines on ARC-Challenge, GSM8K, DROP, and HumanEval at 4B scale.
- A two-stage distillation training process teaches the shared indexer to identify tokens that are consensually important across all decoder layers.
- No code or model weights have been publicly released; the paper is from Microsoft Research and Tsinghua University.
Long-context inference is quietly becoming one of the most expensive problems in production AI. As reasoning models like o1 and DeepSeek-R1 generate thousands of tokens of intermediate chain-of-thought before producing an answer, the cost of attending over a growing KV cache at every single layer compounds fast. A team from Microsoft Research and Tsinghua University has now published a paper proposing a surprisingly clean fix: compute the expensive routing step once, and reuse it everywhere.
The work, titled "You Only Index Once: Cross-Layer Sparse Attention with Shared Routing" (CLSA), tackles a bottleneck that has quietly undermined most prior sparse attention approaches. The result is a 4B-parameter architecture that achieves 7.6x decoding speedup and 17.1x overall throughput improvement at 128K context, while matching dense attention on nearly every quality benchmark.
The problem no one fully solved
Sparse attention -- the idea of having each token only attend to a small, relevant subset of the KV cache instead of every prior token -- has been an active research area for years. But in practice, it has faced a stubborn tradeoff:
- Block-sparse methods (like NSA and MoBA) group tokens into chunks and attend to whole blocks at a time. They map well to GPU memory access patterns and deliver real wall-clock speedups, but the coarse granularity introduces quality loss -- nearby tokens in the same block can be semantically unrelated.
- Token-sparse methods (like DeepSeek-V3's DSA) select individual high-relevance tokens with fine-grained top-k routing. They preserve quality better, but the top-k operation itself is the problem. Top-k routing over the full cache remains expensive because it must be recomputed independently at every layer during decoding -- and top-k is poorly suited to GPU tensor cores, which thrive on dense matrix multiplications.
The result: token sparse methods are usually more accurate yet deliver limited end-to-end speedup because top-k routing over the full cache remains expensive. At 128K context, the paper's latency analysis shows that an unamortized top-k pass can take as long as substantial dense attention work, despite involving far fewer arithmetic operations.
The key insight: routing is memory-bound, not compute-bound
The CLSA paper builds on YOCO (You Only Cache Once), a prior architecture from the same Microsoft Research group. YOCO proposes a decoder-decoder architecture that only caches KV pairs once: a self-decoder utilizes efficient self-attention to obtain KV caches, and then a cross-decoder employs cross-attention to reuse those shared KV caches. This already cuts KV cache memory dramatically -- instead of each of L layers maintaining its own cache, only one shared cache exists for the entire cross-decoder stack.
CLSA's insight is that if multiple layers are already reading from the same KV cache, they should also be able to share the same routing decision about which tokens to attend to. The key observation is empirical: attention patterns across adjacent cross-decoder layers that share the same KV memory are highly similar. So a single routing index computed once is a good approximation for all of them.

How it works, step by step
The architecture splits a 32-layer model into 16 self-decoder layers and 16 cross-decoder layers. Here is what happens during a forward pass:
- Self-decoder runs first. It uses sliding-window attention (window size 512) to process the input and produces a single shared KV cache from the hidden states at the midpoint of the network.
- A lightweight indexer runs once. A single-head indexing branch projects the shared hidden states into index queries and keys (
Q_idx,K_idx), computes a score matrix, and runs top-k selection to produce a sparse indexS_t-- the set of token positions each query token should attend to. - All 16 cross-decoder layers reuse that index. Each cross-decoder layer has its own query projections and FFN, but they all attend only to the KV positions identified by the shared index. The expensive top-k step is paid exactly once.
The indexer is trained with a two-stage distillation process. In Stage 1, the backbone is frozen and the indexer learns to predict the average attention distribution across all layers and heads -- essentially learning which tokens are consensually important. In Stage 2, the full model is fine-tuned jointly with both language modeling loss and a KL-divergence distillation loss weighted at λ=0.1.
The numbers
All experiments compare three 4B-parameter models: a standard Transformer baseline, dense YOCO, and YOCO with CLSA. Inference is measured on NVIDIA B200 GPUs using a vLLM-based serving stack.

On throughput at 128K context, the raw numbers tell the story clearly:
| Context | Transformer (tok/s) | YOCO Dense (tok/s) | YOCO CLSA (tok/s) |
|---|---|---|---|
| 8K decode | 4,763 | 5,517 | 6,742 |
| 32K decode | 1,762 | 2,677 | 5,461 |
| 128K decode | 431 | 961 | 3,277 |
| 128K overall | 63 | 599 | 1,068 |
On quality, CLSA holds up well. YOCO (CLSA) obtains the best scores on ARC-Challenge, GSM8K, and DROP, and matches the best HumanEval result. On long-context RULER benchmarks, at 32K, where long-range interference becomes more pronounced, CLSA achieves the best average score among all models. The sparsity analysis is also reassuring: with 2048 selected tokens (a 1:16 activation ratio at 32K context), the routed set captures roughly 80% of the dense attention score mass, and the cross-entropy loss difference versus dense attention is around 0.006 or smaller across all domains tested.
Why this matters beyond the headline speedup
The real breakthrough here is not just the raw numbers -- it is that CLSA is the first architecture to simultaneously address all three major inference bottlenecks in long-context LLMs:
- KV cache memory: Inherited from YOCO's shared-cache design. Instead of O(L·N·D) memory, CLSA uses O((N + W₁·L)·D) -- roughly one cache instead of one per layer.
- Prefill speed: Also inherited from YOCO. By avoiding quadratic full-context attention in the self-decoder, prefill throughput at 128K reaches ~20,000 tok/s vs. ~1,000 tok/s for the standard Transformer.
- Decoding speed: The new contribution. By amortizing top-k routing across all 16 cross-decoder layers, the per-layer routing overhead drops to just 0.08ms at 128K context -- compared to a standalone top-k pass that can dominate total per-layer cost.
Prior approaches only solved one or two of these at a time. Pure dynamic sparse attention reduces the number of tokens read by each attention layer, but it still maintains a layer-wise KV cache and its decoding cost can be dominated by the indexer term, because token selection must be performed over the full cache and repeated across layers. CLSA's architecture makes the routing cost a one-time fixed overhead rather than a per-layer tax.
Limitations and what to watch for
A few caveats are worth noting. The experiments are conducted at 4B scale, and it remains to be seen how the shared-index assumption holds at larger model sizes where attention patterns may become more diverse across layers. The approach also requires training from scratch (or at minimum a two-stage sparse adaptation from a dense YOCO checkpoint) -- it cannot be directly applied as a post-hoc optimization to an existing standard Transformer. The indexer also introduces a fixed overhead that, while amortized, still costs ~0.08ms per layer at 128K; at shorter contexts this overhead is proportionally larger relative to the attention savings.
No code or pretrained model weights have been released alongside the paper at this time. The implementation was integrated into vLLM for benchmarking, but that build has not been made public. Given the Microsoft Research provenance and the team's track record with YOCO, a release seems plausible but is not confirmed.