Skip to main content
QUICK REVIEW

[Paper Review] Network Quantization with Element-wise Gradient Scaling

Junghyup Lee, Dohyung Kim|arXiv (Cornell University)|Apr 2, 2021
Advanced Neural Network ApplicationsComputer Science44 references8 citations
TL;DR

This paper proposes Element-wise Gradient Scaling (EWGS), a novel method that adaptively scales gradients during backpropagation in quantized neural networks by considering both the sign of each gradient and discretization errors between continuous inputs and discrete outputs of the quantizer. EWGS improves training stability and accuracy over the standard Straight-Through Estimator (STE), achieving state-of-the-art performance across diverse architectures and bit-widths on CIFAR-10 and ImageNet without additional hyperparameter tuning or training schedules.

ABSTRACT

Network quantization aims at reducing bit-widths of weights and/or activations, particularly important for implementing deep neural networks with limited hardware resources. Most methods use the straight-through estimator (STE) to train quantized networks, which avoids a zero-gradient problem by replacing a derivative of a discretizer (i.e., a round function) with that of an identity function. Although quantized networks exploiting the STE have shown decent performance, the STE is sub-optimal in that it simply propagates the same gradient without considering discretization errors between inputs and outputs of the discretizer. In this paper, we propose an element-wise gradient scaling (EWGS), a simple yet effective alternative to the STE, training a quantized network better than the STE in terms of stability and accuracy. Given a gradient of the discretizer output, EWGS adaptively scales up or down each gradient element, and uses the scaled gradient as the one for the discretizer input to train quantized networks via backpropagation. The scaling is performed depending on both the sign of each gradient element and an error between the continuous input and discrete output of the discretizer. We adjust a scaling factor adaptively using Hessian information of a network. We show extensive experimental results on the image classification datasets, including CIFAR-10 and ImageNet, with diverse network architectures under a wide range of bit-width settings, demonstrating the effectiveness of our method.

Motivation & Objective

  • To address the sub-optimal gradient flow in quantized neural networks caused by the Straight-Through Estimator (STE), which treats all gradients uniformly without considering discretization errors.
  • To improve training stability and accuracy in low-bit network quantization by introducing a more adaptive gradient update mechanism.
  • To develop a method that dynamically adjusts gradient scaling per layer using second-order information, avoiding the need for extensive hyperparameter search.
  • To demonstrate generalization and effectiveness of the proposed method across various network architectures and bit-width configurations.

Proposed method

  • EWGS adaptively scales each gradient element during backpropagation based on the sign of the gradient and the discretization error between the continuous latent input and discrete output of the quantizer.
  • The method uses a scaling factor derived from the trace of the Hessian matrix of the loss with respect to the discrete outputs, estimated efficiently via Hutchinson’s method.
  • The scaling factor is updated adaptively per layer to account for varying sensitivity of quantizers across different layers in the network.
  • The approach replaces the standard STE’s fixed gradient flow with a gradient scaling mechanism that reflects the local curvature and error sensitivity of the discretization process.
  • The method is integrated into existing quantization frameworks without requiring architectural changes or additional training schedules.
  • The gradient scaling is applied element-wise, enabling fine-grained adaptation to the local geometry of the loss landscape around discrete quantization levels.

Experimental results

Research questions

  • RQ1Can gradient scaling that accounts for discretization error improve training stability and accuracy in quantized neural networks compared to the standard STE?
  • RQ2How does adaptive gradient scaling based on Hessian information affect convergence and performance in low-bit network quantization?
  • RQ3Does EWGS generalize across different network architectures and bit-width settings without requiring re-tuning of hyperparameters?
  • RQ4Can EWGS outperform existing quantization methods that use STE, especially in extreme bit-width regimes like 1-bit?
  • RQ5What is the impact of fixed versus adaptive scaling factors on the final model accuracy in quantized networks?

Key findings

  • EWGS achieves a 1% accuracy gain over STE across multiple network architectures, including ResNet-18, MobileNet-V2, and ResNet-20, on ImageNet and CIFAR-10 under various bit-widths.
  • On CIFAR-10 with ResNet-20, EWGS achieves 85.6% top-1 accuracy with 1-bit weights and activations, outperforming STE (84.7%) and matching the best reported result (85.3%) with proper scaling.
  • For weight-only binarized ResNet-18 on ImageNet, EWGS achieves 67.3% top-1 accuracy, compared to 66.3% with STE, demonstrating improved stability and convergence.
  • The method consistently outperforms STE and other baseline quantization methods like PROFIT and DoReFa-Net, showing strong generalization across different frameworks.
  • With a fixed scaling factor of 0.01, EWGS achieves performance comparable to the best-tuned results, indicating robustness without extensive hyperparameter tuning.
  • Training curves show that EWGS leads to lower training losses and higher validation accuracies than STE, especially in challenging 1-bit settings, confirming improved training dynamics.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.