[Paper Review] Nonuniform-to-Uniform Quantization: Towards Accurate Quantization via Generalized Straight-Through Estimation
This paper proposes Nonuniform-to-Uniform Quantization (N2UQ), a novel quantization method that learns flexible, non-uniform input thresholds for uniform quantization, enabling high accuracy like nonuniform quantization while maintaining hardware efficiency. It introduces a Generalized Straight-Through Estimator (G-STE) for gradient backpropagation through thresholds and entropy-preserving regularization, achieving state-of-the-art accuracy with 2-bit ResNet-50 at 69.7% top-1 accuracy on ImageNet—just 0.6% below the full-precision model.
The nonuniform quantization strategy for compressing neural networks usually achieves better performance than its counterpart, i.e., uniform strategy, due to its superior representational capacity. However, many nonuniform quantization methods overlook the complicated projection process in implementing the nonuniformly quantized weights/activations, which incurs non-negligible time and space overhead in hardware deployment. In this study, we propose Nonuniform-to-Uniform Quantization (N2UQ), a method that can maintain the strong representation ability of nonuniform methods while being hardware-friendly and efficient as the uniform quantization for model inference. We achieve this through learning the flexible in-equidistant input thresholds to better fit the underlying distribution while quantizing these real-valued inputs into equidistant output levels. To train the quantized network with learnable input thresholds, we introduce a generalized straight-through estimator (G-STE) for intractable backward derivative calculation w.r.t. threshold parameters. Additionally, we consider entropy preserving regularization to further reduce information loss in weight quantization. Even under this adverse constraint of imposing uniformly quantized weights and activations, our N2UQ outperforms state-of-the-art nonuniform quantization methods by 0.5~1.7 on ImageNet, demonstrating the contribution of N2UQ design. Code and models are available at: https://github.com/liuzechun/Nonuniform-to-Uniform-Quantization.
Motivation & Objective
- To bridge the performance gap between nonuniform and uniform quantization by enabling flexible input threshold learning while preserving uniform output levels.
- To address the intractable gradient problem in training non-uniform input thresholds for uniform quantizers.
- To reduce quantization error and information loss in low-bit DNNs through entropy-preserving regularization.
- To maintain hardware efficiency by avoiding post-processing for non-uniform outputs, enabling direct bitwise operations.
Proposed method
- Proposes a Nonuniform-to-Uniform Quantizer (N2UQ) that learns non-uniform input thresholds while producing equidistant output levels.
- Introduces a Generalized Straight-Through Estimator (G-STE) derived from stochastic quantization, enabling gradient flow through non-uniform thresholds.
- Uses expectation-based backward approximation in G-STE to handle intractable gradients for threshold parameters.
- Applies entropy-preserving regularization to minimize information loss during weight quantization by adapting to the underlying weight distribution.
- Employs a differentiable quantization function that maps real-valued inputs to uniform output levels based on learned thresholds.
- Trains the entire network end-to-end with backpropagation using G-STE and regularization, enabling joint optimization of thresholds and network weights.
Experimental results
Research questions
- RQ1Can a quantization method achieve the representational power of nonuniform quantization while remaining hardware-efficient like uniform quantization?
- RQ2How can gradients be effectively backpropagated through learnable, non-uniform input thresholds in a uniform quantization framework?
- RQ3What regularization strategy best preserves information during low-bit weight quantization?
- RQ4Can a unified training framework with learnable thresholds and entropy-aware regularization outperform existing nonuniform quantization methods?
Key findings
- N2UQ achieves 69.7% top-1 accuracy on ImageNet with 2-bit quantized ResNet-18, narrowing the gap to the full-precision model to only 2.1%.
- The 2-bit N2UQ ResNet-50 achieves 67.1% top-1 accuracy, just 0.6% below the full-precision counterpart.
- The proposed G-STE method enables effective training of non-uniform input thresholds, improving accuracy by 3.0% over the baseline uniform quantization method.
- Entropy-preserving weight regularization improves accuracy by 1.9% compared to the baseline, outperforming weight norm and learnable scaling factor baselines.
- Ablation studies confirm that both threshold learning and entropy regularization are essential, with their combination yielding the highest performance.
- The learned thresholds adapt to data distribution—smaller intervals in dense regions and larger in sparse tails—reducing quantization error.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.