[Paper Review] Blended Coarse Gradient Descent for Full Quantization of Deep Neural Networks
This paper proposes Blended Coarse Gradient Descent (BCGD), a novel optimization method for training fully quantized deep neural networks with extremely low-bit weights and activations. By blending full-precision and quantized weights and using a coarse gradient that correlates positively with the true gradient, BCGD enables stable, convergent training with sufficient descent, achieving 64.36% top-1 accuracy on ImageNet with binary weights and 4-bit activations in ResNet-18.
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.
Motivation & Objective
- Address the challenge of training fully quantized neural networks with piecewise constant activation functions and discrete weights, which render standard backpropagation inapplicable.
- Overcome the issue of zero or near-zero stochastic gradients in quantized networks by introducing a non-gradient-based ascent direction called coarse gradient.
- Develop a training algorithm that ensures sufficient descent in the loss function despite the non-differentiable nature of quantized layers.
- Theoretically justify the effectiveness of the coarse gradient by proving its positive correlation with the true gradient under Gaussian input assumptions.
- Demonstrate state-of-the-art performance in low-bit quantization, particularly binarization, across standard benchmarks like ImageNet.
Proposed method
- Introduce the concept of 'coarse gradient'—an artificial ascent direction not derived from a true gradient but designed to guide optimization in non-differentiable quantized networks.
- Propose the Blended Coarse Gradient Descent (BCGD) algorithm, where weight updates are based on a weighted average of full-precision weights and their quantized counterparts.
- Use a three-valued coarse partial derivative for the quantized ReLU activation function to enable backpropagation through the quantization layer.
- Apply a straight-through estimator with a generalized proxy derivative that is almost everywhere exact, improving gradient approximation stability.
- Integrate the coarse gradient into a stochastic optimization framework with adaptive step size, ensuring monotonic decrease in the objective function.
- Theoretical analysis is grounded in a two-layer neural network model with Gaussian input data, proving that the expected coarse gradient correlates positively with the true gradient.
Experimental results
Research questions
- RQ1Can a non-gradient-based ascent direction (coarse gradient) be used effectively to train fully quantized deep neural networks with discrete weights and activations?
- RQ2Does the blending of full-precision and quantized weights in the BCGD algorithm ensure sufficient descent in the loss function during training?
- RQ3How does the expected coarse gradient relate to the true gradient in terms of correlation, especially in the presence of piecewise constant activation functions?
- RQ4Can theoretical convergence be established for the BCGD algorithm in a simplified two-layer network with Gaussian inputs?
- RQ5What performance gains can be achieved in low-bit quantization (e.g., binarization) using BCGD compared to existing methods?
Key findings
- BCGD achieves 64.36% top-1 accuracy on ImageNet using ResNet-18 with binary weights across all layers and 4-bit adaptive activation quantization.
- When the first and last layers are kept in full precision, BCGD achieves 65.46% top-1 accuracy, demonstrating the benefit of mixed-precision fine-tuning.
- Theoretical analysis proves that the expected coarse gradient has a positive inner product with the true gradient, ensuring descent direction in optimization.
- For a two-layer network with Gaussian inputs, the coarse gradient is shown to be sufficiently correlated with the true gradient, supporting convergence guarantees.
- The BCGD algorithm ensures monotonic decrease in the objective function and convergence of gradient norms to zero under appropriate step size conditions.
- The method provides a stable and effective alternative to standard backpropagation in quantized networks, particularly at extreme bit-widths like 1-bit (binarization).
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.