[论文解读] BiLLM: Pushing the Limit of Post-Training Quantization for LLMs
BiLLM 引入了一种针对预训练语言模型的 1 位后训练量化框架,结构性地选择显著权重,并对非显著权重应用钟形分布分割,在多种 LLM 家族上实现极低的平均比特宽度(约 1.08),且具备有竞争力的困惑度(perplexity)。
Pretrained large language models (LLMs) exhibit exceptional general language processing capabilities but come with significant demands on memory and computational resources. As a powerful compression technology, binarization can extremely reduce model weights to a mere 1 bit, lowering the expensive computation and memory requirements. However, existing quantization techniques fall short of maintaining LLM performance under ultra-low bit-widths. In response to this challenge, we present BiLLM, a groundbreaking 1-bit post-training quantization scheme tailored for pretrained LLMs. Based on the weight distribution of LLMs, BiLLM first identifies and structurally selects salient weights, and minimizes the compression loss through an effective binary residual approximation strategy. Moreover, considering the bell-shaped distribution of the non-salient weights, we propose an optimal splitting search to group and binarize them accurately. BiLLM achieving for the first time high-accuracy inference (e.g. 8.41 perplexity on LLaMA2-70B) with only 1.08-bit weights across various LLMs families and evaluation metrics, outperforms SOTA quantization methods of LLM by significant margins. Moreover, BiLLM enables the binarization process of the LLM with 7 billion weights within 0.5 hours on a single GPU, demonstrating satisfactory time efficiency. Our code is available at https://github.com/Aaronhuang-778/BiLLM.
研究动机与目标
- 推动对 LLM 的强力模型压缩,以便在内存受限设备上实现部署。
- 研究 LLM 的权重分布以及如何利用显著性实现有效二值化。
- 开发一个 1-bit PTQ 框架,通过对显著权重和非显著权重采取不同处理来保持性能。
- 展示超低比特二值化在多种 LLM 家族上可超越现有 SOTA PTQ 方法。
提出的方法
- 使用基于 Hessian 的度量来通过列向显著性结构性识别每层的显著权重,并为这些显著权重优化二值残差近似。
- 应用二值残差近似在残差上再进行二值化,以尽量减少对显著权重的损失。
- 对于非显著权重,在最佳断点处分割权重分布,并将两组(集中与稀疏)分别二值化以降低误差。
- 结合带有逐块标定的误差补偿的分块激活(OBC),以进一步降低量化误差。
- 报告平均权重量化比特宽度约为 1.07–1.11 位,并在 OPT、LLaMA、LLaMA2 与 Vicuna 家族上使用 perplexity 指标进行验证。
实验结果
研究问题
- RQ1超低位(1 位)后训练量化是否能在不同家族(OPT、LLaMA、LLaMA2、Vicuna)上保持 LLM 性能?
- RQ2如何利用权重显著性和分布特征来最小化 LLM PTQ 的量化误差?
- RQ3区分显著权重与非显著权重并应用不同的二值化策略是否显著优于现有 PTQ 基线?
- RQ4在单个 GPU 上对大规模 LLM 进行二值化时,BiLLM 的实际时间和硬件开销是多少?
主要发现
- BiLLM 在 WikiText2 上以 1.08-bit 权重实现困惑度提升,对于 LLaMA-65B 和 LLaMA2-70B,在某些情况下超越部分全精度基线。
- BiLLM 在 OPT、LLaMA、LLaMA2 家族中实现平均权重量比特宽度约 1.07–1.11 位,超越 PB-LLM 的 1.70 位,在若干模型上接近 GPTQ 风格的在更低位上的性能。
- 在极低比特位下,BiLLM 的二值化保持了合理的语言能力,在 RTN 和 GPTQ 崩溃的情形中(例如,在若干设置中优于 1-bit RTN 与 2–4 bit GPTQ 基线)。
- 该二值化过程高效,在单个 80 GB 的 A100 GPU 上,大约 30 分钟即可对一个 7B 参数模型进行二值化,且 7B LLM 的比特宽度约为 1.08–1.11 位。
- 显著权重残差近似加上钟形的非显著分割共同推动性能提升,消融研究显示这两个组件在 OPT 与 LLaMA 上均能提升结果。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。