Skip to main content
QUICK REVIEW

[论文解读] Blended Coarse Gradient Descent for Full Quantization of Deep Neural Networks

Penghang Yin, Shuai Zhang|arXiv (Cornell University)|Aug 15, 2018
Advanced Neural Network Applications参考文献 34被引用 12
一句话总结

本文提出了一种新型优化方法——混合粗梯度下降(Blended Coarse Gradient Descent, BCGD),用于训练具有极低比特权重和激活值的全量化深度神经网络。通过融合全精度权重与量化权重,并使用与真实梯度正相关联的粗梯度,BCGD 实现了稳定且收敛的训练过程,使 ResNet-18 在使用二值化权重和 4 位激活值时在 ImageNet 上达到 64.36% 的 top-1 准确率。

ABSTRACT

Quantized deep neural networks (QDNNs) are attractive due to their much lower memory storage and faster inference speed than their regular full precision counterparts. To maintain the same performance level especially at low bit-widths, QDNNs must be retrained. Their training involves piecewise constant activation functions and discrete weights, hence mathematical challenges arise. We introduce the notion of coarse gradient and propose the blended coarse gradient descent (BCGD) algorithm, for training fully quantized neural networks. Coarse gradient is generally not a gradient of any function but an artificial ascent direction. The weight update of BCGD goes by coarse gradient correction of a weighted average of the full precision weights and their quantization (the so-called blending), which yields sufficient descent in the objective value and thus accelerates the training. Our experiments demonstrate that this simple blending technique is very effective for quantization at extremely low bit-width such as binarization. In full quantization of ResNet-18 for ImageNet classification task, BCGD gives 64.36\% top-1 accuracy with binary weights across all layers and 4-bit adaptive activation. If the weights in the first and last layers are kept in full precision, this number increases to 65.46\%. As theoretical justification, we show convergence analysis of coarse gradient descent for a two-linear-layer neural network model with Gaussian input data, and prove that the expected coarse gradient correlates positively with the underlying true gradient.

研究动机与目标

  • 解决具有分段常数激活函数和离散权重的全量化神经网络训练问题,此类问题使得标准反向传播方法失效。
  • 通过引入一种非梯度基的上升方向——粗梯度,克服量化网络中零或近零随机梯度的问题。
  • 设计一种训练算法,确保在量化层不可微的条件下,损失函数仍能实现充分下降。
  • 在高斯输入假设下,理论上证明粗梯度与真实梯度之间的正相关性,以证明其有效性。
  • 在 ImageNet 等标准基准上,展示在极低比特量化(尤其是二值化)下的最先进性能。

提出的方法

  • 引入‘粗梯度’的概念——一种非源自真实梯度的人工上升方向,专为在不可微的量化神经网络中引导优化而设计。
  • 提出混合粗梯度下降(BCGD)算法,其中权重更新基于全精度权重与其量化对应物的加权平均。
  • 对量化 ReLU 激活函数使用三值粗偏导数,以实现通过量化层的反向传播。
  • 采用具有广义代理导数的直通估计器,该导数在几乎所有位置都精确,从而提升梯度近似稳定性。
  • 将粗梯度整合进具有自适应步长的随机优化框架中,确保目标函数单调下降。
  • 理论分析基于具有高斯输入数据的两层神经网络模型,证明期望粗梯度与真实梯度呈正相关。

实验结果

研究问题

  • RQ1能否有效利用非梯度基的上升方向(即粗梯度)来训练具有离散权重与激活值的全量化深度神经网络?
  • RQ2BCGD 算法中全精度权重与量化权重的融合是否能确保训练过程中损失函数的充分下降?
  • RQ3在分段常数激活函数存在的情况下,期望粗梯度与真实梯度之间的相关性如何?
  • RQ4能否在具有高斯输入的简化两层网络中为 BCGD 算法建立理论收敛性?
  • RQ5与现有方法相比,BCGD 在低比特量化(如二值化)中可实现哪些性能提升?

主要发现

  • BCGD 在使用全层二值化权重和 4 位自适应激活量化的 ResNet-18 上,于 ImageNet 上实现了 64.36% 的 top-1 准确率。
  • 当第一层和最后一层保持全精度时,BCGD 实现了 65.46% 的 top-1 准确率,表明混合精度微调的优势。
  • 理论分析证明,期望粗梯度与真实梯度的内积为正,从而确保优化过程中的下降方向。
  • 对于具有高斯输入的两层网络,粗梯度被证明与真实梯度具有充分相关性,支持收敛性保证。
  • BCGD 算法在适当步长条件下,可确保目标函数单调下降,并使梯度范数收敛至零。
  • 该方法为量化网络中标准反向传播提供了一种稳定且高效的替代方案,尤其适用于 1 位(二值化)等极端位宽场景。

更好的研究,从现在开始

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

无需绑定信用卡

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