QuEST: Stable Training of LLMs with 1-Bit Weights and Activations
QuEST是一种新的量化感知训练方法,能够在低比特精度(甚至1比特)下稳定训练大型语言模型,同时保持高精度和高效的推理性能。
更新于 2025-02-10。作者:Andrei Panferov、Jiale Chen、Soroush Tabesh、Roberto L. Castro、Mahdi Nikdan、Dan Alistarh。
中文摘要
一种降低大型语言模型(LLMs)巨大成本的方法是使用量化或稀疏表示进行训练或部署。虽然训练后压缩方法非常流行,但通过直接在这些表示上训练以获得更精确的压缩模型的问题,即量化感知训练(QAT),仍然悬而未决:例如,最近的一项研究(arXiv:2411.04330v2)将使用QAT在保持与标准FP16/BF16精度准确度相当的情况下,模型可以训练的“最优”位宽定在8位权重和激活。我们通过一种名为QuEST的新方法推进了这一领域的最新研究,它与FP16具有Pareto竞争性,即它能够在更小的模型尺寸上提供更好的准确度,同时在权重和激活中使用4位或更少的位数进行模型训练。此外,QuEST允许使用1位权重和激活进行稳定的训练。QuEST通过改进QAT方法的两个关键方面来实现这一点:(1)通过Hadamard归一化和MSE最优拟合,对权重和激活的(连续)分布进行准确和快速的量化;(2)基于显式最小化量化状态上计算的噪声梯度与“真实”(但未知)的全精度梯度的误差的新信任梯度估计器。在Llama型架构上的实验表明,QuEST在整个硬件支持的精度范围内诱导出稳定的缩放定律,并且可以扩展到稀疏表示。我们提供了GPU内核支持,表明通过QuEST生成的模型可以高效执行。我们的代码可在https://github.com/IST-DASLab/QuEST上获取。
英文摘要
One approach to reducing the massive costs of large language models (LLMs) is the use of quantized or sparse representations for training or deployment. While post-training compression methods are very popular, the question of obtaining even more accurate compressed models by directly training over such representations, i.e., Quantization-Aware Training (QAT), is still open: for example, a recent study (arXiv:2411.04330v2) put the "optimal" bit-width at which models can be trained using QAT, while staying accuracy-competitive with standard FP16/BF16 precision, at 8-bits weights and activations. We advance this state-of-the-art via a new method called QuEST, which is Pareto-competitive with FP16, i.e., it provides better accuracy at lower model size, while training models with weights and activations in 4-bits or less. Moreover, QuEST allows stable training with 1-bit weights and activations. QuEST achieves this by improving two key aspects of QAT methods: (1) accurate and fast quantization of the (continuous) distributions of weights and activations via Hadamard normalization and MSE-optimal fitting; (2) a new trust gradient estimator based on the idea of explicitly minimizing the error between the noisy gradient computed over quantized states and the "true" (but unknown) full-precision gradient. Experiments on Llama-type architectures show that QuEST induces stable scaling laws across the entire range of hardware-supported precisions, and can be extended to sparse representations. We provide GPU kernel support showing that models produced by QuEST can be executed efficiently. Our code is available at https://github.com/IST-DASLab/QuEST.
解读
一句话总结
QuEST是一种新的量化感知训练方法,能够在低比特精度(甚至1比特)下稳定训练大型语言模型,同时保持高精度和高效的推理性能。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:大型语言模型(LLMs)的计算需求巨大,导致AI效率成为关键挑战。量化或稀疏表示对于训练或部署LLMs具有成本效益,但现有量化感知训练(QAT)方法在保持精度的同时,无法达到低比特宽度的模型。
- 现有方案不足:现有QAT方法在低比特宽度下无法准确训练LLMs,且性能不如标准FP16/BF16精度。
- 研究目标:开发一种新的QAT方法,能够在低比特宽度下稳定训练LLMs,同时保持高精度和高效的推理性能。
问题2:论文的核心创新点是什么?
- 技术创新:通过Hadamard归一化和MSE最优拟合,实现权重和激活的准确且快速量化。
- 方法改进:提出了一种新的信任梯度估计器,通过显式最小化量化状态上的噪声梯度与“真实”全精度梯度之间的误差。
- 优势:与现有方法相比,QuEST在更低的模型尺寸下提供更好的精度,并允许在1比特精度下稳定训练。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在Llama型架构上进行的实验,展示了QuEST在1到4比特的量化权重和激活下的稳定缩放定律。
- 性能提升:QuEST可以训练出在4比特权重和激活下具有比BF16模型低4倍大小的模型,同时保持更高的精度。
- 对比结果:与基线方法的对比表明,QuEST在所有测试的精度和模型尺寸下都表现出稳定的收敛性和准确性。
问题4:这个研究的实际应用价值是什么?
- 应用场景:适用于需要高效和精确的LLMs的应用,如自然语言处理、机器翻译和文本生成。
- 实施建议:使用QuEST进行LLMs的训练,以实现低比特宽度和高精度。
- 局限与展望:QuEST的有效性已在上限为800M参数的模型中得到验证,未来工作将探索更大规模模型的扩展性,并将QuEST扩展到编码器-解码器模型和其他架构。