DuoAttention: Efficient Long-Context LLM Inference with Retrieval and Streaming Heads
Guangxuan Xiao, Jiaming Tang, Jingwei Zuo, Junxian Guo, Shang Yang, Haotian Tang, Yao Fu, Song Han
We identify two distinct types of attention heads in large language models: retrieval heads, which require access to the full KV cache to locate relevant tokens, and streaming heads, which only need a constant-size cache. DuoAttention exploits this asymmetry to significantly reduce memory usage and decoding latency for long-context inference, while preserving model accuracy.





