提出分层非对称量化,实现KV缓存1比特压缩且性能不降
AsymKV: Enabling 1-Bit Quantization of KV Cache with Layer-Wise Asymmetric Quantization Configurations
- 针对键值缓存结构差异,为键和值矩阵设计不同量化配置
- 在多个数据集上实现75%解码层1比特量化,性能接近浮点模型
- 适合需要压缩大模型存储的部署场景,如边缘设备推理
大型语言模型在文本生成、视频生成等任务中表现卓越,但其庞大的参数量导致存储需求巨大,限制了部署。为缓解此问题,研究者提出用整数替代浮点数进行量化压缩。近期工作尝试对语言模型的键值缓存(KV Cache)进行量化,并采用对称策略处理键和值矩阵。本文深入分析了键值缓存的不对称结构特性,发现注意力输出误差对键矩阵量化更敏感。基于此,我们系统评估了键与值量化带来的注意力误差,并提出一种非对称量化策略:分别为键和值矩阵设置不同量化配置。该方法支持对键值缓存实现1比特量化。实验在多个数据集上验证,本方法可在保持性能的前提下,使高达75%的解码层实现1比特量化。
原文摘要 · Abstract (English)
Large language models have shown exceptional capabilities in a wide range of tasks, such as text generation and video generation, among others. However, due to their massive parameter count, these models often require substantial storage space, imposing significant constraints on the machines deploying LLMs. To overcome this limitation, one research direction proposes to compress the models using integer replacements for floating-point numbers, in a process known as Quantization. Some recent studies suggest quantizing the key and value cache (KV Cache) of LLMs, and designing quantization techniques that treat the key and value matrices equivalently. This work delves deeper into the asymmetric structural roles of KV Cache, a phenomenon where the transformer's output loss is more sensitive to the quantization of key matrices. We conduct a systematic examination of the attention output error resulting from key and value quantization. The phenomenon inspires us to propose an asymmetric quantization strategy. Our approach allows for 1-bit quantization of the KV cache by implementing distinct configurations for key and value matrices. We carry out experiments across a variety of datasets, demonstrating that our proposed model allows for the quantization of up to 75% decoder layers with 1 bit, while simultaneously maintaining performance levels comparable to those of the models with floating parameters.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。