arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.17066cs.AI
收藏

VPTQ:面向大语言模型的极低位向量后训练量化

VPTQ: Extreme Low-bit Vector Post-Training Quantization for Large Language Models

University of Science and Technology of China(中国科学技术大学);Microsoft(微软)

Yifei Liu, Jicheng Wen, Yang Wang, Shengyu Ye, Li Lyna Zhang, Ting Cao, Cheng Li, Mao Yang

AI总结:

本文提出VPTQ方法,通过二阶优化驱动的向量量化、通道无关细化及残差与离群值量化,实现LLM极低位量化,在显著降低困惑度、提升精度的同时大幅提高推理吞吐量。

摘要:

模型规模的扩展对大语言模型(LLMs)的部署和推理提出了重大挑战。由于LLM权重中存在冗余,近期研究聚焦于将仅权重量化推进到极低位(甚至低至2比特)。这降低了内存需求,优化了存储成本,并减少了推理期间的内存带宽需求。然而,由于数值表示的局限性,传统的基于标量的权重量化难以实现如此极低的位宽。近期关于面向LLM的向量量化(VQ)的研究表明,通过使用查找表将向量压缩为索引,极低位模型量化具有潜力。\n\n在本文中,我们提出了面向LLM极低位量化的向量后训练量化(VPTQ)方法。我们使用二阶优化来形式化LLM的VQ问题,并通过求解该优化问题来指导我们的量化算法设计。我们进一步使用通道无关的二阶优化对权重进行细化,以实现细粒度的VQ。此外,通过分解优化问题,我们提出了一种简洁有效的码本初始化算法。我们还将VPTQ扩展为支持残差量化和离群值量化,这提高了模型精度并进一步压缩了模型。我们的实验结果表明,在2比特设置下,与SOTA方法相比,VPTQ在LLaMA-2上将模型量化困惑度降低了0.01-0.34,在Mistral-7B上降低了0.38-0.68,在LLaMA-3上降低了4.41-7.34;在问答任务上,LLaMA-2的平均精度提升为0.79-1.5%,Mistral-7B为1%,LLaMA-3为11-22%。我们仅使用了量化算法执行时间的10.4-18.6%,与SOTA相比推理吞吐量提升了1.6-1.8倍。

英文摘要:

Scaling model size significantly challenges the deployment and inference of Large Language Models (LLMs). Due to the redundancy in LLM weights, recent research has focused on pushing weight-only quantization to extremely low-bit (even down to 2 bits). It reduces memory requirements, optimizes storage costs, and decreases memory bandwidth needs during inference. However, due to numerical representation limitations, traditional scalar-based weight quantization struggles to achieve such extreme low-bit. Recent research on Vector Quantization (VQ) for LLMs has demonstrated the potential for extremely low-bit model quantization by compressing vectors into indices using lookup tables. In this paper, we introduce Vector Post-Training Quantization (VPTQ) for extremely low-bit quantization of LLMs. We use Second-Order Optimization to formulate the LLM VQ problem and guide our quantization algorithm design by solving the optimization. We further refine the weights using Channel-Independent Second-Order Optimization for a granular VQ. In addition, by decomposing the optimization problem, we propose a brief and effective codebook initialization algorithm. We also extend VPTQ to support residual and outlier quantization, which enhances model accuracy and further compresses the model. Our experimental results show that VPTQ reduces model quantization perplexity by $0.01$-$0.34$ on LLaMA-2, $0.38$-$0.68$ on Mistral-7B, $4.41$-$7.34$ on LLaMA-3 over SOTA at 2-bit, with an average accuracy improvement of $0.79$-$1.5\%$ on LLaMA-2, $1\%$ on Mistral-7B, $11$-$22\%$ on LLaMA-3 on QA tasks on average. We only utilize $10.4$-$18.6\%$ of the quantization algorithm execution time, resulting in a $1.6$-$1.8\times$ increase in inference throughput compared to SOTA.

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

↑