Skip to main content
QUICK REVIEW

[论文解读] PD-Quant: Post-Training Quantization based on Prediction Difference Metric

Jiawei Liu, Lin Niu|arXiv (Cornell University)|Dec 14, 2022
Advanced Neural Network Applications被引用 4
一句话总结

PD-Quant 提出了一种后训练量化方法,通过使用预测差异(即全精度模型与量化模型输出之间的KL散度)来优化量化参数,从而提升低比特模型的精度。该方法引入了分布校正(Distribution Correction)以缓解小规模校准集上的过拟合问题,在多项任务中达到最先进性能,例如在2比特权重和激活条件下,ResNet-18的top-1精度达到53.14%。

ABSTRACT

Post-training quantization (PTQ) is a neural network compression technique that converts a full-precision model into a quantized model using lower-precision data types. Although it can help reduce the size and computational cost of deep neural networks, it can also introduce quantization noise and reduce prediction accuracy, especially in extremely low-bit settings. How to determine the appropriate quantization parameters (e.g., scaling factors and rounding of weights) is the main problem facing now. Existing methods attempt to determine these parameters by minimize the distance between features before and after quantization, but such an approach only considers local information and may not result in the most optimal quantization parameters. We analyze this issue and ropose PD-Quant, a method that addresses this limitation by considering global information. It determines the quantization parameters by using the information of differences between network prediction before and after quantization. In addition, PD-Quant can alleviate the overfitting problem in PTQ caused by the small number of calibration sets by adjusting the distribution of activations. Experiments show that PD-Quant leads to better quantization parameters and improves the prediction accuracy of quantized models, especially in low-bit settings. For example, PD-Quant pushes the accuracy of ResNet-18 up to 53.14% and RegNetX-600MF up to 40.67% in weight 2-bit activation 2-bit. The code is released at https://github.com/hustvl/PD-Quant.

研究动机与目标

  • 为解决在极低比特宽度(尤其是2比特)下后训练量化(PTQ)性能下降的问题,此时量化噪声对精度影响严重。
  • 克服局部度量(如MSE或余弦距离)在选择最优量化缩放因子和舍入值时的局限性。
  • 通过将校准集激活分布校正为与批归一化层统计量一致,减少因校准数据有限导致的PTQ过拟合问题。
  • 开发一种基于全局模型预测差异信息而非局部特征重建的量化参数优化方法。

提出的方法

  • PD-Quant 使用全精度模型与量化模型最终预测结果之间的KL散度作为主要度量,指导量化参数的优化。
  • 通过最小化预测差异损失,联合优化激活缩放因子和权重舍入值,该损失捕捉的是全局模型行为而非局部特征偏移。
  • 该方法引入了分布校正(DC),通过调整校准集激活的均值和方差,使其与批归一化层中存储的统计量相匹配,从而提升泛化能力。
  • 采用可微分搜索策略,逐层优化缩放因子和舍入值,特别关注低比特设置。
  • PD-Quant 在无需微调的情况下应用于训练后阶段,仅依赖少量未标注的校准样本。
  • 该方法在ResNet-18、RegNetX-600MF和MobileNetV2上进行了评估,结果在各类模型和比特宽度下均表现出一致的性能提升。

实验结果

研究问题

  • RQ1通过全精度模型与量化模型输出之间的KL散度测量的预测差异,是否能比MSE或余弦距离等局部度量获得更优的量化参数?
  • RQ2在2比特等低比特设置下,使用全局预测差异信息是否能提升量化精度?
  • RQ3在校准数据有限的情况下,对校准集激活进行分布校正是否能缓解PTQ中的过拟合问题?
  • RQ4在低比特宽度下,与现有PTQ基线方法相比,该方法在精度和计算成本方面表现如何?

主要发现

  • PD-Quant 在2比特权重和2比特激活条件下,于ImageNet上实现了ResNet-18的53.14% top-1精度,创下该设置下PTQ的新SOTA记录。
  • 对于RegNetX-600MF,在相同2比特权重和激活配置下,PD-Quant达到40.67% top-1精度,显著优于先前的PTQ方法。
  • 将KL散度作为优化目标的预测差异方法,相比MSE或余弦距离等局部度量,能生成更精确的量化参数。
  • 分布校正(DC)通过极少的超参数调优即可提升模型泛化能力并减少过拟合,表现为在不同λc值下性能稳定。
  • PD-Quant的额外推理时间开销可接受——在RTX A6000上仅需1.11小时,远低于LSQ等QAT方法的120小时。
  • 该方法对低比特权重量化具有鲁棒性,但对权重缩放因子的改进有限,表明激活量化对基于预测的优化更为敏感。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

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