Overcoming the 10M Token Bottleneck: How Latent Sparse Attention Achieves a 22x Speedup
As large language models push context windows toward 10 million tokens, the performance bottleneck has shifted from attention computation to the token retrieval process. Traditional sparse attention relies on scoring mechanisms that scale quadratically with context length. Latent Sparse Attention (LSA) addresses this by moving the retrieval process into a compressed low-dimensional latent space, using structured indexing to break the quadratic growth barrier. This approach yields up to a 22.7x speedup in prefilling for certain models while maintaining accuracy, highlighting a shift toward a "low-dimensional retrieval, high-dimensional computation" paradigm in next-generation long-context infrastructure.
The Hidden Bottleneck in the Era of Ultra-Long Contexts
Over the past year, the race for long-context capabilities has accelerated significantly. Several leading LLM providers have set 1 million (1M) token context windows as the default specification for their official services, and some next-generation models have introduced hybrid architectures combining sparse and linear attention. These technical paths share a common choice: instead of letting each query attend to all historical tokens, they select only a small subset of the most relevant tokens to process.
This approach has been repeatedly validated at the 1M token scale. As long as the selected tokens are sufficiently relevant, sparsification barely sacrifices accuracy while drastically reducing attention computation. However, when the context expands toward 10 million (10M) tokens, a previously negligible cost begins to spiral out of control.
Take a typical global attention layer as an example. When performing prefill at 10M tokens, approximately 98% of the time is not spent on the attention computation itself, but rather on the indexer—the mechanism that decides which tokens to attend to. In other words, while sparse attention has proven that “looking at a small subset” is enough to preserve accuracy, what actually restricts ultra-long context is the act of “finding that small subset,” which still scales quadratically with context length. The nature of the problem has fundamentally changed.
Why the Indexer is More Expensive Than Attention
To understand this bottleneck, we need to break down the workflow of mainstream sparse attention solutions. Whether filtering by block or by token, the typical process involves two steps:
- Scoring and Filtering: For each query, a lightweight scoring mechanism evaluates its relevance against all historical tokens (or token blocks) and selects the Top-K.
- Sparse Calculation: Full attention computation is performed only on the selected K tokens.
The complexity of step two is O(n×K), which scales linearly with n when K is fixed, making it controllable. However, the scoring process in step one inherently requires evaluating all n historical tokens one by one. If the scoring relies on token-by-token similarity calculation, the complexity is O(n²)—the same order of magnitude as full attention. At a 1M token context, the overhead is acceptable because techniques like low-dimensional projection and quantization keep the constant factors small. But at 10M tokens, the n² term completely overwhelms the constant factor advantages, making the indexer the dominant cost.
This explains why continuing to optimize attention kernels yields diminishing returns in ultra-long context scenarios—the optimization target is wrong.
Latent Sparse Attention: Moving Retrieval into Low-Dimensional Space
A recent paper co-authored by a European startup and university researchers proposed a new method called Latent Sparse Attention (LSA) to directly address this issue. Its core idea can be summarized in one sentence: Not only must the attention computation be sparse, but the process of “finding relevant tokens” must also be completed in a compressed latent space, eliminating token-by-token comparison.
Its technical path includes several key designs:
First, latent space compressed representation. Instead of performing relevance scoring directly in the original hidden state dimensions, the key representations of historical tokens are compressed into a latent space far below the original dimensionality. This low-dimensional representation preserves the semantic information needed to distinguish relevance while significantly reducing the computation and memory access costs of a single scoring operation.
Second, structured indexing replaces linear scanning. A fast-retrieval index structure is built on top of the latent space, so “finding the Top-K relevant tokens” no longer requires scoring all n tokens one by one. By leveraging an approximate nearest neighbor (ANN) retrieval approach, the retrieval complexity is effectively reduced from O(n²) to near O(n log n) or lower. This is the critical step in breaking the quadratic growth barrier.
Third, decoupling from the attention backbone. The latent space retrieval module exists as an independent component. During training, distillation or joint optimization aligns the low-dimensional scoring with the true high-dimensional attention distribution. This ensures that the Top-K selected in the low-dimensional space highly overlaps with the genuinely important Top-K in the high-dimensional space, thereby safeguarding accuracy.
In terms of results, this method accelerated the prefill of a single global attention layer in a mainstream LLM by approximately 22.7x at 10M tokens. It achieved a 72.4x speedup on another larger open-source model, all while maintaining accuracy comparable to the original model across a series of long-context tasks.
Why the Speedup Varies Across Models
The difference between the 22.7x and 72.4x figures is itself telling. The proportion of indexer overhead in total prefill time depends on the implementation and dimensionality settings of the indexer in the original model’s sparse solution. The heavier the indexer and the higher the scoring dimensions, the more room LSA unlocks upon replacement. This offers a clear insight for engineering teams: when evaluating long-context acceleration solutions, profiling must be done first to confirm whether time is actually spent on scoring, retrieval, or the attention kernel, otherwise, optimization efforts will likely miss the target.
Implications for Engineering Implementation
For teams dealing with ultra-long documents, codebase-level analysis, or massive log attribution, this research provides several actionable takeaways:
- Bottleneck shifting is inevitable. As sparse attention becomes standard, performance bottlenecks will continuously migrate from “computation” to “retrieval” and eventually to “storage and movement.” Architecture designs should treat index structures as first-class citizens early on.
- The separation of low-dimensional retrieval and high-precision computation is a general paradigm worth adopting: use cheap representations for coarse filtering and expensive representations for fine calculation. This concept is equally applicable to adjacent fields like RAG and vector retrieval.
- Accuracy verification cannot be omitted. The alignment quality between latent space scoring and the true attention distribution determines whether sparsification will silently degrade performance. Long-context benchmarks should be incorporated into routine regression testing.
Conclusion
As context windows push toward 10 million tokens, the focus of competition has shifted from “can you see everything” to “can you quickly find what you should see.” Latent Sparse Attention breaks the quadratic growth curse of indexing overhead by moving the retrieval process itself into a low-dimensional latent space, achieving order-of-magnitude prefill acceleration. It is foreseeable that the layered architecture of “low-dimensional coarse filtering + high-dimensional fine calculation” will become a critical design principle for next-generation ultra-long context infrastructure.
