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

WKVQuant:量化大语言模型的权重与键/值缓存以获取更大收益

WKVQuant: Quantizing Weight and Key/Value Cache for Large Language Models Gains More

Harbin Institute of Technology (Shenzhen)(哈尔滨工业大学(深圳));Houmo AI(鸿谋科技);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室);Shanghai Jiao Tong University(上海交通大学)

Yuxuan Yue, Zhihang Yuan, Haojie Duanmu, Sifan Zhou, Jianlong Wu, Liqiang Nie

AI总结:

本文提出训练后量化框架WKVQuant,通过过去信息量化、二维KV缓存量化策略及跨块重建正则化,在几乎达到权重-激活量化内存节省的同时,性能接近仅权重量化。

摘要:

大语言模型(LLMs)因其庞大的内存需求以及自回归文本生成过程的计算开销而面临显著的部署挑战。本文通过聚焦于LLMs的量化来应对这些挑战,该技术通过将模型参数和激活值转换为低位整数来降低内存消耗。我们批判性地分析了现有的量化方法,指出它们在平衡量化后LLMs的准确性与效率方面的局限性。为了突破这些局限,我们提出了WKVQuant,这是一个专为量化LLMs的权重和键/值(KV)缓存而设计的训练后量化(PTQ)框架。具体而言,我们引入了仅使用过去信息的量化(past-only quantization)来改进注意力计算。此外,我们提出了二维量化策略来处理KV缓存的分布,并结合跨块重建正则化进行参数优化。实验表明,WKVQuant实现了与权重-激活量化几乎相当的内存节省,同时性能接近仅权重量化。

英文摘要:

Large Language Models (LLMs) face significant deployment challenges due to their substantial memory requirements and the computational demands of auto-regressive text generation process. This paper addresses these challenges by focusing on the quantization of LLMs, a technique that reduces memory consumption by converting model parameters and activations into low-bit integers. We critically analyze the existing quantization approaches, identifying their limitations in balancing the accuracy and efficiency of the quantized LLMs. To advance beyond these limitations, we propose WKVQuant, a PTQ framework especially designed for quantizing weights and the key/value (KV) cache of LLMs. Specifically, we incorporates past-only quantization to improve the computation of attention. Additionally, we introduce two-dimensional quantization strategy to handle the distribution of KV cache, along with a cross-block reconstruction regularization for parameter optimization. Experiments show that WKVQuant achieves almost comparable memory savings to weight-activation quantization, while also approaching the performance of weight-only quantization.

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

↑