[论文解读] PB-LLM: Partially Binarized Large Language Models
该论文提出PB-LLM,一种部分二值化的大型语言模型,通过选择性地以更高精度保留显著权重,在极端1比特量化下仍能保持高水平的语言推理能力。通过结合后训练量化中的海森矩阵引导重建与量化感知训练中的推导缩放策略,PB-LLM在4比特设置下达到最先进性能,并展现出实现全1比特LLM的巨大潜力。
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.
研究动机与目标
- 解决直接应用朴素二值化方法在极端低比特量化下导致LLM推理能力失效的问题。
- 探究显著权重在实现LLM有效低比特量化中的作用。
- 开发一种部分二值化框架,以在模型压缩与性能保留之间取得平衡。
- 通过先进的后训练量化(PTQ)与量化感知训练(QAT)技术,恢复量化LLM中的推理能力。
- 在保持语言推理性能的同时,实现1比特LLM的高效训练与部署。
提出的方法
- 提出部分二值化LLM(PB-LLM),将少量显著权重以更高比特精度存储,其余权重则进行二值化。
- 在后训练量化(PTQ)中应用海森矩阵引导的重建方法,以恢复性能,灵感来源于GPTQ。
- 推导出二值化权重的最优缩放因子,以最小化量化误差,从而在QAT中实现有效缩放。
- 在QAT过程中冻结显著权重,以保持其完整性并提升训练稳定性。
- 采用混合方法,结合显著权重保留与自适应缩放,以平衡压缩与性能。
- 采用10K次迭代的微调调度策略,配合AdamW优化器与余弦退火,实现高效的QAT。
实验结果
研究问题
- RQ1为何标准二值化方法在直接应用于LLM时会失效?
- RQ2显著权重在实现LLM有效低比特量化中起到何种作用?
- RQ3如何在极低比特量化LLM中恢复推理能力?
- RQ4在QAT下,何种缩放策略能最小化二值化LLM的量化误差?
- RQ5PB-LLM能否在4比特及接近1比特水平下,通过极少微调实现有竞争力的性能?
主要发现
- PB-LLM 30%(保留30%显著权重)在常识推理任务上的平均零 shot 准确率达到66.9,优于相同4比特设置下的LLM-QAT。
- PB-LLM 10%在平均零 shot 准确率上达到60.6,尽管仅有10%的权重以更高精度存储,仍展现出实现1比特LLM的巨大潜力。
- PB-LLM在QAT下仅需10K次迭代即可收敛,显著快于LLM-QAT所需的100K次迭代。
- 在C4数据集上,PB-GPTQ 50%(保留50%显著权重)的困惑度降至8.1466,表明在可接受的性能损失下实现了有效压缩。
- PB-GPTQ在10%显著权重保留下,C4上的困惑度急剧上升至72.1115,凸显了保留足够显著权重的必要性。
- QAT中推导出的缩放策略能有效最小化量化误差,使在极端二值化下仍能实现高性能。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。