NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Efficient Quantization for Neural Networks with Binary Weights and Low Bitwidth Activations

Kun Huang, Bingbing Ni, Xiaokang Yang

Abstract

Researchers from Shanghai Jiao Tong University have developed a new quantization framework that achieves state-of-the-art accuracy for highly compressed neural networks. By introducing a learnable activation function called CReLU and a multi-level binarization strategy for weights, they achieved a 10.85× theoretical speedup on ResNet-18 while significantly outperforming previous binary-weight models on the challenging ImageNet dataset.

Introduction

Deep Neural Networks (DNNs) are notoriously power-hungry and memory-intensive. While they dominate fields like computer vision, deploying a model like AlexNet (with 61 million parameters) on a smartphone or an embedded "Internet of Things" (IoT) device is a massive challenge.

Quantization—reducing the precision of weights and activations from 32-bit floating-point numbers to just 1 or 2 bits—is a popular solution. However, existing methods often suffer from a "one-size-fits-all" problem: they treat weights and activations the same way. This leads to a massive drop in accuracy on large-scale datasets. Specifically, the authors point out that the standard ReLU activation function is "unbounded," meaning it can produce very large values (outliers) that make it nearly impossible to quantize the remaining values accurately without losing critical information.

Methodology

The authors propose a two-pronged approach that treats weights and activations as distinct entities to maximize both efficiency and accuracy.

Overview of the proposed quantization framework showing feed-forward and back-propagation paths.

Clamping Rectified Linear Unit (CReLU)

Instead of using standard ReLU, the authors designed CReLU, which includes a learnable clamping parameter ($c_l$). This parameter acts as a "ceiling" for the activation. During training, the network learns the optimal ceiling to balance two types of errors: clipping error (losing high-value information) and quantization error (losing precision because the range is too wide).

Comparison between standard ReLU (a) and the proposed CReLU (b) with its learnable clamping parameter.

Multi-level Weight Binarization

Rather than a simple +/- 1 binarization, the framework approximates real-valued weights using a sum of multiple binary bases scaled by real coefficients. This allows for much higher representational power while still benefiting from the speed of binary operations.

Refined Gradients and Logarithmic Quantization

The researchers identified a "gradient mismatch" in previous state-of-the-art methods (like XNOR-Net) and derived a more mathematically precise gradient for the backward pass, leading to more stable training. For activations, they offer a logarithmic quantizer option, which allows complex multiplications to be replaced by simple, lightning-fast bit-shift operations in hardware.

Experimental Results

The researchers evaluated their approach on standard computer vision benchmarks including CIFAR-10 and ImageNet (ILSVRC2012) across various architectures like VGG-Net, AlexNet, and ResNet (18, 20, 32, and 50).

  • Superior Accuracy: On ImageNet with ResNet-18, their 1-bit weight / 2-bit activation model achieved a 38.4% Top-1 error, beating the previous best (HWGQ-Net at 40.4%) and significantly outperforming XNOR-Net (46.8%).
  • Massive Speedup: The proposed method offers a 10.85× theoretical speedup for ResNet-18.
  • Minimal Degradation: Using 5-bit activations, the accuracy drop compared to a full 32-bit floating-point model was a negligible 0.3%, while still providing massive memory savings.

Key Insights and Conclusion

The most significant finding is that the unbounded nature of ReLU is the primary enemy of low-bitwidth quantization. By simply "clamping" the activations and making that clamp learnable, the network can adaptively find the "sweet spot" for quantization. Furthermore, weights and activations require asymmetric treatment: weights should be approximated closely via multi-level binarization, while activations should be constrained to favor hardware efficiency.

While the paper demonstrates impressive theoretical speedups, realizing these gains in the real world requires specialized hardware like FPGAs or custom ASICs. Future work may extend this quantization strategy to more complex tasks like object detection and semantic segmentation.

Summary updated

BibTeX
@inproceedings{huang2019efficient,
  author = {Kun Huang and Bingbing Ni and Xiaokang Yang},
  title = {{Efficient Quantization for Neural Networks with Binary Weights and Low Bitwidth Activations}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
  doi = {10.1609/aaai.v33i01.33013854},
}
Figure