论文精选

高率量化矩阵乘法 II:水填充法优化LLM量化

High-Rate Quantized Matrix Multiplication II

精选理由

做LLM量化的开发者终于有了理论指导——水填充法比均匀分配更优,GPTQ加随机旋转就能接近极限,建议做权重量化的团队点开看看具体实现。

AI 摘要

本文是量化矩阵乘法研究的第二部分,探讨在第二因子列协方差矩阵已知时的量化策略,该场景常见于大语言模型的权重量化后训练。作者展示了经典的水填充法(waterfilling)如何改进现有LLM量化算法(如GPTQ),后者目前均匀分配比特率。分析表明,仅使用标量INT量化器的WaterSIC方案在高率下性能与信息论极限相差仅0.25比特/条目,且不受随机旋转影响。而GPTQ在随机旋转下与WaterSIC差距在0.1比特以内,表明其在高率下也接近最优。

原文 · arXiv cs.AI

High-Rate Quantized Matrix Multiplication II

This is the second part of the work investigating quantized matrix multiplication (MatMul). In part I we considered the case of calibration-free quantization, whereas here we discuss the setting where covariance matrix $Σ_X$ of the columns of the second factor is available. This setting arises in the ubiquitous task of weight-only post-training quantization of LLMs. Weight-only quantization is related to the problem of weighted mean squared error (WMSE) source coding, whose classical (reverse) waterfilling solution dictates how one should distribute rate between coordinates of the vector. We show how waterfilling can be used to improve practical LLM quantization algorithms (GPTQ), which at present allocate rate equally. A recent scheme (known as ``WaterSIC'') that only uses scalar INT quantizers is analyzed and its high-rate performance is shown to be (a) basis free (i.e., characterized by the determinant of $Σ_X$ and, thus, unlike existing schemes, is immune to applying random rotations); and (b) within a multiplicative factor of $\frac{2πe}{12}$ (or 0.25 bit/entry) of the information-theoretic distortion limit. GPTQ's performance, in turn, is affected by the choice of basis, but for a random rotation and actual $Σ_X$ from Llama-3-8B we find it to be within 0.1 bit (depending on the layer type) of WaterSIC, suggesting that GPTQ with random rotation is also near optimal, at least in the high-rate regime.