[论文解读] Learning Accurate Low-Bit Deep Neural Networks with Stochastic Quantization
本文提出随机量化(Stochastic Quantization, SQ),一种训练方法,该方法基于量化误差,对网络权重的子集进行低比特表示的随机量化,同时保持其余权重为全精度。通过逐步提高量化比例并使用误差感知的选择策略,SQ 减少了梯度误导,实现了低比特深度神经网络(DNN)的最先进精度,甚至在某些情况下优于全精度模型。
Low-bit deep neural networks (DNNs) become critical for embedded applications due to their low storage requirement and computing efficiency. However, they suffer much from the non-negligible accuracy drop. This paper proposes the stochastic quantization (SQ) algorithm for learning accurate low-bit DNNs. The motivation is due to the following observation. Existing training algorithms approximate the real-valued elements/filters with low-bit representation all together in each iteration. The quantization errors may be small for some elements/filters, while are remarkable for others, which lead to inappropriate gradient direction during training, and thus bring notable accuracy drop. Instead, SQ quantizes a portion of elements/filters to low-bit with a stochastic probability inversely proportional to the quantization error, while keeping the other portion unchanged with full-precision. The quantized and full-precision portions are updated with corresponding gradients separately in each iteration. The SQ ratio is gradually increased until the whole network is quantized. This procedure can greatly compensate the quantization error and thus yield better accuracy for low-bit DNNs. Experiments show that SQ can consistently and significantly improve the accuracy for different low-bit DNNs on various datasets and various network structures.
研究动机与目标
- 解决由不一致的量化误差引起的低比特深度神经网络(DNN)显著精度下降问题。
- 通过避免每次迭代中对所有权重进行全量化,提升训练稳定性和收敛性。
- 开发一种方法,在保持高误差权重全精度梯度的同时,逐步对低误差权重进行量化。
- 在多种架构和数据集上实现低比特 DNN 的最先进性能。
- 证明随机、误差感知的量化优于均匀量化,能收敛到更优的局部极小值。
提出的方法
- 随机量化(SQ)在每次训练迭代中,根据量化误差选择网络权重的一个子集进行低比特量化。
- 选择概率与量化误差成反比,确保高误差权重在早期更不容易被量化。
- 量化权重通过量化路径的梯度进行更新,而全精度权重则使用全精度路径的梯度。
- SQ 量化比例在训练过程中从 0% 逐步增加到 100%,实现向全低比特推理的平稳过渡。
- 该方法采用通道级选择粒度,将整个滤波器-通道作为单位进行选择和量化。
- 采用指数方案来调度逐渐增加的 SQ 比例,实证表明其优于线性或平均方案。
实验结果
研究问题
- RQ1随机、误差感知的量化能否提升低比特 DNN 的训练稳定性和最终精度?
- RQ2在训练初期仅对高精度权重进行选择性量化,是否比全量化具有更好的收敛性?
- RQ3选择粒度(逐元素 vs. 通道级)如何影响低比特 DNN 的性能?
- RQ4所提方法能否在低比特设置下实现与全精度模型相当或更优的精度?
- RQ5在训练过程中,量化比例的最优增长调度是什么?
主要发现
- 在 CIFAR-10 上,使用 ResNet-56 的 SQ-BWN 将测试误差相比标准 BWN 降低了 9.27%。
- 在 CIFAR-10 上,使用 ResNet-56 的 SQ-TWN 在 2 位权重下实现了 35.25% 的测试误差,优于全精度模型的 35.01%。
- 在 ImageNet 上,SQ-TWN 在 ResNet-18 上实现了 36.18% 的 top-1 准确率,优于全精度模型的 34.80%。
- 测试损失曲线显示,SQ-BWN 和 SQ-TWN 分别比 BWN 和 TWN 收敛得更稳定且损失更低。
- 在 CIFAR-10 上,SQ-TWN 在 VGG-9 上比全精度模型高出 0.63%,在 ResNet-56 上高出 0.49%,在 CIFAR-100 的 ResNet-56 上高出 0.59%。
- 在所有评估设置中,指数 SQ 比例调度方案均优于线性和平均方案。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。