改进大模型量化算法,让每比特更高效
High-Rate Quantized Matrix Multiplication II

- 用信息论中的水位分配法优化量化率分配
- 新方法在高码率下比现有算法低0.25比特/项
- 适合关注大模型压缩效率的研究者
本文是关于量化矩阵乘法的第二部分研究,考虑了已知第二因子列向量协方差矩阵Σ_X的场景,该场景广泛存在于仅量化权重的训练后大语言模型(LLM)量化中。此问题与加权均方误差源编码相关,其经典逆水填法指导如何在各维度间分配速率。本文展示如何将水填法用于改进现有算法GPTQ(当前等率分配)。分析了一种仅使用标量INT量化器的近期方案WaterSIC,发现其高码率性能具有:(a) 基无关性(由Σ_X行列式决定,不受随机旋转影响);(b) 距信息论失真极限仅差乘性因子2πe/12(约0.25比特/项)。而GPTQ性能受基选择影响,但在实际Llama-3-8B数据和随机旋转下,其性能仅比WaterSIC低0.1比特(依层类型而定),表明其在高码率下也接近最优。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。