Search papers, labs, and topics across Lattice.
This paper introduces Simplified Sparse Attention (SSA), a novel method that enhances long-context inference without requiring architectural changes. By interleaving gist tokens during continued pretraining and optimizing the attention mechanism to focus on these tokens, SSA effectively reduces memory-bandwidth costs associated with traditional sparse attention methods. The results demonstrate that SSA outperforms existing compression and sparse-attention baselines on LongBench, and even surpasses full attention in retrieval-augmented generation tasks by over 5.7 points, showcasing its efficiency and effectiveness in filtering relevant information.
SSA achieves superior long-context inference by leveraging gist tokens, outperforming traditional attention mechanisms without the need for complex architectural modifications.
Sparse attention can reduce the cost of long-context inference, but most variants introduce new architectural components. We introduce Simplified Sparse Attention (SSA), a simpler approach to sparse attention that requires no architectural changes. Concretely, we first perform continued pretraining on sequences interleaved with gist tokens. We optimize the standard next-token loss as usual, but the gist tokens use an attention mask to restrict what parts of the context the language model can attend to; this teaches the model to pack each chunk's important information into the gist tokens. At inference time, SSA scores chunks via attention between the current query and the small set of gist tokens, selectively unfolding the top-k chunks by reintroducing their corresponding raw tokens. Since the query is scored only against the gist tokens, we avoid the memory-bandwidth cost associated with naive scoring against the full KV cache, without requiring the auxiliary KV cache approach used by sparse attention methods. On LongBench, SSA consistently outperforms compression and inference-time sparse-attention baselines under the same compression ratio. More strikingly, in retrieval-augmented generation, SSA can even outperform full attention after continued pretraining by over 5.7 points. We attribute this to the ability of SSA's selective unfolding, which concentrates attention on the query-relevant chunks and effectively filters out noise. SSA further extends to a hierarchical gist-of-gist variant (H-SSA) that achieves log-linear decoding complexity while maintaining or improving accuracy at high compression ratios up to 32x. The code is available at https://github.com/yuzhenmao/simplified-sparse-attention/.