The Indexer Becomes the New Bottleneck in 10M-Token LLM Inference
As context windows grow to ten million tokens, sparse attention shifts cost from attention computation to candidate selection. This article examines why the indexer can become the new bottleneck, how latent-space sparse attention aims to reduce indexing complexity, what the reported speedup and memory numbers do and do not show, and what teams should validate before production use.
When Context Grows Long, Attention Is No Longer the Only Cost
As large language model context windows move from one million tokens toward ten million tokens, the distribution of compute cost changes. In standard full attention, every query computes relevance against all historical keys. During prefill, compute grows as T² with context length T. A 10x increase in context increases attention compute by roughly 100x. This is not only a numerical burden; it also constrains architecture design.
Sparse attention was proposed to alleviate this problem. The idea is that each query only needs to attend to the k most relevant keys rather than the full history. The model first uses a lightweight indexer to select candidate keys for each query, then performs attention only over those keys. Attention compute therefore drops to O(Tk), which is linear in T when k is fixed.
The Bottleneck Can Move from Attention to the Indexer
The problem is that the cost saved by attention can be offset by the indexer. Using the global attention layers of a mainstream open-source model family as an example, the source material states that during prefill at the 10M-token scale, nearly 98% of time is spent in the indexer rather than in attention computation itself. In other words, sparsification reduces attention overhead but creates new overhead in the indexing stage.
Such indexers typically must score and rank all candidate keys to decide which keys are worth attending to. The scoring cost grows as T² with context length. At shorter contexts, this cost is acceptable. At the ten-million-token scale, it exceeds the already linearized attention computation.
This indicates that continuing to optimize attention kernels has limited returns. For ultra-long contexts to become practical, the indexer itself also needs lower complexity.
Why Sparse Selection Can Still Preserve Accuracy
Sparse attention relies on the premise that a model usually needs only a small amount of key information to produce an accurate answer. The source material gives an example: in a 128k-context test, each query attends to only the 512 most relevant keys, about 0.4% of all keys. On the cited long-context benchmarks, the result is about 98% of the full-attention approach. The specific benchmark names should be checked in the original report.
This result suggests that selective attention itself does not necessarily cause accuracy loss. The difficulty is efficiently finding that small subset of keys.
The Latent-Space Sparse Attention Approach
The source material describes a latent-space sparse attention approach. Here, latent space refers to a lower-dimensional representation space. The core idea is to first train a set of lightweight low-rank projections that map keys and queries into a latent space with significantly lower dimensionality, then perform candidate selection in the compressed representation.
With lower dimensionality, the compute and memory access for each scoring operation are reduced. The source material also mentions that the key table in latent space can be precomputed and organized into a clustered index. Each query then only needs to search near a small number of cluster centers, further narrowing the candidate range. According to the original description, this index has sub-quadratic complexity, meaning it grows more slowly than T². The specific complexity derivation and implementation details should be checked in the original paper, because the approximation error of low-rank projections and the parameters of cluster search both affect results.
The table below compares the three approaches across key dimensions:
| Approach | Attention compute | Candidate selection (indexing) | Main risk |
|---|---|---|---|
| Full attention | O(T²) | None | Compute too large at long context |
| Sparse attention (full-scoring indexer) | O(Tk) | O(T²) | Indexer becomes the new bottleneck |
| Latent-space sparse attention | O(Tk) | Sub-quadratic per source | Projection error, training cost, implementation complexity |
How to Read the Reported Numbers
The source material provides several performance figures: for a single attention layer doing prefill at 10M tokens, about 22.7x speedup; on another mid-size open-source model, about 72.4x; and KV cache memory usage reduced by about one order of magnitude.
These figures are useful references, but the information is incomplete. The material does not provide model size, batch size, hardware model, numerical precision, or comparison baseline, nor does it state whether the numbers come from single-layer or end-to-end measurements. Therefore, the 22.7x and 72.4x figures should be understood as single-layer prefill speedups and cannot be directly generalized to end-to-end speedup for an entire inference service. The memory reduction also needs to be rechecked under explicit configurations.
Three Directions for Further Research
The first is adaptive sparsity rate. This direction lets each query decide how many keys to attend to based on context complexity: attend to fewer when information is concentrated, and more when information is dispersed. The difficulty is finding a reliable signal for when to increase the number of candidates. There is no unified standard yet.
The second is multi-level indexing. First coarsely filter candidate blocks in a low-dimensional space, then perform fine selection within blocks, forming a tree structure. This can further reduce search cost, but filtering errors at each level accumulate, so recall needs to be measured separately.
The third is hybrid sparse and dense routing. Some tasks, such as full-document summarization, require global information to answer correctly. A classifier can be added beside the indexer to determine whether a query takes the sparse path or the full-attention path. Misclassification rates directly affect final results.
In priority order, hybrid routing offers the most direct benefit because it protects queries that require global information. Adaptive sparsity rate depends on signal quality and is better attempted after sufficient validation data is available.
What to Validate Before Deployment
Before practical adoption, the following validation is recommended:
- Using the same model, same batch, and same hardware, measure single-layer latency and end-to-end latency for full attention, sparse attention, and latent-space sparse attention separately.
- Compare accuracy on your own long-context evaluation set, not only on benchmarks from papers.
- Continuously monitor accuracy regressions, especially for tasks that depend on global information, such as document summarization and multi-hop reasoning.
- Account for the training and maintenance cost of low-rank projections. Projections usually need to be retrained or calibrated as the model is updated.
- Measure cross-node communication in distributed environments and verify the source material’s claims about communication reduction.
Conclusion
Latent-space indexing offers a direction worth validating for ultra-long-context inference: reducing candidate-selection complexity to sub-quadratic could create room to lower the cost of ten-million-token inference. However, the measurement conditions in the available material are incomplete. Speed and accuracy conclusions still need to be re-measured on your own models and data before they can be used in production.
