Abstract
Post-training quantization (PTQ) is a critical technique for deploying deep neural networks on edge devices without the need for extensive retraining. However, PTQ often fails at low bitwidths (4-bit and below). This paper identifies the cause as severe cross-layer dependencies in the loss landscape and proposes Loss Aware Post-training Quantization (LAPQ). LAPQ jointly optimizes quantization parameters across all layers, achieving near-baseline accuracy at 4-bit precision.
Introduction
Deploying state-of-the-art Deep Neural Networks (DNNs) on mobile and edge hardware necessitates reducing their memory footprint and computational requirements. Quantization—converting 32-bit floating-point weights and activations into lower-precision integers—is a standard solution. Post-Training Quantization (PTQ) is particularly attractive as it avoids the high cost of retraining and the need for massive original datasets.
Traditional PTQ methods optimize quantization step sizes independently for each layer, typically by minimizing local Mean Squared Error (MSE). While sufficient for 8-bit precision, this "layer-by-layer" approach fails at 4-bit and below. This research addresses why this gap exists and how joint optimization can bridge it.
The Non-Separable Loss Landscape
The core insight of this work is that at low bitwidths, the quantization error in one layer significantly impacts the performance of subsequent layers. At 8-bit precision, the loss landscape is relatively flat and "separable," meaning layers can be optimized in isolation. However, at 4-bit or lower, the landscape becomes steep and highly coupled.
Analysis of the Hessian matrix of the loss function reveals that off-diagonal elements, which represent inter-layer interactions, become dominant at low bitwidths. This coupling means that minimizing local MSE is no longer a reliable proxy for minimizing the global network loss.
Methodology: Loss Aware Post-training Quantization (LAPQ)
To overcome the limitations of layer-wise optimization, the authors propose LAPQ, which directly minimizes the network's overall loss function through a three-stage process:
- Layer-wise Initialization: Instead of a fixed $L_2$ norm minimization, the method evaluates a range of $L_p$ norms to generate candidate quantization step sizes for each layer.
- Quadratic Approximation: Using a small calibration dataset (e.g., 512 images), the actual network loss is evaluated at these candidate points. A quadratic curve is then fitted to approximate the optimal starting point for each layer.
- Joint Optimization: Starting from the approximated optima, Powell's method (a gradient-free optimizer) is used to jointly tune the quantization step sizes of all layers simultaneously. This accounts for the amplification of quantization noise across the network.
Experimental Results
LAPQ was evaluated on ImageNet (vision) and MovieLens-1B (recommendation systems) tasks using small calibration subsets.
Vision Models (ImageNet)
On ResNet-18 with 4-bit weights and activations, LAPQ achieved 68.1% accuracy, nearly matching the full-precision baseline of 69.7%. In contrast, standard MSE-based PTQ collapsed to 43.6%. Similar improvements were observed for ResNet-50 and MobileNet-V2.
Recommendation Systems (MovieLens-1B)
For the Neural Collaborative Filtering (NCF-1B) model at 8-bit precision, LAPQ maintained a 51.0% hit rate (baseline 51.5%), whereas the MSE-based approach dropped to 33.5%.
Conclusion
LAPQ demonstrates that the failure of low-bit PTQ is primarily due to the neglect of inter-layer dependencies. By shifting from local MSE minimization to global loss-aware joint optimization, high-accuracy 4-bit quantization becomes feasible without the overhead of full retraining. While computationally more intensive than layer-wise methods, LAPQ remains a practical and efficient solution for edge deployment.
Summary updated