TL;DR
Mixed-Precision Quantization (MPQ) optimizes neural networks by varying layer bitwidths, but finding the right policy on large datasets is incredibly slow. This paper introduces Adaptive Sharpness-Aware Gradient Aligning (ASGA), a method that searches for optimal quantization policies on tiny proxy datasets and successfully generalizes them to large-scale targets, boosting search efficiency by up to 150% without sacrificing accuracy.
What Problem Does This Paper Address?
Deep neural networks are often too computationally heavy for edge devices, making quantization (reducing the precision of weights and activations) essential. Mixed-Precision Quantization (MPQ) goes a step further than fixed-precision quantization by assigning different bitwidths to different layers based on their sensitivity to noise.
However, finding the optimal bitwidth configuration (the "policy") requires searching across an exponential space. Doing this on massive datasets like ImageNet is computationally brutal—often requiring dozens of GPU hours. While using a smaller "proxy" dataset (like CIFAR10) seems like an obvious fix, it usually fails miserably, losing up to 10% in accuracy due to data distribution shifts and small data volumes. The authors address this generalization gap, aiming to find a highly transferable MPQ policy using small proxy datasets.
Methods
The core contribution is Adaptive Sharpness-Aware Gradient Aligning (ASGA). It builds on the concept of Sharpness-Aware Minimization (SAM) to find a "flat" region in the loss landscape, which inherently generalizes better across datasets.
To make sharpness-based optimization work effectively for MPQ, the authors introduce two key innovations:
- Implicit Gradient Direction Alignment: Standard SAM suffers from gradient conflicts when trying to minimize both the standard task loss and the sharpness (surrogate gap) simultaneously. ASGA implicitly aligns these gradient directions, ensuring smooth optimization of both objectives without intricate feature map calculations.
- Adaptive Perturbation Radius: Instead of using a fixed perturbation radius ($\rho$), ASGA dynamically adjusts $\rho$ based on the current flatness of the loss landscape, accelerating convergence as the search progresses.
The overall pipeline of searching on a proxy dataset and deploying to a large-scale target dataset is illustrated below:
Datasets
- Proxy Datasets (Search Stage): CIFAR10, Flowers, and Food.
- Target Datasets (Deployment/Evaluation Stage): ImageNet (for image classification) and PASCAL VOC (for object detection).
Key Insights and Ideas
- Flatness Equals Transferability: A flatter loss landscape on a tiny proxy dataset serves as a dataset-independent indicator of high generalization on a large target dataset. Minimizing sharpness makes the quantization policy robust against quantization noise.
- Resolving Gradient Conflicts: You cannot simply apply standard SAM to MPQ. Minimizing the surrogate gap often inadvertently increases the empirical loss because their gradients conflict. Aligning them implicitly allows both to be optimized effectively.
- Proxy Similarity Matters: The choice of proxy dataset isn't entirely random. Proxy datasets with higher class-level similarity to the target dataset (e.g., CIFAR10 to ImageNet) yield more robust and transferable policies than less similar ones (e.g., Flowers to ImageNet).
Key Results
- Massive Speedups: Compared to state-of-the-art MPQ methods, ASGA achieves a 150% search speedup for ResNet18, 127% for ResNet50, and 113% for MobileNet-V2.
- Tiny Data, Big Results: By searching on CIFAR10 (just 0.5% the size of the ImageNet training set), ASGA yielded an MPQ policy that achieved equivalent or better Top-1 accuracy on ImageNet compared to heavy, full-dataset searches.
- Object Detection Efficiency: On PASCAL VOC using Faster R-CNN (ResNet18), applying ASGA achieved the same accuracy as the baseline but required only 77% of the search cost.
Limitations and Future Work
- Proxy Dataset Selection: While the method is highly generalizable, performance still depends on the semantic and class-level alignment between the proxy and target datasets. If the proxy dataset is too divergent, the policy transferability degrades.
- Future Work: The paper does not explicitly outline a dedicated future work section, but the findings suggest that exploring automated proxy dataset selection or synthetic proxy data generation could be a promising next step to eliminate manual proxy selection.
Summary updated