Efficient Streaming Language Models with Attention Sinks
Guangxuan XiaoYuandong TianBeidi ChenSong HanMike Lewis
Introduces StreamingLLM, an efficient framework that exploits the attention sink phenomenon to enable pre-trained large language models to generalize to infinite sequence lengths without fine-tuning while achieving up to a 22.2x speedup over sliding-window recomputation.
Deploying large language models in continuous, streaming environments like multi-round chatbots faces significant technical hurdles. Standard architectures cache all past tokens during generation, which leads to excessive memory consumption and latency. Meanwhile, standard models degrade sharply when conversations exceed their fixed training window, and basic sliding-window approaches collapse completely once the very first tokens are discarded.
The article demonstrates why standard sliding-window attention fails and evaluates whether large language models can handle infinite input streams without fine-tuning or performance degradation.
The researchers analyzed attention score distributions across multiple model families, including Llama-2, MPT, Falcon, and Pythia. They discovered that transformer attention mechanisms disproportionately concentrate high numerical scores on the initial sequence tokens, creating an effect termed attention sinks. Building on this discovery, the authors evaluated StreamingLLM, an inference framework combining initial sink tokens with a rolling cache of recent tokens, across synthetic benchmarks, question-answering tasks, and text sequences reaching 4 million tokens.
The analysis produced several critical findings. First, retaining as few as four initial sink tokens alongside recent context fully restores model stability without fine-tuning, whereas discarding them causes severe performance collapse. Second, StreamingLLM enabled stable language modeling on sequences exceeding 4 million tokens across four major model families. Third, the framework delivered up to a 22.2-fold decoding speedup compared to sliding window recomputation baselines while maintaining identical memory usage. Finally, pre-training models from scratch with a single designated placeholder token completely eliminated the need to retain multiple initial tokens during streaming inference.
These findings indicate that existing language models can be deployed in persistent, low-latency streaming applications without costly retraining or architectural redesigns. Decoupling sequence length from pre-training window limits directly reduces infrastructure costs and enables reliable 24/7 conversational agents.
Organizations deploying streaming language models should adopt attention-sink caching strategies to improve throughput and reduce memory overhead. Additionally, teams pre-training new base models should incorporate a dedicated placeholder token at the start of training sequences to optimize downstream streaming performance.
A key limitation is that StreamingLLM preserves stability over recent contexts but does not extend long-term memory. Tasks requiring comprehensive retrieval over distant historical inputs still require specialized external memory or retrieval systems. The reported results are backed by high empirical confidence across multiple model scales and standard benchmarks.
- Paper: Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation, Ofir Press et al. (2022). Understanding Attention with Linear Biases (ALiBi) provides the foundational context for length extrapolation techniques built upon by streaming language models.
- Paper: Transformer-XL: Attentive Language Models beyond a Fixed-Length Context, Zihang Dai et al. (2019). Transformer-XL introduces caching and reusing hidden states across segments, which is foundational for understanding memory persistence in long-context models.
- Paper: SARATHI: Efficient LLM Inference by Piggybacking Decodes with Chunked Prefills, Amey Agrawal et al. (2023). SARATHI analyzes the trade-offs between prefill and decode stages during LLM inference, establishing core optimization concepts for streaming execution.
- Paper: Efficient Memory Management for Large Language Model Serving with PagedAttention, Woosuk Kwon et al. (2023). PagedAttention details how key-value cache memory management bottlenecks high-throughput language model serving.
- Paper: Kascade: A Practical Sparse Attention Method for Long-Context LLM Inference, Dhruv Deshmukh et al. (2025). Kascade extends the attention sink principle by approximating sparse attention across anchor layers to accelerate long-context LLM inference.
- Paper: LongCat Sparse Attention: Taming the Lightning via Streaming-aware Hierarchical Cross-Layer Indexing, Wen Zan et al. (2026). LongCat Sparse Attention generalizes streaming-aware indexing and hierarchical cross-layer methods to handle million-token sequences efficiently.
- Paper: Sliding-window beats linear attention, Alexia Jolicoeur-Martineau et al. (2026). This text builds directly on attention sinks and sliding-window mechanics, providing a comparative evaluation against linear attention methods.
- Paper: QJL: 1-Bit Quantized JL Transform for KV Cache Quantization with Zero Overhead, Amir Zandieh et al. (2025). QJL applies 1-bit quantization to the KV cache, extending memory-efficient inference for long-context models without overhead.
- Paper: PolarQuant: Quantizing KV Caches with Polar Transformation, Insu Han et al. (2025). PolarQuant continues the pursuit of efficient KV cache management by introducing polar coordinate transformations for deep compression.
- Paper: A Probabilistic Interpretation of KV Cache Eviction, Renato Geh et al. (2026). This book provides a formal probabilistic interpretation and complexity analysis of KV cache eviction strategies.
