Random Attention: Rethinking KV Cache Eviction for Efficient Reasoning
作者: Heng Wang, Jielin Qiu, Wenting Zhao, Cheng Qian, Liangwei Yang, Jiawei Han, Heng Ji, Silvio Savarese, Shelby Heinecke, Huan Wang
分类: cs.CL
发布日期: 2026-09-03
🔗 代码/项目: GITHUB
💡 一句话要点
提出随机注意力机制以解决KV缓存驱逐效率问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 KV缓存 推理效率 随机注意力 内存管理 自然语言处理 性能提升
📋 核心要点
- 现有KV缓存压缩方法依赖于评分机制,导致在推理过程中存在内存瓶颈和效率低下的问题。
- 随机注意力机制通过在每个注意力头中随机驱逐令牌,避免了评分计算,从而提高了缓存的使用效率。
- 实验结果显示,随机注意力机制在多个模型和任务上实现了显著的吞吐量提升,证明了其有效性。
📝 摘要(中文)
大型语言模型在需要扩展推理的任务中表现优异,但长链思维使得KV缓存成为严重的内存瓶颈。现有的KV缓存压缩方法通常通过评估每个缓存令牌的重要性来选择保留的令牌。本文提出的随机注意力机制在每个注意力头中随机驱逐令牌,而不计算任何评分。通过在四个模型和六个推理任务上的实验,随机注意力机制在vLLM部署中实现了32-43%的更高吞吐量,且与最强的现有驱逐方法相匹配。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在推理过程中KV缓存的驱逐效率问题。现有方法依赖于评分机制,导致内存瓶颈和性能下降。
核心思路:随机注意力机制通过在每个注意力头中随机选择驱逐令牌,而不计算评分,认为选择信号对性能贡献有限。这样设计是为了简化计算并提高效率。
技术框架:整体架构包括输入提示、KV缓存和注意力头。每个注意力头独立进行随机驱逐,确保在驱逐过程中保留足够的信息。
关键创新:最重要的创新点在于随机驱逐策略的提出,打破了传统方法依赖评分的局限,展示了随机选择的有效性。
关键设计:在实现中,随机注意力机制不需要额外的评分计算,且通过冗余机制确保提示的安全性,从而在驱逐过程中保留必要的信息。具体参数设置和网络结构细节在代码中公开。
🖼️ 关键图片
📊 实验亮点
实验结果表明,随机注意力机制在四个模型和六个推理任务上实现了32-43%的吞吐量提升,且与最强的现有驱逐方法相当。这一结果展示了随机选择在缓存管理中的有效性,具有重要的应用前景。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理、对话系统和智能助手等。通过提高KV缓存的驱逐效率,随机注意力机制能够显著提升大型语言模型在复杂推理任务中的响应速度和处理能力,具有广泛的实际价值和未来影响。
📄 摘要(原文)
Large language models achieve superior performance on tasks that require extended reasoning, but long chains of thought make the KV cache a severe memory bottleneck. Existing KV cache compression methods share one paradigm: score each cached token by some estimate of how much it will matter later, and keep the top-scoring ones. We show that the selection signal contributes almost nothing. Random Attention keeps the prompt and evicts uniformly at random within each attention head, computing no score at all; across four models and six reasoning tasks it matches the strongest prior evictor while serving 32-43% higher throughput than it in vLLM deployment. Controlled experiments explain this by showing that 1) the prompt is the fragile part of the cache, and most of the gap between selectors is just whether their selection signal happened to keep it; 2) the reasoning trace protects itself against eviction with redundancy at two levels, in the text (the model restates what it still needs as it works) and across attention heads (each keeps its own copy of the trace), so once the prompt is safe, a random draw retains enough copies of what the model still needs, and no score is required to pick them. Our code is publicly available at https://github.com/SalesforceAIResearch/Random-Attention.