arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.05646cs.LGcs.AIcs.CL
收藏

Eigen Attention:低秩空间中的注意力用于KV缓存压缩

Eigen Attention: Attention in Low-Rank Space for KV Cache Compression

Purdue University(普渡大学)

Utkarsh Saxena, Gobinda Saha, Sakshi Choudhary, Kaushik Roy

AI总结:

提出Eigen Attention,在低秩空间进行注意力操作以压缩KV缓存,与现有技术兼容,在OPT、MPT、Llama上实现缓存大小减40%、延迟减60%,性能损失小。

摘要:

大型语言模型(LLMs)因其出色的推理能力,代表了自然语言处理领域的一项突破性进展。近期,人们对于增加这些模型的上下文长度以增强其在复杂任务中的适用性产生了相当大的兴趣。然而,在长上下文长度和大批量处理时,存储注意力键和值的键值(KV)缓存,在推理过程中成为内存使用的新瓶颈。为了解决这一问题,我们提出了Eigen Attention,它在低秩空间中执行注意力操作,从而减少KV缓存的内存开销。我们提出的方法独立于现有的KV缓存压缩技术,并可与它们协同使用。通过在OPT、MPT和Llama模型系列上的广泛实验,我们证明Eigen Attention在性能下降极小的情况下,可将KV缓存大小减少高达40%,注意力操作延迟减少高达60%。代码可在https://github.com/UtkarshSaxena1/EigenAttn获取。

英文摘要:

Large language models (LLMs) represent a groundbreaking advancement in the domain of natural language processing due to their impressive reasoning abilities. Recently, there has been considerable interest in increasing the context lengths for these models to enhance their applicability to complex tasks. However, at long context lengths and large batch sizes, the key-value (KV) cache, which stores the attention keys and values, emerges as the new bottleneck in memory usage during inference. To address this, we propose Eigen Attention, which performs the attention operation in a low-rank space, thereby reducing the KV cache memory overhead. Our proposed approach is orthogonal to existing KV cache compression techniques and can be used synergistically with them. Through extensive experiments over OPT, MPT, and Llama model families, we demonstrate that Eigen Attention results in up to 40% reduction in KV cache sizes and up to 60% reduction in attention operation latency with minimal drop in performance. Code is available at https://github.com/UtkarshSaxena1/EigenAttn.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑