arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2410.03090cs.CLcs.LG
收藏

UNComp:矩阵熵能否揭示稀疏性?——一种从不确定性感知视角设计的压缩器

UNComp: Can Matrix Entropy Uncover Sparsity? -- A Compressor Design from an Uncertainty-Aware Perspective

The University of Hong Kong(香港大学);Nanjing University(南京大学);University College London(伦敦大学学院);The Ohio State University(俄亥俄州立大学);Microsoft Research Asia(微软亚洲研究院);The Chinese University of Hong Kong(香港中文大学);SIAT, Chinese Academy of Sciences(中国科学院深圳先进技术研究院);The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州))

Jing Xiong, Jianghan Shen, Fanghua Ye, Chaofan Tao, Zhongwei Wan, Jianqiao Lu, Xun Wu, Chuanyang Zheng, Zhijiang Guo, Min Yang, Lingpeng Kong, Ngai Wong

AI总结:

针对长上下文推理中KV缓存压缩忽视结构化稀疏性的问题,提出基于截断矩阵熵的不确定性感知压缩框架UNComp,动态识别稀疏模式,将缓存降至4.74%,吞吐量提升6.4倍。

摘要:

部署大型语言模型(LLM)进行长上下文推理仍然具有挑战性,因为其需要大量的内存和计算资源。尽管诸如键值(KV)缓存压缩等技术旨在减少内存使用,但它们常常忽略了隐藏状态与其对应KV缓存之间关系中固有的结构化稀疏性。在这项工作中,我们探讨了不确定性作为LLM内部稀疏性潜在指标的作用。我们提出了UNComp,一个利用截断矩阵熵来识别低信息内容区域的不确定性感知框架,从而揭示可用于自适应压缩的稀疏模式。与传统方法采用统一压缩不同,UNComp根据反映不同模型组件重要性的不确定性度量,动态调整其压缩策略。我们的分析表明,从不确定性估计中得出的稀疏模式可以被利用来揭示特殊的长距离依赖关系,例如检索头和检索层。这一视角不仅增强了我们对如何优化压缩的理解,也为长上下文推理中LLM固有的稀疏性提供了新的见解。通过聚焦不确定性来详细分析稀疏模式,UNComp将KV缓存大小减少到原始的4.74%,实现了6%的预填充加速,并将吞吐量提高了6.4倍——不仅提供了强大的无损压缩性能,还验证了底层理论工具的有效性。我们在https://github.com/menik1126/UNComp发布了代码。

英文摘要:

Deploying large language models (LLMs) for long-context inference remains challenging due to their substantial memory and computational demands. While techniques such as Key-Value (KV) cache compression are designed to reduce memory usage, they often neglect the structured sparsity inherent in the relationship between hidden states and their corresponding KV cache. In this work, we explore the role of uncertainty as a potential indicator of sparsity within LLMs. We propose UNComp, an uncertainty-aware framework that leverages truncated matrix entropy to identify areas of low information content, thereby revealing sparsity patterns that can be used for adaptive compression. Unlike traditional methods that apply uniform compression, UNComp dynamically adjusts its approach to compression, guided by uncertainty measures that reflect the importance of various model components. Our analysis shows that sparsity patterns, when derived from uncertainty estimates, can be exploited to reveal special long-range dependencies, such as retrieval heads and retrieval layers. This perspective not only enhances our understanding of how compression can be optimized but also provides new insights into the inherent sparsity of LLMs during long-context inference. By focusing on uncertainty to analyze the sparsity pattern in detail, UNComp reduces the KV cache size to 4.74% of the original, achieves a 6% prefill speedup, and improves throughput by 6.4x - not only delivering strong lossless compression performance, but also validating the effectiveness of the underlying theoretical tool. We release the code at https://github.com/menik1126/UNComp.

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

↑