Efficient Activation Quantization via Adaptive Rounding Border for Post-Training Quantization

Zhengyi Li, Cong Guo, Zhanda Zhu, Yangjie Zhou, Yuxian Qiu, Xiaotian Gao, Jingwen Leng, Minyi GuoarXiv 2022

Abstract

Post-training quantization (PTQ) is a critical technique for deploying deep neural networks on resource-constrained hardware. While weight rounding has seen significant optimization, activation quantization typically relies on standard rounding-to-nearest (RTN), which is often suboptimal. We propose AQuant, a framework that reduces output error by replacing the fixed 0.5 rounding border with an adaptive, learnable function of the activation value. To maintain inference efficiency, we employ a coarse-grained border function and joint optimization strategies. Our results demonstrate that AQuant significantly outperforms state-of-the-art methods, achieving 60.31% accuracy on ResNet-18 under extreme 2-bit weight and activation quantization.

Introduction

Quantization is essential for edge deployment, but the standard approach of rounding-to-nearest (RTN) for activations ignores the complex interactions between weights and activations in a dot product. While methods like AdaRound have optimized weight rounding by considering output error, activations have remained largely unoptimized due to their dynamic nature. AQuant addresses this gap by introducing a dynamic rounding rule that adapts to input values at runtime.

The AQuant Framework

Adaptive Rounding Borders

The fundamental innovation of AQuant is the transition from a constant rounding threshold to a functional one. In standard quantization, any value with a fractional part $\ge 0.5$ is rounded up. AQuant generalizes this by defining a border function $B(x) = b_1 \cdot x + b_0$. This allows the quantization process to "decide" the rounding direction based on the magnitude of the activation itself, effectively shifting the decision boundary to minimize the overall layer-wise output error.

Numerical example of AQuant reducing output error through adaptive activation rounding.

Error Cancellation and Optimization

The motivation behind adaptive borders is the "error cancellation effect." Rounding errors in weights and activations can either compound or mitigate each other. By learning the optimal border parameters on a small calibration set (e.g., 1024 samples), AQuant biases the activation rounding to compensate for unavoidable errors in quantized weights.

Comparison of rounding functions: Rounding-to-Nearest (Round), AdaRound (weight-only), and AQuant (adaptive activation border).

Computational Efficiency

To ensure AQuant remains practical for real-time deployment, the authors introduce two key strategies:

  1. Coarse-Grained Borders: Instead of a unique function for every weight-activation pair, parameters are shared across output channels, drastically reducing the number of parameters to learn and store.
  2. Kernel Fusion: The linear border calculation is fused into preceding operations like ReLU or the img2col step. This implementation results in a negligible latency overhead of approximately 0.5%.

Experimental Evaluation

AQuant was evaluated on ImageNet for computer vision and the GLUE benchmark for NLP.

Computer Vision Results

On ResNet-18, AQuant achieves a remarkable 60.31% Top-1 accuracy in the W2A2 (2-bit weight, 2-bit activation) setting. This represents a substantial improvement over previous state-of-the-art PTQ methods like QDrop (54.19%) and BRECQ (51.12%). For mobile-optimized architectures like MobileNetV2, AQuant maintains high performance even at low bitwidths, outperforming baselines by over 2.5% in W2A4 configurations.

NLP Performance

Testing on BERT-base across the GLUE benchmark showed that AQuant (W4A6) improves average accuracy by nearly 2% compared to standard AdaRound, demonstrating the generalizability of adaptive activation rounding across different domains.

Conclusion

AQuant provides a powerful yet efficient framework for activation quantization in PTQ. By moving beyond fixed rounding thresholds to adaptive borders, it enables ultra-low bitwidth quantization with minimal accuracy loss. Future work may involve integrating these adaptive borders into standard deployment engines like TensorRT and exploring their impact on large-scale language models.

Summary updated

BibTeX
@misc{li2022efficient,
  author = {Zhengyi Li and Cong Guo and Zhanda Zhu and Yangjie Zhou and Yuxian Qiu and Xiaotian Gao and Jingwen Leng and Minyi Guo},
  title = {{Efficient Activation Quantization via Adaptive Rounding Border for Post-Training Quantization}},
  year = {2022},
  eprint = {2208.11945},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.11945},
}
Figure