SEAM: Searching Transferable Mixed-Precision Quantization Policy through Large Margin Regularization

Chen Tang, Kai Ouyang, Zenghao Chai, Yunpeng Bai, Yuan Meng, Zhi Wang, Wenwu Zhu

TL;DR

SEAM (Searching Transferable Mixed-Precision Quantization) dramatically accelerates the search for optimal bit-width policies by using tiny proxy datasets instead of massive training sets. By introducing a large-margin regularization that preserves class discriminability in the feature space, SEAM achieves up to a 300× search speedup while maintaining the accuracy of policies searched on full-scale datasets like ImageNet.

What Problem Does This Paper Address?

Mixed-precision quantization (MPQ) is a powerful technique for compressing deep neural networks by assigning different bit-widths to different layers based on their sensitivity. However, finding the "optimal" policy—the specific bit-width for every layer—is a combinatorial nightmare.

Standard methods search for these policies using the same large-scale dataset used for training (e.g., ImageNet). This is computationally expensive, often taking hundreds of GPU hours. While one might try searching on a smaller "proxy" dataset to save time, this usually leads to poor results because the searched policy doesn't generalize well to the target task. The authors identify a key reason for this: sub-optimal quantization noise narrows class margins and blurs decision boundaries in the feature space, making the model less robust when transferred to new data distributions.

Methods

The authors propose SEAM, which decouples the search dataset from the training dataset. The core innovation is a search objective that prioritizes discriminative feature learning over simple cross-entropy accuracy on the proxy data.

  1. Differentiable Search: SEAM uses a differentiable search space where bit-widths are treated as learnable weights in a Directed Acyclic Graph (DAG).
  2. Large-Margin Regularization: Instead of just optimizing for proxy-task accuracy, SEAM introduces a loss term that enforces intra-class compactness (features of the same class cluster together) and inter-class separation (features of different classes are pushed apart).
  3. Gaussian Mixture Assumption: To mathematically formulate this margin, they assume deep features follow a Gaussian Mixture Distribution (GMD). This allows them to derive an additive inter-class margin that explicitly counters the "blurring" effect of quantization noise.
The SEAM framework: Searching on a small proxy dataset with large-margin constraints before deploying the learned policy to a large-scale target dataset.

Datasets

  • Proxy Datasets ($D_{search}$): Used for the policy search. The authors used CIFAR-10 (50,000 images) and StanfordCars (8,144 images).
  • Target Dataset ($D_{train}$): The large-scale dataset the model is ultimately intended for. They used ISLVRC-2012 (ImageNet), which contains over 1.28 million images.
  • Ablation Proxy: They also tested a 4% random subset of ImageNet to compare against using a different domain (like CIFAR) as a proxy.

Key Insights and Ideas

  • Quantization as Noise: The authors visualize how quantization "squeezes" class clusters together in the feature space. A good MPQ policy is one that minimizes this specific type of structural damage to the feature space.
  • Transferability via Geometry: The property of "clear class separation" is largely dataset-independent. If a bit-width configuration preserves clear boundaries on CIFAR-10, it is highly likely to do the same for ImageNet, even though the classes are different.
  • Class-Level vs. Instance-Level: Previous attempts at proxy-based search (like GMPQ) focused on instance-level attribution (e.g., Grad-CAM). SEAM argues that class-level information is "more luxuriant" and provides a more stable signal for searching transferable policies.
t-SNE visualization showing how standard quantization (b) blurs class boundaries compared to full-precision (a), and how SEAM (c) restores clear separation.

Key Results

  • Massive Efficiency Gains: SEAM achieved a 375× speedup for ResNet18 and a 300× speedup for MobileNetv1 compared to the state-of-the-art FracBits method.
  • Data Efficiency: High-quality policies were found using a proxy dataset only 4% the size of the target dataset.
  • State-of-the-Art Accuracy:
    • On ResNet18, SEAM achieved 70.0% Top-1 accuracy at 3-bit mixed precision, losing only 0.5% compared to the full-precision model.
  • On MobileNetv1, it achieved nearly 70% Top-1 accuracy at 3-bit levels, a significant milestone for such a compact architecture.
  • Domain Transfer: Even using a highly specific proxy like StanfordCars (only car images) to search for an ImageNet policy yielded competitive results, proving the robustness of the large-margin approach.
Complexity-accuracy trade-off for ResNet18 and MobileNet, showing SEAM consistently outperforming baselines like LSQ and EdMIPS.

Limitations and Future Work

  • Proxy Similarity: While SEAM is robust, the authors noted that proxy datasets with higher class-level similarity to the target (e.g., CIFAR-10 vs. ImageNet) still perform slightly better than completely disparate ones (e.g., StanfordCars).
  • Hyperparameter Tuning: While less "fussy" than previous methods, SEAM still requires setting the regularization weight ($\lambda$) and the margin ($m$).
  • Task Expansion: The current work focuses on image classification. Future research could explore whether these large-margin properties transfer as effectively for regression-heavy tasks like object detection or segmentation.

Summary updated

BibTeX
@inproceedings{tang2023seam,
  author = {Chen Tang and Kai Ouyang and Zenghao Chai and Yunpeng Bai and Yuan Meng and Zhi Wang and Wenwu Zhu},
  title = {{SEAM: Searching Transferable Mixed-Precision Quantization Policy through Large Margin Regularization}},
  booktitle = {ACM Multimedia},
  year = {2023},
  doi = {10.1145/3581783.3611975},
}
Figure