Bridging the Accuracy Gap for 2-bit Quantized Neural Networks (QNN)

Jungwook Choi, Pierce I-Jen Chuang, Zhuo Wang, Swagath Venkataramani, Vijayalakshmi Srinivasan, Kailash GopalakrishnanarXiv 2018

Abstract

Deep learning algorithms achieve high classification accuracy at the expense of significant computation cost. In order to reduce this cost, several quantization schemes have gained attention recently with some focusing on weight quantization, and others focusing on quantizing activations. This paper proposes novel techniques that target weight and activation quantizations separately resulting in an overall quantized neural network (QNN). The activation quantization technique, PArameterized Clipping acTivation (PACT), uses an activation clipping parameter $\alpha$ that is optimized during training to find the right quantization scale. The weight quantization scheme, statistics-aware weight binning (SAWB), finds the optimal scaling factor that minimizes the quantization error based on the statistical characteristics of the distribution of weights without the need for an exhaustive search. The combination of PACT and SAWB results in a 2-bit QNN that achieves state-of-the-art classification accuracy (comparable to full precision networks) across a range of popular models and datasets.

Introduction

Deep Convolutional Neural Networks (CNNs) are notoriously power-hungry and memory-intensive, posing significant challenges for deployment on "edge" devices like smartphones or IoT sensors. Quantization—reducing the precision of weights and activations from 32-bit floating point to ultra-low formats like 2-bit—is a primary strategy for efficiency. However, a persistent "accuracy gap" exists: compressing models to just 2 bits often causes performance to plummet due to rounding errors. Previous solutions often involved "widening" the network (increasing channel counts), which increases computational overhead and negates the benefits of quantization. This work introduces PACT and SAWB to bridge this gap without architectural expansion.

Methodology

The proposed approach handles activations and weights through two distinct, optimized mechanisms.

PACT: PArameterized Clipping acTivation

Standard quantization typically clips activation values to a fixed range (e.g., [0, 1]). PACT introduces a learnable parameter, $\alpha$, which defines the clipping threshold. During training, $\alpha$ is optimized via gradient descent alongside the network weights. This allows the network to dynamically balance clipping error (loss of high-value information) against quantization error (rounding noise).

PACT activation function definition and the convergence of learnable clipping parameters (alpha) during training.

As shown in Figure 6, the clipping parameter $\alpha$ converges to stable values across different layers, demonstrating that the network "self-calibrates" its dynamic range. This makes PACT as expressive as a standard ReLU; if a wider range is needed, $\alpha$ increases, and if higher precision is required for smaller values, $\alpha$ decreases.

SAWB: Statistics-Aware Weight Binning

For weights, the authors developed SAWB to avoid the high cost of exhaustive searches for optimal scaling factors. SAWB leverages the statistical properties of weight distributions (mean and variance). By applying an empirical formula derived from common distributions like Gaussian or Laplace, SAWB calculates an optimal scaling factor in $O(n)$ time.

Additionally, the authors found that maintaining "shortcut" connections in ResNet architectures at full precision is critical. Quantizing these paths severely hampers gradient flow, whereas keeping them in high precision significantly improves training stability.

Experimental Results

The researchers evaluated the PACT and SAWB combination on CIFAR-10 and ImageNet using various ResNet architectures and AlexNet.

Accuracy degradation comparison across different quantization bit-widths.

As illustrated in Figure 1, the proposed method ("Ours") consistently outperforms existing schemes like WRPN and WEQ, particularly in the challenging W2-A2 (2-bit weights and activations) regime. Key highlights include:

  • AlexNet: Achieved zero accuracy degradation at W2-A2 precision.
  • ResNet-50 on ImageNet: Reached 74.2% top-1 accuracy at 2-bit precision, a significant improvement over DoReFa-Net, which suffered a nearly 10% drop.
  • Efficiency: Unlike WRPN, which requires doubling the number of channels to maintain accuracy, this approach preserves the original architecture, avoiding a 4x increase in operations (MACs).

Conclusion

By making quantization learnable (PACT) and statistically aware (SAWB), this work demonstrates that 2-bit QNNs can achieve performance comparable to full-precision models. Future work includes exploring full quantization of the first and last layers and adapting SAWB to handle dynamic shifts in weight distributions during training. These advancements pave the way for highly efficient, high-performance AI on specialized low-bit hardware accelerators.

Summary updated

BibTeX
@misc{choi2018bridging,
  author = {Jungwook Choi and Pierce I-Jen Chuang and Zhuo Wang and Swagath Venkataramani and Vijayalakshmi Srinivasan and Kailash Gopalakrishnan},
  title = {{Bridging the Accuracy Gap for 2-bit Quantized Neural Networks (QNN)}},
  year = {2018},
  eprint = {1807.06964},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1807.06964},
}
Figure