Identifying Sensitive Weights via Post-quantization Integral
本文提出了一种名为Post-quantization Integral (PQI)的准确度敏感度指标,用于在量化过程中识别敏感权重,并通过ReQuant框架提高了训练后量化方法的性能。
更新于 2025-03-07。作者:Yuezhou Hu、Weiyu Huang、Zichen Liang、Chang Chen、Jintao Zhang、Jun Zhu、Jianfei Chen。
中文摘要
大规模语言模型(LLMs)的服务成本高昂。然而,通过后训练权重量化可以解决这个问题,既可以压缩它们的大小以适应有限的内存,又可以节省带宽以加速。由于并非所有权重维度都同等重要,这些方法通常依赖于一个敏感性度量,它表示权重对损失函数的逐元素影响,并用于预处理原始权重以实现更好的量化。在这项工作中,我们对敏感性度量的准确性进行了实证研究,并发现现有的基于梯度和Hessian的度量非常不准确:它们低估了量化对损失函数的影响达多个数量级,这主要是因为局部二阶近似的收敛半径很小,即泰勒公式中的梯度和Hessian项。为了解决这个问题,我们提出了后量化积分(PQI),这是一个准确度高的度量,可以以细粒度方式估计后敏感性。为了利用这个准确的度量,我们进一步提出了ReQuant,这是一个简单而强大的框架,主要由两个密集和稀疏的分离组件组成:自适应异常值选择和逐步显著的权重分离。结果显示,ReQuant提升了最先进的后训练量化方法,在Llama 3.2 1B上使用QTIP实现了2.66的困惑度增益的显著提升。
英文摘要
Serving Large Language Models (LLMs) is costly. However, post-training weight quantization can address this problem by both compressing their sizes for limited memory and saving bandwidth for acceleration. As not all weight dimensions are equally important, those methods typically rely on a sensitivity metric, which indicates the element-wise influence of weights on loss function and is used to preprocess original weights for better quantization. In this work, we conduct an empirical study on the accuracy of the sensitivity metric, and find that existing gradient and Hessian based metrics are very inaccurate: they underestimate quantization's impact on the loss function by orders of magnitude, mainly due to the small convergence radius of local 2nd order approximation, \ie, gradient and Hessian term in Taylor's formula. To tackle this problem, we propose Post-quantization Integral (PQI), an accurate metric to estimate posterior sensitivity in a fine-grained manner. To leverage this accurate metric, we further propose ReQuant, a simple yet powerful framework that mainly consists of two Dense-and-Sparse detach components: self-adaptive outlier selection and step-wise significant weights detach. Results show that ReQuant boosts state-of-the-art post-training quantization methods, with a pronounced improvement of 2.66 perplexity gain on Llama 3.2 1B with QTIP.
解读
一句话总结
本文提出了一种名为Post-quantization Integral (PQI)的准确度敏感度指标,用于在量化过程中识别敏感权重,并通过ReQuant框架提高了训练后量化方法的性能。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:大型语言模型(LLM)的服务成本高,而训练后权重量化可以压缩模型大小并节省带宽。
- 现有方案不足:现有的基于梯度和Hessian的敏感度指标不准确,低估了量化对损失函数的影响。
- 研究目标:提出一种新的敏感度指标PQI,用于准确估计量化后的敏感度,并开发一个名为ReQuant的框架,以增强量化模型的性能。
问题2:论文的核心创新点是什么?
- 技术创新:提出了PQI,一种新的敏感度指标,用于更准确地估计量化后的敏感度。
- 方法改进:引入了ReQuant框架,该框架利用PQI进行密集和稀疏分解,以提升量化模型的性能。
- 优势:PQI在预测量化对损失函数的影响方面比现有方法更准确,ReQuant框架提高了量化模型的性能。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在Llama 3.2 1B模型上应用ReQuant,与基线方法SqueezeLLM和QTIP相比, perplexity增益提高了2.66。
- 性能提升:ReQuant在Llama 3.2 1B模型上降低了2.66的perplexity,并在MATH few-shot任务上提高了近3%。
- 对比结果:ReQuant在性能上优于SqueezeLLM和QTIP。
问题4:这个研究的实际应用价值是什么?
- 应用场景:适用于大型语言模型的压缩和加速,尤其是在内存有限的边缘设备上。
- 实施建议:使用PQI和ReQuant框架来优化LLM的量化过程。
- 局限与展望:目前方法需要存储稀疏矩阵,且稀疏矩阵乘法可能影响推理速度。未来工作将结合PQI分析到量化过程中,以进一步优化性能。
来源
机器可读索引:llms.txt