Soft Quantization: Model Compression Via Weight Coupling
Daniel T. Bernstein, Luca Di Carlo, David Schwab
TL;DR
Soft quantization introduces a layer-wise short-range attractive coupling among weights during fine-tuning, implemented via a compression term $\mathcal{L}_C(\boldsymbol{\theta})=\sum_l h_l \sum_{i\neq j} U_{w_l}(\theta_i^{(l)}-\theta_j^{(l)})$, where $U_w$ is a short-range triangular well and the two global hyperparameters $h$ and $w$ control strength and range. The coupling drives weights into discrete clusters, yielding layer-dependent effective bit-widths that are computed from the resulting cluster counts, with an efficient histogram-based approximation to form the effective potential $V_{w_l}$. On ResNet-20 trained on CIFAR-10, softly quantized models outperform histogram-equalized post-training quantization (HEQ) and achieve mixed-precision representations with low variability across runs, particularly for settings that beat 4-bit HEQ. The work links compression to loss-landscape geometry, provides a scalable compression pipeline, and suggests directions for applying soft quantization to larger models and contexts such as transfer and continual learning.
Abstract
We show that introducing short-range attractive couplings between the weights of a neural network during training provides a novel avenue for model quantization. These couplings rapidly induce the discretization of a model's weight distribution, and they do so in a mixed-precision manner despite only relying on two additional hyperparameters. We demonstrate that, within an appropriate range of hyperparameters, our "soft quantization'' scheme outperforms histogram-equalized post-training quantization on ResNet-20/CIFAR-10. Soft quantization provides both a new pipeline for the flexible compression of machine learning models and a new tool for investigating the trade-off between compression and generalization in high-dimensional loss landscapes.
