Skip to main content
QUICK REVIEW

[论文解读] QuIP: 2-Bit Quantization of Large Language Models With Guarantees

Jerry Chee, Yaohui Cai|PubMed|Jul 25, 2023
Topic Modeling被引用 24
一句话总结

QuIP 引入一种基于不一致性的后训练量化方法,使大型语言模型实现可行的每权重 2 位量化,并具备理论保证及对现有 PTQ 方法的实证改进。

ABSTRACT

This work studies post-training parameter quantization in large language models (LLMs). We introduce quantization with incoherence processing (QuIP), a new method based on the insight that quantization benefits from <i>incoherent</i> weight and Hessian matrices, i.e., from the weights being even in magnitude and the directions in which it is important to round them accurately being unaligned with the coordinate axes. QuIP consists of two steps: (1) an adaptive rounding procedure minimizing a quadratic proxy objective; (2) efficient pre- and post-processing that ensures weight and Hessian incoherence via multiplication by random orthogonal matrices. We complement QuIP with the first theoretical analysis for an LLM-scale quantization algorithm, and show that our theory also applies to an existing method, OPTQ. Empirically, we find that our incoherence preprocessing improves several existing quantization algorithms and yields the first LLM quantization methods that produce viable results using only two bits per weight. Our code can be found at https://github.com/Cornell-RelaxML/QuIP.

研究动机与目标

  • 通过后训练参数量化来激发并实现对大型语言模型的高效推理。
  • 提出 QuIP,一种两步法,利用自适应舍入和不一致性处理来提升量化质量。
  • 为包括 QuIP 和 OPTQ 在内的广泛自适应舍入方法提供理论分析。
  • 通过实证显示不一致性处理在多种模型规模和任务上实现了可行的 2 位量化。

提出的方法

  • 自适应舍入过程,使用估计的 Hessian H,最小化形式为 ell(Ŵ) = tr((Ŵ − W)H(Ŵ − W)ᵀ) 的二次代理目标。
  • 不一致性处理,通过将 W 和 H 与随机正交矩阵相乘来确保权重和海森矩阵的不一致性。
  • 贪心局部搜索和坐标下降风格更新,与自适应舍入框架保持一致。
  • 理论分析展示在一般舍入方法类中的最优性,以及与 OPTQ 的等价性/联系。
  • 在 OPT 模型(125m 到 66B)上的实证评估,展示改进以及大型模型的首个可行的 2-bit 量化结果。

实验结果

研究问题

  • RQ1是否可以在具备保证和实际性能的前提下实现对大型语言模型的两位后训练量化?
  • RQ2在模型规模和任务中,是否通过引入不一致性处理可以提升 PTQ 方法如 LDLQ/OPTQ 的准确性?
  • RQ3在大规模量化中,基于海森信息的自适应舍入的理论作用是什么?它与现有方法有何关系?
  • RQ4在语言生成和零-shot 任务上,QuIP 相对于先前的 PTQ 方法在不同模型尺寸上的表现如何?

主要发现

  • QuIP 使大型语言模型在多种尺寸和任务上实现了每权重 2 位的可行量化。
  • 不一致性处理持续提升量化性能,并在所有方法中在 2 位时引发量化质量的阶跃式变化。
  • QuIP 提供了首个面向 LLM 规模量化算法的理论分析,并显示其与 OPTQ 的相关性。
  • 带有不一致性处理的贪心及基于 LDLQ/OPTQ 的变体在许多情形中优于最近舍入,尤其是在 2 位量化时。
  • 实证结果显示两位量化取得可行结果,随着模型规模增大,2 位和 4 位压缩之间的差距较小。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。