Understanding the Unfairness in Network Quantization

Bing Liu, Wenjun Miao, Boyu Zhang, Qiankun Zhang, Bin Yuan, Jing Wang, Shenghao Liu, Xianjun Deng

TL;DR

While network quantization is essential for deploying deep learning models on edge devices, it comes with a hidden "unfairness tax." This paper reveals that quantization disproportionately harms accuracy for minority groups due to higher gradient norms and Hessian traces. Surprisingly, it also finds that Quantization-Aware Training (QAT)—the industry standard for maintaining accuracy—actually exacerbates this unfairness more than simpler Post-Training Quantization (PTQ).

What Problem Does This Paper Address?

To run deep neural networks on smartphones or IoT devices, engineers use quantization: converting high-precision 32-bit floating-point weights into low-precision 4-bit or 8-bit integers. While this makes models smaller and faster with minimal loss in overall accuracy, it creates a "disparate impact."

Previous empirical studies noticed that when a model is quantized, the accuracy for certain demographic groups (like minority ethnicities in facial recognition) drops much more sharply than for others. This paper seeks to move beyond observation to explanation: Why does quantization cause this unfairness, and why does the more sophisticated training method (QAT) often make the fairness gap wider than the simpler "plug-and-play" method (PTQ)?

Methods

The authors approach the problem through a mix of theoretical Taylor-series analysis and empirical testing. They focus on two primary quantization algorithms:

  1. Post-Training Quantization (PTQ): Quantizing a pre-trained model directly without further training.
  2. Quantization-Aware Training (QAT): Simulating quantization during the training process so the model can "adapt" to the lower precision.

To analyze the "excessive loss" caused by quantization, they use a second-order Taylor expansion to identify the mathematical drivers of accuracy degradation. Finally, they test two data augmentation strategies—Geometric Transformations (GT) and Random Erasing (RE)—as potential "fairness-preserving" mitigations.

Datasets

The study evaluates models (ResNet and VGG) across four main datasets:

  • UTK-Face: Used for ethnicity classification (naturally imbalanced).
  • FER2013: Used for facial expression recognition (naturally imbalanced).
  • CIFAR-10 & MNIST: Standard image datasets used here as "balanced" baselines.
  • Imbalanced-CIFAR-10 & Imbalanced-MNIST: Artificially skewed versions of the standard datasets created by the authors to isolate the effect of class imbalance on fairness.

Key Insights and Ideas

  • The "Sensitivity" Factors: The authors identify two mathematical culprits for unfairness: the gradient norm and the trace of the Hessian matrix of the group loss function. If a group has high values for these factors, it is "sensitive" to the noise introduced by quantization.
  • The Imbalance Connection: There is a direct negative correlation between group size and these sensitivity factors. Because models learn less effectively from minority groups, those groups end up at a point in the "loss landscape" where the gradient and Hessian are larger. Consequently, quantization noise hits these groups the hardest.
  • The QAT Paradox: Usually, QAT is preferred because it yields higher overall accuracy than PTQ. However, the authors found that QAT is less fair. This is because QAT forces the model to optimize in a "distorted loss landscape" where the interaction between gradient norms and Hessian traces is amplified, leading to even more uneven updates across subgroups.
  • Balanced Data is the Cure: On naturally balanced datasets like CIFAR-10, the fairness gap barely moves as bit-widths decrease. This confirms that the unfairness isn't inherent to quantization itself, but rather how quantization interacts with pre-existing data imbalances.

Key Results

Accuracy degradation across demographic groups for PTQ and QAT, alongside the dataset distribution.
  • Fairness Degradation: On the UTK-Face dataset using ResNet50, moving from 32-bit to 4-bit quantization caused the fairness metric to jump from 2.4% to 18.8% for PTQ, and a staggering 3.3% to 25.4% for QAT.
  • QAT vs. PTQ: While 4-bit QAT achieved better overall accuracy than 4-bit PTQ, the accuracy for the "Others" group in UTK-Face dropped to just 7% in QAT, compared to a much higher (though still degraded) level in PTQ.
  • Mitigation Success: Applying simple data augmentation to balance the training sets worked remarkably well. For 4-bit QAT on UTK-Face, Geometric Transformations reduced the fairness gap from 25.4% down to 2.7%, effectively neutralizing the disparate impact.

Limitations and Future Work

The paper primarily focuses on Computer Vision tasks (classification). The authors acknowledge that these findings need to be validated in other domains like Natural Language Processing (NLP) or object detection. Additionally, while data augmentation is a powerful fix, it requires access to the original training data and the ability to identify protected attributes, which isn't always possible in privacy-sensitive or "black-box" quantization scenarios. Future work may explore algorithmic constraints or regularization techniques that preserve fairness without requiring massive data oversampling.

Summary updated

BibTeX
@inproceedings{liu2025understanding,
  author = {Bing Liu and Wenjun Miao and Boyu Zhang and Qiankun Zhang and Bin Yuan and Jing Wang and Shenghao Liu and Xianjun Deng},
  title = {{Understanding the Unfairness in Network Quantization}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=vC9GJr3m83},
}
Figure