# Nonuniform-to-Uniform Quantization: Towards Accurate Quantization via Generalized Straight-Through Estimation

Source: [Nonuniform-to-Uniform Quantization: Towards Accurate Quantization via Generalized Straight-Through Estimation](<https://www.sota2.com/research/paper/68fa6c2e1e209131cea329a3>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-12-24T17:01:05.286Z

Authors: Zechun Liu, Kwang-Ting Cheng, Dong Huang, Eric Xing, Zhiqiang Shen

Published: 2021-11-29T18:59:55.000Z

## Abstract

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.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Image Classification on ImageNet (val) (Top-1/Top-5 Accuracy)](<https://www.sota2.com/research/sota/image-classification-on-imagenet-val-top-1-top-5-accuracy.md>): Image Classification; ImageNet (val); Top-1 Accuracy: 72.1.

- [Image Classification on ImageNet 1k (val)](<https://www.sota2.com/research/sota/image-classification-on-imagenet-1k-val.md>): Image Classification; ImageNet-1k (val); Top-1 Accuracy: 78.

- [Language Modeling on C4](<https://www.sota2.com/research/sota/language-modeling-on-c4.md>): Language Modeling; C4; Perplexity: 29.87.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2111.14826>)

[PDF](<https://arxiv.org/pdf/2111.14826.pdf>)

[Implementation](<https://github.com/liuzechun/Nonuniform-to-Uniform-Quantization>)
