Enhancing Post-Training Quantization Calibration Through Contrastive Learning
- 16 June 2024
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 15921-15930
Abstract
Post-training quantization (PTQ) converts a pre-trained full-precision (FP) model into a quantized model in a training-free manner. Determining suitable quantization parameters, such as scaling factors and zero points, is the primary strategy for mitigating the impact of quantization noise (calibration) and restoring the performance of the quantized models. However, the existing activation calibration methods have never considered information degradation between pre- (FP) and post-quantized activations. In this study, we introduce a well-defined distributional metric from information theory, mutual information, into PTQ calibration. We aim to calibrate the quantized activations by maximizing the mutual information between the pre- and post-quantized activations. To realize this goal, we establish a contrastive learning (CL) framework for the calibration, where the quantization parameters are optimized through a self-supervised proxy task. Specifically, by leveraging CL during the PTQ calibration, we can benefit from pulling the positive pairs of quantized and FP activations collected from the same input samples, while pushing negative pairs from different samples. Thanks to the ingeniously designed critic function, we avoid the unwanted but of tenencountered collision solution in CL, especially in calibration scenarios where the amount of calibration data is limited. Additionally, we provide a theoretical guarantee that minimizing our designed loss is equivalent to maximizing the desired mutual information. Consequently, the quantized activations retain more information, which ultimately enhances the performance of the quantized network. Experimental results show that our method can effectively serve as an add-on module to existing SoTA PTQ methods.Keywords
Funding Information
- NSF (IIS-2309073,ECCS-212352101)
This publication has 20 references indexed in Scilit:
- Network Binarization via Contrastive Learning2022
- Lipschitz Continuity Retained Binary Neural Network2022
- Loss aware post-training quantizationMachine Learning, 2021
- Momentum Contrast for Unsupervised Visual Representation Learning2020
- MnasNet: Platform-Aware Neural Architecture Search for Mobile2019
- MobileNetV2: Inverted Residuals and Linear Bottlenecks2018
- Unsupervised Feature Learning via Non-parametric Instance Discrimination2018
- Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference2018
- Deep Residual Learning for Image Recognition2016
- ImageNet: A large-scale hierarchical image database2009