arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.00034cs.LGcs.AIcs.CL
收藏

PB-LLM: 部分二值化大语言模型

PB-LLM: Partially Binarized Large Language Models

Illinois Institute of Technology(伊利诺伊理工大学);Huomo AI(华墨人工智能);UC Berkeley(加州大学伯克利分校)

Yuzhang Shang, Zhihang Yuan, Qiang Wu, Zhen Dong

AI总结:

针对现有二值化方法导致大语言模型性能崩溃的问题,提出部分二值化大语言模型PB-LLM,保留小部分显著权重为高位,结合PTQ与QAT相关技术恢复模型性能,推动LLM低比特二值化研究进展。

摘要:

本文探索网络二值化这一激进的量化形式——将模型权重压缩至单个比特,专门用于大语言模型(LLM)压缩。由于以往的二值化方法会导致LLM性能崩溃,我们提出了一种新方法:部分二值化大语言模型(PB-LLM),它能实现极致低比特量化,同时保持量化后LLM的语言推理能力。具体而言,我们的研究首先发现直接套用现有二值化算法效果不佳,并凸显了显著权重在实现低比特量化中的关键作用。因此,PB-LLM在二值化过程中筛选出小比例的显著权重,将其分配给更高比特的存储,即部分二值化。通过从训练后量化(PTQ)和量化感知训练(QAT)的角度进行分析,PB-LLM被扩展用于恢复量化后多模态大模型(LMM)的能力。在PTQ框架下,我们结合GPTQ的思路,在Hessian矩阵的引导下重构二值化权重矩阵,成功恢复了低比特下PB-LLM的推理能力。在QAT框架下,我们在训练过程中冻结显著权重,推导了对最小化量化误差至关重要的最优缩放因子,并基于该推导的缩放策略为残差二值化权重提出了一种缩放机制。这些探索和所开发的方法极大地助力了低比特量化LLM的性能复苏,在LLM网络二值化领域取得了实质性进展。代码可在https://github.com/hahnyuan/BinaryLLM获取。

英文摘要:

This paper explores network binarization, a radical form of quantization, compressing model weights to a single bit, specifically for Large Language Models (LLMs) compression. Due to previous binarization methods collapsing LLMs, we propose a novel approach, Partially-Binarized LLM (PB-LLM), which can achieve extreme low-bit quantization while maintaining the linguistic reasoning capacity of quantized LLMs. Specifically, our exploration first uncovers the ineffectiveness of naive applications of existing binarization algorithms and highlights the imperative role of salient weights in achieving low-bit quantization. Thus, PB-LLM filters a small ratio of salient weights during binarization, allocating them to higher-bit storage, i.e., partially-binarization. PB-LLM is extended to recover the capacities of quantized LMMs, by analyzing from the perspective of post-training quantization (PTQ) and quantization-aware training (QAT). Under PTQ, combining the concepts from GPTQ, we reconstruct the binarized weight matrix guided by the Hessian matrix and successfully recover the reasoning capacity of PB-LLM in low-bit. Under QAT, we freeze the salient weights during training, explore the derivation of optimal scaling factors crucial for minimizing the quantization error, and propose a scaling mechanism based on this derived scaling strategy for residual binarized weights. Those explorations and the developed methodologies significantly contribute to rejuvenating the performance of low-bit quantized LLMs and present substantial advancements in the field of network binarization for LLMs.The code is available at https://github.com/hahnyuan/BinaryLLM.

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

↑