NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Differentiable Dynamic Quantization with Mixed Precision and Adaptive Resolution

Zhaoyang Zhang, Wenqi Shao, Jinwei Gu, Xiaogang Wang, Ping Luo

Abstract

Quantizing deep neural networks is critical for edge deployment but often suffers from suboptimal manual tuning and non-differentiable rounding operations. This paper presents Differentiable Dynamic Quantization (DDQ), a framework that treats bitwidth, dynamic range, and step size as learnable parameters. By employing a differentiable matrix-vector formulation and Kronecker-based bit-gating, DDQ achieves state-of-the-art results, including near-lossless 4-bit quantization of MobileNetV2.

Introduction: The Challenges of Low-Bit Quantization

Deploying Deep Neural Networks (DNNs) on power-constrained edge devices requires aggressive quantization. However, traditional methods are often "brittle" due to two primary factors:

  1. Manual Hyperparameter Tuning: Fixed bitwidths and dynamic ranges are often suboptimal as different layers exhibit varying sensitivities.
  2. The Rounding Problem: Standard rounding functions have zero gradients almost everywhere, hindering gradient-based optimization for low-bit models.

These issues are particularly acute in lightweight architectures like MobileNetV2, where irregular weight distributions and low redundancy make standard uniform quantization ineffective.

The DDQ Framework

DDQ addresses these challenges by making the quantization process fully differentiable. Instead of a hard rounding function, it formulates quantization as a low-precision matrix-vector product, learning a vector of quantization levels ($q$) and a binary selection matrix ($U$).

DDQ adapts quantization levels to weight density, creating dense regions where weights cluster.

Key technical innovations include:

  • Kronecker Composition for Bitwidth: To learn bitwidths differentiably, DDQ uses Kronecker products of small matrices to "gate" individual bits, allowing the model to learn whether a layer requires 2, 4, or 8 bits.
  • Gradient Correction: A correction term $\lambda(x_q - x)$ is introduced to regularize weights toward their quantized counterparts, minimizing quantization error during training.
  • Pareto Optimization: A resource-constrained loss function penalizes excessive memory footprints, forcing the model to find an optimal mixed-precision configuration.

Experimental Evaluation

DDQ was evaluated on ImageNet and CIFAR-10 using ResNet-18 and MobileNetV2.

  • MobileNetV2: Achieved 71.5% top-1 accuracy with 4-bit weights and activations, nearly matching the 71.9% full-precision baseline and outperforming prior methods like PACT (61.4%) and DSQ (64.8%).
  • ResNet-18: DDQ reached 71.3% accuracy at 4-bit, actually surpassing the full-precision baseline of 70.5%.
  • Efficiency: The framework reduced training runtime by 25% compared to previous differentiable methods due to faster convergence and the elimination of complex multi-stage training.

Analysis of Learned Policies

A key insight from DDQ is the importance of Adaptive Resolution. Unlike uniform quantizers, DDQ learns to place denser quantization levels where weights actually cluster, effectively handling irregular distributions.

Learned bitwidth distribution across layers for ResNet18 and MobileNetV2.

The model automatically learns a sensitivity-aware policy. As shown in the layer-wise bitwidth distribution, it tends to allocate higher precision to earlier layers and sensitive depthwise convolutional layers. This automated "mixed-precision" strategy is crucial for maintaining accuracy in compact models.

Conclusion and Future Work

DDQ demonstrates that even highly optimized models like MobileNetV2 can be quantized to 4 bits without significant accuracy loss. While the adaptive resolution levels may require specialized software kernels for maximum hardware benefit, the framework provides a robust path toward automated, high-performance model compression. Future work may extend DDQ to other domains like object detection and natural language processing.

Summary updated

BibTeX
@inproceedings{zhang2021differentiable,
  author = {Zhaoyang Zhang and Wenqi Shao and Jinwei Gu and Xiaogang Wang and Ping Luo},
  title = {{Differentiable Dynamic Quantization with Mixed Precision and Adaptive Resolution}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=AWuKwnX2PoQ},
}
Figure