Differentiable Model Compression via Pseudo Quantization Noise

Alexandre Défossez, Yossi Adi, Gabriel Synnaeve
4/20/2021
stat.MLcs.AIcs.LG
quantization-pruning

Official code: facebookresearch/diffq (238 stars, Python, last commit 2023-05-05).

Abstract

We propose DiffQ a differentiable method for model compression for quantizing model parameters without gradient approximations (e.g., Straight Through Estimator). We suggest adding independent pseudo quantization noise to model parameters during training to approximate the effect of a quantization operator.

Show full abstract

DiffQ is differentiable both with respect to the unquantized weights and the number of bits used. Given a single hyper-parameter balancing between the quantized model size and accuracy, DiffQ optimizes the number of bits used per individual weight or groups of weights, in end-to-end training. We experimentally verify that our method is competitive with STE based quantization techniques on several benchmarks and architectures for image classification, language modeling, and audio source separation. For instance, on the ImageNet dataset, DiffQ compresses a 12 layers transformer-based model by more than a factor of 8, (lower than 4 bits precision per weight on average), with a loss of 0.3% in model accuracy. Code is available at github.com/facebookresearch/diffq.

View on arXivView PDF

Code Implementations(1)

DiffQ performs differentiable quantization using pseudo quantization noise. It can automatically tune the number of bits used per weight or group of weights, in order to achieve a given trade-off between model size and accuracy.

23817Python, CythonFeb 18, 20213 years agoNOASSERTION

Similar Papers

Cite this paper

@article{dfossez2021differentiable,
  title  = {Differentiable Model Compression via Pseudo Quantization Noise},
  author = {Alexandre Défossez and Yossi Adi and Gabriel Synnaeve},
  year   = {2021},
  eprint = {2104.09987},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2104.09987}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2104.09987.svg)](https://codeofpaper.com/paper/2104.09987)

Discussion