Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

NoisyQuant: Noisy Bias-Enhanced Post-Training Activation Quantization for Vision Transformers

About

The complicated architecture and high training cost of vision transformers urge the exploration of post-training quantization. However, the heavy-tailed distribution of vision transformer activations hinders the effectiveness of previous post-training quantization methods, even with advanced quantizer designs. Instead of tuning the quantizer to better fit the complicated activation distribution, this paper proposes NoisyQuant, a quantizer-agnostic enhancement for the post-training activation quantization performance of vision transformers. We make a surprising theoretical discovery that for a given quantizer, adding a fixed Uniform noisy bias to the values being quantized can significantly reduce the quantization error under provable conditions. Building on the theoretical insight, NoisyQuant achieves the first success on actively altering the heavy-tailed activation distribution with additive noisy bias to fit a given quantizer. Extensive experiments show NoisyQuant largely improves the post-training quantization performance of vision transformer with minimal computation overhead. For instance, on linear uniform 6-bit activation quantization, NoisyQuant improves SOTA top-1 accuracy on ImageNet by up to 1.7%, 1.1% and 0.5% for ViT, DeiT, and Swin Transformer respectively, achieving on-par or even higher performance than previous nonlinear, mixed-precision quantization.

Yijiang Liu, Huanrui Yang, Zhen Dong, Kurt Keutzer, Li Du, Shanghang Zhang• 2022

Related benchmarks

TaskDatasetResultRank
Image Super-resolutionManga109
PSNR37.47
656
Image Super-resolutionSet5
PSNR37.5
507
Single Image Super-ResolutionUrban100
PSNR31.31
500
Image Super-resolutionSet14
PSNR33.06
329
Image ClassificationImageNet (val)--
300
Object DetectionMS-COCO 2017 (val)
mAP41.4
237
Image Super-resolutionUrban100
PSNR26.66
221
Image Super-resolutionB100
PSNR31.73
51
Image ClassificationImageNet-1k (val)
Top-1 Acc (DeiT-S)79.51
20
Showing 9 of 9 rows

Other info

Follow for update