NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

I-ViT: Integer-only Quantization for Efficient Vision Transformer Inference

Zhikai Li, Qingyi Gu

Introduction

Vision Transformers (ViTs) have set new benchmarks in computer vision, yet their deployment is often hindered by high computational costs. While Convolutional Neural Networks (CNNs) are easily quantized to 8-bit integers (INT8), ViTs rely on complex non-linear operations—specifically Softmax, GELU, and LayerNorm—that traditionally necessitate floating-point (FP32) arithmetic.

Standard quantization pipelines typically dequantize data back to FP32 to handle these non-linearities, as shown in Figure 1. This "mixed-precision" approach introduces significant latency bottlenecks and requires specialized hardware. I-ViT addresses this by enabling a purely integer-only computational graph, eliminating the need for floating-point hardware entirely.

Comparison of standard quantization vs. I-ViT integer-only arithmetic.

Methodology: Eliminating the Floating-Point Bottleneck

I-ViT introduces three key approximations to replace standard non-linear functions with hardware-efficient integer operations:

  • Shiftmax: Instead of calculating $e^x$, I-ViT uses a base-2 exponential ($2^x$). Because $2^x$ can be implemented via simple bit-shifting in digital logic, the entire Softmax operation is reduced to shifts and additions.
  • ShiftGELU: Similar to Shiftmax, the GELU activation is approximated using base-2 logic, allowing for efficient integer-only computation through bit-shifting.
  • I-LayerNorm: To handle the square root required for standard deviation, I-ViT employs a lightweight integer iterative method (the Babylonian method), achieving stable precision in just 10 iterations.

These components are integrated into a dyadic arithmetic pipeline, ensuring that scaling factors are managed without ever leaving the integer domain. The system was implemented using the TVM compiler to leverage Turing Tensor Cores (DP4A instructions) on modern NVIDIA GPUs.

Experimental Results

The researchers evaluated I-ViT on ImageNet using ViT, DeiT, and Swin Transformer architectures. The results demonstrate that I-ViT not only accelerates inference but also preserves model accuracy. Surprisingly, the quantized INT8 models often performed slightly better than the FP32 baselines, suggesting that the quantization process may act as a form of regularization.

Top-1 accuracy vs. throughput (Images/s) for DeiT and Swin models.

As illustrated in Figure 2, I-ViT models (Integer DeiT and Integer Swin) significantly outperform their full-precision (FP) counterparts in throughput while maintaining comparable accuracy. On an NVIDIA RTX 2080Ti, I-ViT achieved massive speedups ranging from 3.72× to 4.11×. Furthermore, I-ViT outperformed other state-of-the-art methods like I-BERT, as bit-shifting is more hardware-efficient than the high-order polynomials used in previous integer-only schemes.

Conclusion

I-ViT proves that Vision Transformers can be executed efficiently using integer-only arithmetic without sacrificing performance. By reframing non-linear operations into hardware-friendly bit-shifts, this work paves the way for deploying state-of-the-art ViTs on resource-constrained edge devices where floating-point units are limited or absent. Future research will focus on extending this framework to complex tasks like object detection and semantic segmentation.

Summary updated

BibTeX
@inproceedings{li2022i,
  author = {Zhikai Li and Qingyi Gu},
  title = {{I-ViT: Integer-only Quantization for Efficient Vision Transformer Inference}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2022},
}
Figure