arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2401.09486cs.LGcs.CL

LoMA:无损压缩记忆注意力

LoMA: Lossless Compressed Memory Attention

Deepglint Inc.(深格灵公司);Peking University(北京大学)

Yumeng Wang, Zhenyang Xiao

AI总结:

LoMA通过训练与生成算法实现KV缓存无损压缩,在单次推理中降低长上下文LLM的内存与计算开销。

摘要:

大型语言模型(LLMs)在处理长上下文时,由于对GPU内存和计算资源的高需求而面临限制。虽然将Transformer模型的键值(KV)缓存稀疏化是缓解资源使用的典型策略,但这不可避免地导致信息丢失。我们引入了无损压缩记忆注意力(LoMA),这是一种新颖的方法,能够实现KV缓存的无损压缩,从而减少自回归生成过程中的内存和计算需求。LoMA结合了专门的训练或微调流程以及针对压缩上下文优化的自回归生成算法。我们的方法在每生成$tc$个token后,以压缩比$c$和目标压缩长度$t$压缩KV缓存,并且这一过程在单次推理过程中完成,不依赖辅助模型。我们设计了一种高效的训练方案,涉及特定的输入、注意力掩码和位置标识符,以灌输这种压缩能力。实验验证表明,LoMA通过实现无损KV缓存压缩,显著降低了计算消耗和内存使用。

英文摘要:

Large Language Models (LLMs) face limitations due to the high demand on GPU memory and computational resources when handling long contexts. While sparsify the Key-Value (KV) cache of transformer model is a typical strategy to alleviate resource usage, it unavoidably results in the loss of information. We introduce Lossless Compressed Memory Attention (LoMA), a novel approach that enables lossless compression of the KV cache, thereby reducing the memory and computational demands during autoregressive generation. LoMA incorporates a specialized training or fine-tuning precedure alongside an autoregressive generation algorithm optimized for the compressed context. Our method compresses the KV cache after every $tc$ generated tokens with a compression ratio of $c$ and a target compressed length $t$, and this process occurs within a single inference pass without dependency on auxiliary models. We engineered an efficient training scheme involving specific inputs, attention masks, and position identifiers to instill this compression capability. Experimental validation has demonstrated that LoMA significantly reducing computational consumption and memory usage through achieving lossless KV cache compression.

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

↑