One Model for All Quantization: A Quantized Network Supporting Hot-Swap Bit-Width Adjustment

Qigong Sun, Xiufang Li, Yan Ren, Zhongjian Huang, Xu Liu, Licheng Jiao, Fang LiuarXiv 2021

Abstract

Model quantization is a critical technique for deploying deep neural networks on resource-constrained edge devices. However, traditional quantization-aware training (QAT) and post-training quantization (PTQ) methods are typically tied to a specific target bit-width. Adjusting precision often requires time-consuming fine-tuning or retraining. This paper introduces "One Model for All Quantization" (OMAQ), a framework that supports diverse bit-widths (from 8-bit down to 1-bit) within a single model. By leveraging wavelet decomposition and reconstruction to enhance weight diversity and employing bit-width-specific batch normalization, OMAQ enables "hot-swappable" precision adjustments at runtime. Experimental results on ImageNet and COCO demonstrate that OMAQ achieves performance comparable to dedicated models, significantly outperforming existing robust quantization methods at ultra-low bit-widths.

The Challenge of Static Quantization

Quantization reduces the precision of a neural network's weights and activations (e.g., from 32-bit floating point to 4-bit integers) to accelerate inference and reduce power consumption. Traditionally, this is a static process: a model trained for 8-bit precision cannot simply be switched to 2-bit without its accuracy collapsing.

Existing "robust quantization" methods attempt to provide flexibility, but they often struggle when pushed to ultra-low bit-widths (1-3 bits). Currently, adapting to changing hardware constraints or battery levels requires a "cold-swap"—pausing the application to load and fine-tune a new model specific to the target precision. OMAQ addresses this by creating a single, flexible model capable of maintaining high performance across the entire bit-width spectrum.

Methodology: Multiscale Quantization

The OMAQ framework relies on a Multiscale Quantization approach characterized by three core components:

  1. Wavelet-Based Weight Diversity: To bridge the "distribution gap" between high-bit and low-bit requirements, OMAQ uses Discrete Wavelet Transform (DWT). It decomposes weights into low-frequency "coarse" and high-frequency "fine" components. During inference, the model reconstructs these weights using learnable scale factors ($\alpha$) tailored to the active bit-width. This allows the model to dynamically "reshape" its weight distribution.
  2. Dynamic Quantization Training: The training pipeline involves a "warm-up" phase for Batch Normalization (BN) and quantization parameters, followed by a dynamic training loop. During this loop, the bit-width is randomly adjusted at each step, forcing the shared weights to remain functional across all target precisions.
  3. Bit-Width Specific BN Layers: Because activation distributions shift dramatically between 8-bit and 1-bit, OMAQ maintains separate BN layers for different bit-width candidates to stabilize feature maps.
Overview of the OMAQ framework showing (a) traditional cold-swap vs (b) proposed hot-swap, (c) wavelet-based weight reconstruction, and (d) specific BN layers.

Key Insights and Results

The primary innovation of OMAQ is the realization that a single static weight matrix cannot satisfy the divergent needs of high-bit and low-bit quantization. By using wavelets as a generative tool, the authors create bit-width-specific weight distributions from a shared parameter set with negligible memory overhead.

Performance Benchmarks

The authors evaluated OMAQ on ImageNet (classification) and COCO (object detection/segmentation):

  • Superior Ultra-Low Bit Accuracy: On ResNet-18 (ImageNet), OMAQ achieved 69.1% Top-1 accuracy at 3-bit, surpassing the previous state-of-the-art "KURE" method by 11.8%. At 2-bit, OMAQ reached 71.9% accuracy on ResNet-50, outperforming "Any-Precision DNNs" by 6.7%.
  • Parity with Dedicated Models: Across most bit-widths, the single OMAQ model performed nearly as well as "dedicated" models trained exclusively for one precision.
  • Practical Hot-Swapping: The transition between bit-widths takes approximately 1.2 seconds on a standard CPU for ResNet-50, making it viable for real-time application adjustments based on device state.
(a) Accuracy comparison of OMAQ vs. other quantization methods on ResNet-18. (b) Distribution of weights across different bit-widths.

Conclusion and Future Directions

OMAQ provides a robust solution for deploying flexible, energy-efficient neural networks on edge devices. While the transition to 1-bit (binary) quantization still presents a performance gap compared to higher precisions, the use of wavelet-based reconstruction significantly mitigates this issue. Future work will explore different wavelet bases, such as Daubechies, and aim to further reduce the latency of bit-width adjustments to enable even more seamless hot-swapping.

Summary updated

BibTeX
@misc{sun2021one,
  author = {Qigong Sun and Xiufang Li and Yan Ren and Zhongjian Huang and Xu Liu and Licheng Jiao and Fang Liu},
  title = {{One Model for All Quantization: A Quantized Network Supporting Hot-Swap Bit-Width Adjustment}},
  year = {2021},
  eprint = {2105.01353},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2105.01353},
}
Figure