Abstract
Deep neural networks, while achieving remarkable success across diverse tasks, demand significant resources, including computation, GPU memory, bandwidth, storage, and energy. Network quantization, as a standard compression and acceleration technique, reduces storage costs and enables potential inference acceleration by discretizing network weights and activations into a finite set of integer values. However, current quantization methods are often complex and sensitive, requiring extensive task-specific hyperparameters, where even a single misconfiguration can impair model performance, limiting generality across different models and tasks. In this paper, we propose Quantization without Tears (QwT), a method that simultaneously achieves quantization speed, accuracy, simplicity, and generality. The key insight of QwT is to incorporate a lightweight additional structure into the quantized network to mitigate information loss during quantization. This structure consists solely of a small set of linear layers, keeping the method simple and efficient. More importantly, it provides a closed-form solution, allowing us to improve accuracy effortlessly under 2 minutes. Extensive experiments across various vision, language, and multimodal tasks demonstrate that QwT is both highly effective and versatile. In fact, our approach offers a robust solution for network quantization that combines simplicity, accuracy, and adaptability, which provides new insights for the design of novel quantization paradigms.
Introduction
The deployment of deep neural networks on edge devices is often hindered by their "resource-greedy" nature. Network quantization—converting high-precision FP32 weights into low-precision integers like INT8 or INT4—is a primary strategy to mitigate these demands. However, existing approaches typically fall into two categories, each with significant drawbacks: Post-Training Quantization (PTQ) is fast but often suffers from substantial accuracy degradation, while Quantization-Aware Training (QAT) achieves high accuracy but is computationally expensive and hyperparameter-sensitive.
The authors identify "structural rigidity" as a fundamental limitation of current methods. Most quantization techniques attempt to force quantized weights to fit the original architecture perfectly. Quantization without Tears (QwT) challenges this paradigm by introducing a slight architectural modification to compensate for quantization errors.
Methods: Breaking Structural Rigidity
The core innovation of QwT is the introduction of a lightweight compensation module ($S_c$). Instead of maintaining an identical architecture to the full-precision model, QwT adds a tiny linear layer $c(x) = Wx + b$ in parallel to each quantized network block.
The output of a QwT-enhanced block is defined as: $$y^{QwT} = l^Z(x^Z) + c(x^Z)$$ where $l^Z$ is the quantized block and $x^Z$ is the input.
Closed-Form Parameter Estimation
A key advantage of QwT is its efficiency. Rather than relying on backpropagation, the parameters $W$ and $b$ are determined using a small calibration set (e.g., 512 images). By treating error correction as a linear regression problem, the optimal weights for the compensation layers can be calculated analytically. This block-by-block correction process accounts for cumulative information loss across the network, allowing for near-instant optimization—typically under two minutes for a standard Vision Transformer (ViT).
Experimental Results
The effectiveness of QwT was evaluated across a diverse array of tasks, including image classification (ImageNet), object detection (COCO), multimodal tasks (CLIP), generative modeling (Diffusion Transformers), and Large Language Models (LLaMA3-8B).
As shown in the experimental data, QwT consistently improves 4-bit quantization accuracy. On ImageNet, accuracy gains averaged 2.6%, with some models experiencing improvements of up to 5%. In generative tasks, QwT significantly reduced FID scores for Diffusion Transformers, producing images that closely resemble FP16 originals. For LLMs like LLaMA3-8B, QwT outperformed established methods like GPTQ in both perplexity and zero-shot reasoning benchmarks.
From a deployment perspective, QwT-enhanced models achieved a 77% reduction in latency compared to FP32 when using NVIDIA TensorRT, with the additional linear layers contributing only a negligible 3% overhead.
Conclusion and Future Work
QwT demonstrates that introducing a small amount of hardware-friendly structure can effectively bridge the accuracy gap in quantized models without the need for complex hyperparameter tuning. While highly effective at 4-bit and 6-bit precision, future work will explore scaling the method to extreme 2-bit quantization. Additionally, the authors suggest investigating methods to "fold" these compensation layers into existing weights to further minimize deployment overhead.
Summary updated