A Novel Low-Bit Quantization Strategy for Compressing Deep Neural Networks

Xin Long, Xiangrong Zeng, Zongcheng Ben, Dianle Zhou, Maojun ZhangComputational 2020

TL;DR

This paper introduces a novel strategy for compressing deep neural networks by quantizing both weights and activations to very low bitwidths. Their method replaces costly floating-point operations with efficient shift operations, significantly reducing memory and computational requirements for deployment on resource-constrained devices like ASICs and FPGAs, with only a minor drop in accuracy.

What Problem Does This Paper Address?

Deep neural networks (DNNs) have become incredibly powerful, driving advancements in areas like image recognition and natural language processing. However, their complexity comes at a cost: massive memory consumption and high computational demands. This makes it challenging to deploy these sophisticated models on devices with limited resources, such as mobile phones, embedded systems, ASICs, and FPGAs. The paper aims to tackle this by developing a method to drastically compress DNNs while minimizing accuracy loss.

Methods

The core of this paper's contribution lies in a novel low-bit quantization strategy that addresses two key challenges:

  • Low-Bit Activation Approximation: The authors propose a method to discretize network activations using only zero or powers of two. This approximation reduces the computational cost and memory footprint associated with activation storage. They formulate this as an optimization problem to find the best quantization intervals and corresponding discrete values, aiming to minimize the mean-squared error.
  • Weight Quantization and Update Mechanism: To avoid the common issue of gradient mismatch during training with quantized weights, the paper introduces a special update mechanism. This mechanism discretizes weights into a constrained domain (specifically, zero or powers of two) and ensures that the weight updates are also performed within this discrete space. This allows for the replacement of expensive multiply-accumulate operations with cheaper shift operations during inference. They also introduce a "Discrete State Transformation" (DST) to manage weight updates in the backward pass.

The overall approach involves quantizing both weights and activations to low bitwidths, enabling the replacement of full-precision operations with bitwise shifts.

Datasets

The proposed method was evaluated on the following standard datasets:

  • MNIST
  • SVHN
  • CIFAR10
  • CIFAR100

Key Insights and Ideas

  • Shift Operations for Efficiency: The fundamental insight is that by quantizing both weights and activations to specific low-bit representations (especially powers of two), complex floating-point multiplications can be replaced by simple bit shifts. This is a significant hardware acceleration opportunity.
  • Addressing Gradient Mismatch: A critical challenge in training quantized networks is ensuring that gradients can be effectively propagated backward. The paper's novel weight update mechanism is designed to specifically address this, allowing for end-to-end training of low-bit networks.
  • Sparsity as a Byproduct: The quantization process, particularly for weights, can lead to significant sparsity in the network. This sparsity is an additional benefit that can further aid compression and potentially enable pruning of less important connections.
  • Activation Quantization Impact: While weight quantization significantly impacts accuracy, the paper suggests that the choice of activation quantization method has a less dramatic effect on overall test accuracy, though it can influence training fluctuations.

Key Results

  • Significant Compression: The proposed method achieves substantial compression of deep neural networks, reducing memory consumption and computational cost.
  • Accuracy Trade-off: The method results in a slight loss of accuracy, which is a common trade-off in quantization techniques. For example, on CIFAR10, their method achieved an accuracy of 92.52% with 3-bit quantization, compared to a full-precision baseline (not explicitly stated but implied to be higher).
  • Hardware Friendliness: The use of shift operations makes the quantized networks highly suitable for implementation on ASICs and FPGAs.
  • Sparsity: The method demonstrates notable sparsity in convolutional layers, with some layers achieving over 50% sparsity.

Limitations and Future Work

  • First Layer Quantization: The authors mention that they do not quantize the first layer of the network in their experiments, suggesting that further investigation into quantizing all layers, including the first, could be a direction for future work.
  • Sparsity Exploitation: While the method naturally induces sparsity, the paper notes that the back layers tend to be sparser. They suggest that further pruning of these sparse layers could lead to even more compact models and reduced training/inference times.
  • Parameter th Tuning: The paper explores the effect of a parameter th that influences weight state fine-tuning probability. They found th=0.5 to be optimal for their experiments, but this parameter might require careful tuning for different network architectures or datasets.
  • Generalizability: While evaluated on several common datasets, further validation on a wider range of complex models and tasks would be beneficial.

Summary updated

BibTeX
@inproceedings{long2020novel,
  author = {Xin Long and Xiangrong Zeng and Zongcheng Ben and Dianle Zhou and Maojun Zhang},
  title = {{A Novel Low-Bit Quantization Strategy for Compressing Deep Neural Networks}},
  booktitle = {Computational},
  year = {2020},
  doi = {10.1155/2020/7839064},
}
Figure