Latent Sparse Attention Speeds Up 10M-Token AI Contexts by 9x
Latent Sparse Attention (LSA) from Prefrontal AI and ETH Zurich clusters keys to speed long-context LLM inference, cutting 10M-token time to first token by over 9 times
- Researchers from Prefrontal AI and ETH Zurich developed
Latent Sparse Attention (LSA), which in 10-million-token tasks cut time to first token by over9xversus full attention and2.2xversus a popular sparse attention baseline. - In a 10-million-token experiment using
GLM-5.3-Flash(aDeepSeek Sparse Attentionvariant), the indexer's key-selection step consumed98%of an attention layer's prefill time, highlighting the search bottleneck LSA addresses. - On an
NVIDIA H200at 10 million tokens,D-LSAsped up oneGLMattention layer's prefill by22.7xand decoding by4.6x, whileQwen-3.8-27Bprefill was72.4xfaster than full attention. - Across eight
H200GPUs in end-to-end serving,GLM's time to first token improved by2.2xand time per output token by2.1x, whileQwen's time to first token improved by9.2x; on theRULERbenchmark,Qwenscored63.9versus59.9for full attention at 10 million tokens. - Testing
N-LSAon a500-million-parameterhybrid model trained up to128,000tokens showed matched validation loss versus full attention, with training1.6xfaster per attention layer and1.24xfaster end to end, and code released under theApache 2.0license.
AI agents are getting better at working on tasks that span hours and involve entire codebases, document libraries, and long histories of interactions.
But the longer they work, the more expensive it becomes for the underlying models to process their growing context. Even sparse attention, designed to reduce this cost, has scaling problems of its own.
Researchers have developed Latent Sparse Attention (LSA), a technique that could make million-token contexts much more practical. Today, we examine the results, the tradeoffs, and what developers can already test.
How latent sparse attention tackles the search bottleneck in long-context AI
AI agents (particularly coding agents) accumulate millions of tokens of context as they work with large code repositories and document libraries. At that scale, handling the attention values of the underlying model becomes tedious and expensive.
To address this bottleneck, researchers at Prefrontal AI and ETH Zurich have developed Latent Sparse Attention (LSA), a new technique that cuts the compute costs of processing long contexts in LLMs.
LSA is among a growing range of techniques for optimizing the attention mechanism in LLMs. However, it addresses a bottleneck in other sparse attention methods, which limits how many previous tokens a model examines.
LSA organizes attention values into clusters and groups to make it easier to search through them when mapping new queries. For example, in experiments on 10-million-token tasks, it reduced time to first token by more than 9 times a full-attention model and 2.2 times against a model using a popular sparse attention mechanism.
For developers building long-running agents and LLM applications that process large contexts, LSA offers a way to reduce inference latency.
Don't miss what's next in AI
Join 300,000+ engineers and researchers who get the signal, not the noise. Create a free account to read the rest of this story.
- Full access to in-depth AI research breakdowns
- Be the first to know what's trending before it hits mainstream
- Daily curated papers, repos, and industry moves