Probabilistic Weight Fixing: Large-scale training of neural network weight uncertainties for quantization

Christopher Subia-Waud, Srinandan DasmahapatraarXiv 2023 · DOI

Introduction

Deep learning models are increasingly deployed on edge devices, yet their massive parameter counts pose a significant challenge due to the "memory wall"—the energy-intensive process of moving high-precision weights from memory to processors. Weight-sharing quantization addresses this by mapping weights to a small set of cluster centers. However, traditional methods are often "value-blind," failing to account for the varying sensitivity of weights based on their architectural position.

Presented at NeurIPS 2023, Probabilistic Weight Fixing (PWFN) is a novel framework that leverages Bayesian uncertainty to identify weights flexible enough for quantization. By treating weights as probability distributions rather than fixed points, PWFN achieves state-of-the-art compression on large-scale models like ResNets and Vision Transformers (ViTs) while maintaining or even improving accuracy.

Methodology

PWFN utilizes Bayesian Neural Networks (BNNs) to learn weight distributions. Instead of a single value, each weight $w$ is modeled as a Gaussian distribution $\mathcal{N}(\mu, \sigma)$.

Variational Relaxation and Regularization

The model is trained using variational inference (Bayes-by-Backprop). A critical innovation is the introduction of a regularization term that encourages the standard deviation ($\sigma$) to increase. A larger $\sigma$ indicates that the weight is more resilient to noise, making it a better candidate for quantization.

Density plots of learned $\mu$ and $\sigma$ parameters under varying regularization strengths $\alpha$. Increasing $\alpha$ shifts the distribution toward higher $\sigma$ values, enhancing the model's noise resilience and its amenability to compression.

Iterative Weight Fixing

The quantization process is iterative. In each round, the algorithm calculates a Mahalanobis-like distance—the distance between the mean $\mu$ and the nearest cluster center $c$, scaled by $\sigma$. Weights with high relative uncertainty are "fixed" to these centers.

The PWFN process: weight distributions $w_i$ are trained with means $\mu_i$ and standard deviations $\sigma_i$. Regularization encourages larger $\sigma$, allowing weights to be moved to quantization cluster centers $c_1$ once they fall within a threshold of uncertainty.

Experimental Results

The researchers evaluated PWFN on ImageNet and CIFAR-10 across several architectures, including ResNet-18/34/50 and DeiT (Data-efficient Image Transformer).

  • Vision Transformers: On DeiT-Tiny, PWFN achieved 71.2% top-1 accuracy (71.5% with an ensemble of sampled weights) using only 296 unique values for over 5.4 million parameters. This represents a 1.6% improvement over previous state-of-the-art methods like Q-ViT.
  • ResNet-50: The method reached 77.5% accuracy with a weight-space entropy of 3.4 bits, outperforming standard 3-bit quantization benchmarks.
  • Training Efficiency: PWFN requires significantly less fine-tuning (approximately 27 epochs) compared to competing methods that often necessitate up to 300 epochs.

Discussion and Conclusion

PWFN demonstrates that uncertainty is a powerful proxy for weight sensitivity. By explicitly training for noise resilience, the framework enables full-network quantization—including sensitive early and late layers—without the typical accuracy degradation. While BNN training introduces some memory overhead due to the doubling of parameters ($\mu$ and $\sigma$), the resulting inference models are highly efficient. Future work may explore applying these learned uncertainties to improve out-of-distribution robustness in compressed models.

Summary updated

BibTeX
@misc{subiawaud2023probabilistic,
  author = {Christopher Subia-Waud and Srinandan Dasmahapatra},
  title = {{Probabilistic Weight Fixing: Large-scale training of neural network weight uncertainties for quantization}},
  year = {2023},
  eprint = {2309.13575},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.13575},
}
Figure