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

利用矩阵分解释放用于 KV Cache 压缩的无数据低比特量化潜力

Unlocking Data-free Low-bit Quantization with Matrix Decomposition for KV Cache Compression

School of Information Technology and Management, University of International Business and Economics(对外经济贸易大学信息技术与管理学院);Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院);Huawei Technologies Co., Ltd.(华为技术有限公司);School of Information, Renmin University of China(中国人民大学信息学院)

Peiyu Liu, Ze-Feng Gao, Wayne Xin Zhao, Yipeng Ma, Tao Wang, Ji-Rong Wen

AI总结:

本文提出无数据低比特量化方法 DecoQuant,通过张量分解分离异常值并差异化量化 KV cache,配合专用反量化内核,在保持生成质量的同时最多降低约 75% 内存占用。

摘要:

键值(KV)缓存是加速大语言模型(LLM)推理的一项重要技术,但会带来显著的内存开销。为了压缩 KV cache 的大小,现有方法往往会牺牲精度,或需要额外数据进行校准,从而限制了它们在 LLM 部署中的实用性。本文提出 DecoQuant,这是一种基于张量分解方法的新型无数据低比特量化技术,用于有效压缩 KV cache。其核心思想是通过执行张量分解来调整原始矩阵的异常值分布,从而将量化难点从矩阵迁移到分解后的局部张量。特别地,我们发现异常值主要集中在较小的局部张量上,而较大张量往往具有更窄的取值范围。基于这一发现,我们建议对大张量应用低比特量化,同时对小张量保持高精度表示。此外,我们利用所提出的量化方法压缩 LLM 的 KV cache 以加速推理,并开发了专门为 DecoQuant 定制的高效反量化内核。通过大量实验,DecoQuant 展现出显著的效率提升:在保持相当生成质量的同时,内存占用最多减少约 75%。

英文摘要:

Key-value~(KV) caching is an important technique to accelerate the inference of large language models~(LLMs), but incurs significant memory overhead. To compress the size of KV cache, existing methods often compromise precision or require extra data for calibration, limiting their practicality in LLM deployment. In this paper, we introduce \textbf{DecoQuant}, a novel data-free low-bit quantization technique based on tensor decomposition methods, to effectively compress KV cache. Our core idea is to adjust the outlier distribution of the original matrix by performing tensor decomposition, so that the quantization difficulties are migrated from the matrix to decomposed local tensors. Specially, we find that outliers mainly concentrate on small local tensors, while large tensors tend to have a narrower value range. Based on this finding, we propose to apply low-bit quantization to the large tensor, while maintaining high-precision representation for the small tensor. Furthermore, we utilize the proposed quantization method to compress the KV cache of LLMs to accelerate the inference and develop an efficient dequantization kernel tailored specifically for DecoQuant. Through extensive experiments, DecoQuant demonstrates remarkable efficiency gains, showcasing up to a $\sim$75\% reduction in memory footprint while maintaining comparable generation quality.

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

↑