# TSPTQ-ViT: Two-scaled post-training quantization for vision transformer

Source: [TSPTQ-ViT: Two-scaled post-training quantization for vision transformer](<https://www.sota2.com/research/paper/68fa7fe31e209131cea9b623>)

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

Data updated: 2025-10-26T06:54:31.635Z

Authors: Yu-Shan Tai, Ming-Guang Lin, An-Yeu (Andy) Wu

Published: 2023-05-22T10:35:23.000Z

## Abstract

Vision transformers (ViTs) have achieved remarkable performance in various computer vision tasks. However, intensive memory and computation requirements impede ViTs from running on resource-constrained edge devices. Due to the non-normally distributed values after Softmax and GeLU, post-training quantization on ViTs results in severe accuracy degradation. Moreover, conventional methods fail to address the high channel-wise variance in LayerNorm. To reduce the quantization loss and improve classification accuracy, we propose a two-scaled post-training quantization scheme for vision transformer (TSPTQ-ViT). We design the value-aware two-scaled scaling factors (V-2SF) specialized for post-Softmax and post-GeLU values, which leverage the bit sparsity in non-normal distribution to save bit-widths. In addition, the outlier-aware two-scaled scaling factors (O-2SF) are introduced to LayerNorm, alleviating the dominant impacts from outlier values. Our experimental results show that the proposed methods reach near-lossless accuracy drops (\<0.5%) on the ImageNet classification task under 8-bit fully quantized ViTs.

## 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.

## Original sources and implementation

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

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