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

PolarQuant:利用极坐标变换量化 KV 缓存

PolarQuant: Quantizing KV Caches with Polar Transformation

KAIST(韩国科学技术院);Google Research(谷歌研究院);Yale University(耶鲁大学)

Insu Han, Praneeth Kacham, Amin Karbasi, Vahab Mirrokni, Amir Zandieh

AI总结:

PolarQuant 提出利用随机预处理与极坐标变换对 KV 缓存中的角度进行量化,借助角度分布的紧致集中特性免去显式归一化,从而在长上下文场景下实现超过 4.2 倍压缩并取得最优质量。

摘要:

大型语言模型(LLMs)需要大量内存来在 KV 缓存中存储键值(Key-Value,KV)嵌入,尤其是在处理长距离上下文时。对这些 KV 嵌入进行量化是一种常见的内存消耗降低技术。本文提出了 PolarQuant,一种采用随机预处理和极坐标变换的新型量化方法。我们的方法使用高效的递归算法将 KV 嵌入变换为极坐标,然后对得到的角度进行量化。我们的核心见解是,经过随机预处理后,极坐标表示中的角度呈现出紧致有界且高度集中的分布,并且具有可解析计算的形式。这种良好的分布消除了显式归一化的需要,而显式归一化是传统量化方法所必需的步骤,该步骤会引入显著的内存开销,因为量化参数(例如零点和缩放因子)必须以全精度存储在每个数据块中。PolarQuant 绕过了这一归一化步骤,从而实现了显著的内存节省。长上下文评估表明,PolarQuant 将 KV 缓存压缩了超过 x4.2 倍,同时与最先进的方法相比取得了最佳的质量分数。

英文摘要:

Large language models (LLMs) require significant memory to store Key-Value (KV) embeddings in their KV cache, especially when handling long-range contexts. Quantization of these KV embeddings is a common technique to reduce memory consumption. This work introduces PolarQuant, a novel quantization method employing random preconditioning and polar transformation. Our method transforms the KV embeddings into polar coordinates using an efficient recursive algorithm and then quantizes resulting angles. Our key insight is that, after random preconditioning, the angles in the polar representation exhibit a tightly bounded and highly concentrated distribution with an analytically computable form. This nice distribution eliminates the need for explicit normalization, a step required by traditional quantization methods which introduces significant memory overhead because quantization parameters (e.g., zero point and scale) must be stored in full precision per each data block. PolarQuant bypasses this normalization step, enabling substantial memory savings. The long-context evaluation demonstrates that PolarQuant compresses the KV cache by over x4.2 while achieving the best quality scores compared to the state-of-the-art methods.

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

↑