QBitOpt: Fast and Accurate Bitwidth Reallocation during Training

Jorn Peters, Marios Fournarakis, Markus Nagel, Mart van Baalen, Tijmen BlankevoortWorkshops @ ICCV 2023 · DOI

Introduction

Quantizing neural networks—reducing the precision of weights and activations from 32-bit floating point to low-bit integers—is essential for deploying AI on resource-constrained edge devices. However, uniform quantization often leads to significant accuracy drops because different layers exhibit varying sensitivities to noise. Mixed-Precision Quantization (MPQ) addresses this by assigning more bits to sensitive layers and fewer to robust ones.

QBitOpt is a novel framework that treats bitwidth selection as a constrained optimization problem rather than a search task. By automatically reallocating bitwidths during the training process, it achieves higher accuracy than fixed-precision models while strictly adhering to hardware resource limits.

Methodology

QBitOpt formulates bitwidth allocation as a constrained optimization problem. Unlike existing methods that use "soft" penalties in the loss function, QBitOpt minimizes task loss subject to a hard resource constraint (e.g., average bitwidth $\leq$ 3).

Overview of the QBitOpt framework, illustrating the loop between sensitivity estimation, bitwidth optimization, and quantized training.

The framework consists of several key components:

  • FIT Sensitivity: The Fisher Information Trace (FIT) is used to estimate the impact of quantization error in specific layers on the final output. This serves as an efficient proxy for the Hessian diagonal.
  • Pseudo-Quantization Noise (PQN): To maintain differentiability, quantization error is modeled as uniform additive noise during training.
  • Two-Phase Training: In the first phase, weights and bitwidths are updated jointly. Every $\tau$ iterations, a greedy integer solver re-assigns bitwidths based on updated layer sensitivities. In the second phase, bitwidths are frozen for standard Quantization-Aware Training (QAT).
  • Clipped Sensitivities: Sensitivity is calculated using parameters already restricted to the quantization range, better reflecting the actual noise experienced during inference.

Experimental Setup

The authors evaluated QBitOpt on the ImageNet classification benchmark using architectures optimized for efficiency, which are typically difficult to quantize: MobileNetV2, MobileNetV3-Small, and EfficientNet-Lite.

Results and Discussion

QBitOpt consistently outperformed both fixed-precision baselines and state-of-the-art mixed-precision methods. For MobileNetV3-Small at a 3-bit average target, QBitOpt achieved 57.36% accuracy, a 5% improvement over the fixed 3-bit baseline (LSQ) and roughly 1% higher than competing mixed-precision methods like DQ or NIPQ.

Bitwidth allocation stability during training using the greedy integer optimization method.

Key insights from the evaluation include:

  • Dynamic Allocation: Updating bitwidths during training allows weights to adapt to the specific noise profile of their assigned precision.
  • Hard Constraints: Using a solver guarantees that resource constraints are met exactly, avoiding the expensive hyperparameter tuning required by soft-penalty methods.
  • Stability: As shown in the bit allocation plots, the layer precisions typically settle into a stable configuration well before the final fine-tuning phase begins.

Conclusion and Future Work

QBitOpt provides a robust and efficient path for mixed-precision quantization. Future research may explore sensitivity metrics that better capture the "large" perturbations of extremely low-bit (e.g., 2-bit) quantization. Additionally, integrating hardware-specific latency models into the optimization loop could further enhance the framework's utility for real-world deployment on NPUs and DSPs.

Summary updated

BibTeX
@inproceedings{peters2023qbitopt,
  author = {Jorn Peters and Marios Fournarakis and Markus Nagel and Mart van Baalen and Tijmen Blankevoort},
  title = {{QBitOpt: Fast and Accurate Bitwidth Reallocation during Training}},
  booktitle = {Workshops @ ICCV},
  year = {2023},
  doi = {10.1109/iccvw60793.2023.00138},
}
Figure