Abstract
Mixed-Precision Quantization (MPQ) is a critical technique for deploying deep neural networks on resource-constrained edge devices. However, determining the optimal bit-width for each layer remains a computationally expensive challenge due to the vast search space. This paper presents LIMPQ (Learned Importance for Mixed-Precision Quantization), a novel framework that repurposes learnable scale factors from Quantization-Aware Training (QAT) as indicators of layer sensitivity. By employing a joint training scheme and formulating the bit-width selection as an Integer Linear Programming (ILP) problem, LIMPQ achieves state-of-the-art accuracy with a search time speedup of up to 330x compared to reinforcement learning-based methods.
1. Introduction
Quantization reduces the memory footprint and computational requirements of neural networks by representing weights and activations with lower-precision integers (e.g., 4-bit) instead of 32-bit floating-point values. While uniform quantization applies the same bit-width to all layers, Mixed-Precision Quantization (MPQ) recognizes that different layers exhibit varying sensitivity to quantization noise. By assigning higher precision to sensitive layers and lower precision to robust ones, MPQ optimizes the trade-off between model size and predictive performance.
The primary bottleneck in MPQ is the "search" for the optimal configuration. For a network with $L$ layers and $B$ bit-width options, the search space is $B^L$. Traditional approaches, such as Deep Reinforcement Learning (DRL) or Neural Architecture Search (NAS), often require hundreds of GPU hours. Alternatively, Hessian-based methods estimate sensitivity using second-order derivatives of the full-precision model, but these estimates often fail to capture the actual dynamics of the quantized model during training.
2. The LIMPQ Framework
LIMPQ addresses these inefficiencies through three core innovations: scale-based importance indicators, a parallel training scheme, and an ILP-based optimization.
2.1 Scale Factors as Importance Indicators
In standard Quantization-Aware Training (QAT), a learnable scale factor ($s$) is used to map continuous weights into discrete buckets. The authors observe that the magnitude of $s$ reflects a layer's inherent sensitivity: a larger $s$ indicates that the layer is attempting to "stretch" its dynamic range to minimize quantization error. LIMPQ leverages these scale factors as natural proxies for layer importance, eliminating the need for external sensitivity metrics.
2.2 Joint Training for Multi-Bit Indicators
To avoid the cost of training separate models for every possible bit-width, LIMPQ utilizes a joint training scheme inspired by one-shot NAS. During a single QAT session, gradients are calculated for all bit-width options (e.g., 2, 3, 4, 5, and 6 bits) simultaneously. This allows the model to learn the importance indicators for all configurations in a fraction of the time required by iterative methods.
2.3 One-time ILP Search
Once the importance indicators are learned, the selection of bit-widths is no longer a search problem but an optimization problem. LIMPQ formulates this as an Integer Linear Programming (ILP) task. The objective is to minimize the total "importance" (sensitivity) across all layers, subject to resource constraints such as total BitOps or model size. This optimization is solved globally in milliseconds, providing an optimal configuration without the need for trial-and-error evaluation.
3. Experimental Evaluation
The researchers evaluated LIMPQ on the ImageNet (ILSVRC12) dataset using ResNet-18, ResNet-50, and MobileNetV1 architectures.
3.1 Efficiency and Speed
The most striking result is the efficiency of the search process. On ResNet-50, LIMPQ achieved a 330x speedup in policy search compared to AutoQ, a leading DRL-based method. The actual ILP solver requires only 0.06 seconds on a standard Apple M1 CPU to determine the optimal bit-width configuration for ResNet-18.
3.2 Accuracy and Compression
LIMPQ demonstrates superior performance across various architectures:
- ResNet-50: Achieved a 12.2x compression rate with only a 0.6% drop in Top-1 accuracy.
- MobileNetV1: Outperformed existing MPQ methods by up to 4.39% in the 4-bit range. This is particularly significant as MobileNet architectures are notoriously difficult to quantize due to their compact nature.
4. Discussion and Limitations
While LIMPQ drastically reduces search time, it still requires an initial QAT phase to learn the importance indicators and a final fine-tuning phase to recover maximum accuracy. Additionally, the current implementation primarily uses BitOps and model size as constraints. Future iterations could incorporate hardware-specific metrics like latency or energy consumption on specific accelerators. The method also introduces a hyperparameter $\alpha$ to balance weight versus activation importance, which may require tuning for specific hardware targets.
5. Conclusion
LIMPQ represents a significant shift in mixed-precision quantization, moving from expensive iterative searches to an efficient, learning-based optimization. By repurposing existing quantizer parameters as importance metrics, it provides a "free" way to navigate the complex trade-offs of model compression, enabling high-performance neural networks to run on the most resource-constrained edge devices.
Summary updated