分离向量方向与幅度,实现更精准的低比特大模型压缩。
PCDVQ: Enhancing Vector Quantization for Large Language Models via Polar Coordinate Decoupling
- 将向量分解为极坐标形式,分别量化方向和幅度
- 2比特下零样本准确率提升至少1.5%,方向敏感度误差降为2.3%
- 适合边缘部署的高效低比特大模型压缩场景
大语言模型因参数规模庞大,在边缘设备部署面临挑战。向量量化(VQ)作为聚类式压缩方法,可在极低比特(甚至2比特)下保持较高精度。现有方法通常耦合量化向量的方向与幅度,但研究发现方向对量化更敏感——在LLaMA-2-7B中,单独对方向与幅度聚类,零样本任务准确率下降分别为46.5%和2.3%。随着聚类中心减少,该差距进一步扩大。同时,当前普遍采用的欧氏距离强调幅度误差,与上述发现相悖,导致量化误差增大。为此,本文提出极坐标解耦向量量化(PCDVQ),包含两个核心模块:1)极坐标解耦(PCD),将向量转换为极坐标表示并独立量化方向与幅度;2)分布对齐码本构建(DACC),根据原始分布优化方向与幅度码本。实验表明,PCDVQ在2比特下零样本准确率较基线提升至少1.5%,建立了一种高精度、高压缩比的大模型新范式。
原文摘要 · Abstract (English)
Large Language Models (LLMs) face significant challenges in edge deployment due to their massive parameter scale. Vector Quantization (VQ), a clustering-based quantization method, serves as a prevalent solution to this issue for its extremely low-bit (even at 2-bit) and considerable accuracy. Since a vector is a quantity in mathematics and physics that has both direction and magnitude, existing VQ works typically quantize them in a coupled manner. However, we find that direction exhibits significantly greater sensitivity to quantization compared to the magnitude. For instance, when separately clustering the directions and magnitudes of weight vectors in LLaMA-2-7B, the accuracy drop of zero-shot tasks are 46.5\% and 2.3\%, respectively. This gap even increases with the reduction of clustering centers. Further, Euclidean distance, a common metric to access vector similarities in current VQ works, places greater emphasis on reducing the magnitude error. This property is contrary to the above finding, unavoidably leading to larger quantization errors. To these ends, this paper proposes Polar Coordinate Decoupled Vector Quantization (PCDVQ), an effective and efficient VQ framework consisting of two key modules: 1) Polar Coordinate Decoupling (PCD), which transforms vectors into their polar coordinate representations and perform independent quantization of the direction and magnitude parameters.2) Distribution Aligned Codebook Construction (DACC), which optimizes the direction and magnitude codebooks in accordance with the source distribution. Experimental results show that PCDVQ outperforms baseline methods at 2-bit level by at least 1.5\% zero-shot accuracy, establishing a novel paradigm for accurate and highly compressed LLMs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。