Implementation of QwT, a simple, fast, and general approach to network quantization that “adds no tears” to your workflow. QwT augments any PTQ model with lightweight linear compensation layers to recover information lost during quantization .
Minghao Fu, Hao Yu, Jie Shao, Junjie Zhou, Ke Zhu & Jianxin Wu
Quantization without Tears, the Proceedings of the Computer Vision and Pattern Recognition Conference (CVPR)
PDF • CVPR 2025 Version
- Fast: closed‐form compensation parameters can be computed on a small calibration set in under 2 minutes.
- Accurate: outperforms standard PTQ methods without any back‐prop.
- Simple: zero task‐specific hyperparameters; only a few linear layers (
W, b) per block. - General: applies to CNNs (ResNet), Transformers (ViT, Swin), detection (Mask R-CNN, DETR), segmentation, multi‐modal (CLIP), generative (DiT) and LLMs (LLaMA).
- Practical: integrates seamlessly with TensorRT or any existing INT8/PTQ pipeline.
- 2025-09-30: Release code implementing QwT + RepQ-ViT for CLIP-based multimodal recognition.

- 2025-07-22: Release code implementing QwT with pytorch‑percentile, along with latency‑testing scripts to reproduce the results in Table 2 of our paper.
- 2025-06-23: Release code implementing QwT + ResNet, evaluated on ImageNet.
- 2025-06-09: Release code showcasing QwT integrated with the baseline PTQ method RepQ-ViT for both classification and detection tasks.
- 2025-02-27: QwT is accepted by CVPR 2025 link.
- 2024-11-21: QwT preprint published on (arXiv:2411.13918).
- To install QwT and develop locally:
git clone https://github.com/wujx2001/qwt.git
cd qwtFor detailed reproduction instructions, please refer to:
- QwT-CLIP-Classification (RepQ‑ViT) README — Reproduce QwT zero-shot classification results using RepQ‑ViT on CLIP model.
- QwT-Classification (PyTorch‑Percentile) README — Reproduce QwT ImageNet classification results using the PyTorch‑Percentile method and measure inference latency.
- QwT-Classification (RepQ‑ViT) README — Reproduce QwT ImageNet classification results using RepQ‑ViT (vit & swin) and the Percentile (resnet) baseline.
- QwT-Detection (RepQ‑ViT) README — Reproduce QwT COCO detection results using the RepQ‑ViT baseline.
This implementation builds on code from RepQ-ViT and leverages the timm library.
We would greatly appreciate it if you could cite our paper if you find our implementation helpful in your work.
@InProceedings{Fu_2025_CVPR,
author = {Fu, Minghao and Yu, Hao and Shao, Jie and Zhou, Junjie and Zhu, Ke and Wu, Jianxin},
title = {Quantization without Tears},
booktitle = {Proceedings of the Computer Vision and Pattern Recognition Conference (CVPR)},
month = {June},
year = {2025},
pages = {4462-4472}
}