GDRQ: Group-based Distribution Reshaping for Quantization

Haibao Yu, Tuopu Wen, Guangliang Cheng, Jiankai Sun, Qi Han, Jianping ShiarXiv 2019

Abstract

Deep neural network deployment on edge devices is often limited by computational costs. While quantization offers a solution, low-bit uniform quantization typically suffers from significant accuracy drops due to the mismatch between bell-shaped parameter distributions and uniform quantization bins. We present Group-based Distribution Reshaping for Quantization (GDRQ), a framework that reshapes weight and activation distributions to be "uniform-like" and utilizes group-based scaling factors. These factors are merged into subsequent Batch Normalization layers during inference, providing a "free" boost in model capacity. GDRQ achieves near-floating-point accuracy with 2-bit weights on ImageNet, maintaining compatibility with standard hardware.

Introduction

Quantization reduces the precision of weights and activations to low-bit integers, significantly lowering the memory and computational footprint of deep models. However, standard hardware accelerators are optimized for uniform quantization, which performs poorly on the Gaussian or Laplace distributions naturally found in neural networks. Non-uniform quantization can mitigate this but requires specialized hardware. GDRQ bridges this gap by forcing the model's internal distributions to fit uniform hardware while recovering lost capacity through efficient grouping.

Methodology

Distribution Reshaping via Scale-Clip

The core idea of GDRQ is to adapt the data to the hardware rather than the reverse. During training, the Scale-Clip technique is employed to reshape weights and activations into a uniform-like distribution. By applying a clipping threshold $T = k \cdot \text{mean}(|W|)$, the network is encouraged to distribute its parameters more evenly across the available quantization bins.

Figure 1: Comparison of quantization loss across different weight distributions. The uniform-like distribution (c) minimizes quantization noise compared to Laplace (a) or Gaussian (b) distributions.

As shown in Figure 1, a flatter distribution significantly reduces the quantization error (loss), making it inherently more compatible with the linear quantization used by efficient hardware.

Group-based Quantization (GQ)

To compensate for the reduced expressive power of low-bit representations, GDRQ introduces Group-based Quantization. Filters within a layer are partitioned into several groups, each learning an independent optimal scaling factor $\alpha$.

Figure 2: The GDRQ framework. The top diagram shows group-based quantization during training, while the bottom diagram illustrates the merging of group-wise scaling factors into the Batch Normalization (BN) layer for efficient inference.

The critical advantage of this approach is its zero-cost inference. As illustrated in Figure 2, these group-specific scaling factors can be mathematically folded into the following Batch Normalization (BN) layer. This allows the model to benefit from fine-grained quantization during training without adding any computational overhead during deployment.

Experimental Results

GDRQ was evaluated on standard benchmarks including ImageNet, CIFAR-100, PASCAL VOC, and Cityscapes.

  • ImageNet Classification: On ResNet-50, GDRQ with 2-bit weights and 4-bit activations achieved a Top-1 accuracy of 73.9%, representing only a 0.9% drop from the floating-point baseline (74.8%). This outperforms existing methods like SYQ and FGQ.
  • Downstream Tasks: The framework demonstrated robustness in complex tasks. For object detection on PASCAL VOC (Faster R-CNN) and semantic segmentation on Cityscapes (PSPNet), the performance degradation was negligible, confirming that distribution reshaping preserves essential features.

Conclusion

GDRQ provides a practical path for deploying high-performance, low-bit models on standard hardware. By combining distribution reshaping with a zero-cost group-based scaling mechanism, it achieves state-of-the-art results for uniform quantization. Future work may explore automated group size selection and direct hardware benchmarking to further validate power and latency improvements.

Summary updated

BibTeX
@misc{yu2019gdrq,
  author = {Haibao Yu and Tuopu Wen and Guangliang Cheng and Jiankai Sun and Qi Han and Jianping Shi},
  title = {{GDRQ: Group-based Distribution Reshaping for Quantization}},
  year = {2019},
  eprint = {1908.01477},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1908.01477},
}
Figure