As a neural network compression technique, post-training quantization (PTQ) transforms a pre-trained model into a quantized model using a lower-precision data type. However, the prediction accuracy will decrease because of the quantization noise, 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. Many existing methods determine the quantization parameters by minimizing the distance between features before and after quantization. Using this distance as the metric to optimize the quantization parameters only considers local information. We analyze the problem of minimizing local metrics and indicate that it would not result in optimal quantization parameters. Furthermore, the quantized model suffers from overfitting due to the small number of calibration samples in PTQ. In this paper, we propose PD-Quant to solve the problems. PD-Quant uses the information of differences between network prediction before and after quantization to determine the quantization parameters. To mitigate the overfitting problem, PD-Quant adjusts the distribution of activations in PTQ. 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.08% and RegNetX-600MF up to 40.92% in weight 2-bit activation 2-bit. The code will be released at https://github.com/hustvl/PD-Quant.


翻译:作为一种神经网络压缩技术,训练后量化(PTQ)利用低精度数据类型将预训练模型转换为量化模型。然而,量化噪声会导致预测精度下降,尤其在超低位宽设置中更为显著。如何确定合适的量化参数(如缩放因子和权重的取整方式)是当前面临的主要问题。现有许多方法通过最小化量化前后特征间的距离来确定量化参数。将这种距离作为优化量化参数的度量仅考虑了局部信息。我们分析了最小化局部度量的问题,并指出其无法得到最优量化参数。此外,由于PTQ中校准样本数量有限,量化模型存在过拟合问题。本文提出PD-Quant以解决上述问题。PD-Quant利用网络量化前后预测结果的差异信息来确定量化参数。为缓解过拟合,PD-Quant调整了PTQ中激活值的分布。实验表明,PD-Quant能够获得更优的量化参数,提升量化模型的预测精度,尤其在低位宽设置下。例如,在权重量化为2比特、激活量化为2比特时,PD-Quant将ResNet-18的精度提升至53.08%,RegNetX-600MF的精度提升至40.92%。代码将在https://github.com/hustvl/PD-Quant开源。

0
下载
关闭预览

相关内容

机器学习系统设计系统评估标准
不可错过!《机器学习100讲》课程,UBC Mark Schmidt讲授
专知会员服务
76+阅读 · 2022年6月28日
100+篇《自监督学习(Self-Supervised Learning)》论文最新合集
专知会员服务
167+阅读 · 2020年3月18日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
无监督元学习表示学习
CreateAMind
27+阅读 · 2019年1月4日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
【论文】变分推断(Variational inference)的总结
机器学习研究会
39+阅读 · 2017年11月16日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
Arxiv
13+阅读 · 2022年10月20日
Arxiv
11+阅读 · 2022年9月1日
Arxiv
24+阅读 · 2022年2月4日
Arxiv
27+阅读 · 2021年11月11日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
7+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
6+阅读 · 6月17日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员