[Paper Review] Model compression as constrained optimization, with application to neural nets. Part II: quantization
This paper proposes a constrained optimization framework for neural network quantization that alternates between training a real-valued network and quantizing its weights using an adaptive or fixed codebook. The method guarantees convergence to a local optimum and achieves state-of-the-art compression—down to 1 bit per weight—with minimal accuracy loss, outperforming prior quantization methods in both compression ratio and accuracy preservation.
We consider the problem of deep neural net compression by quantization: given a large, reference net, we want to quantize its real-valued weights using a codebook with $K$ entries so that the training loss of the quantized net is minimal. The codebook can be optimally learned jointly with the net, or fixed, as for binarization or ternarization approaches. Previous work has quantized the weights of the reference net, or incorporated rounding operations in the backpropagation algorithm, but this has no guarantee of converging to a loss-optimal, quantized net. We describe a new approach based on the recently proposed framework of model compression as constrained optimization \citep{Carreir17a}. This results in a simple iterative "learning-compression" algorithm, which alternates a step that learns a net of continuous weights with a step that quantizes (or binarizes/ternarizes) the weights, and is guaranteed to converge to local optimum of the loss for quantized nets. We develop algorithms for an adaptive codebook or a (partially) fixed codebook. The latter includes binarization, ternarization, powers-of-two and other important particular cases. We show experimentally that we can achieve much higher compression rates than previous quantization work (even using just 1 bit per weight) with negligible loss degradation.
Motivation & Objective
- To address the lack of principled, convergent methods for training quantized neural networks with optimal loss.
- To develop a unified framework that jointly optimizes network weights and quantization codebooks under constrained optimization.
- To enable high-compression quantization (including binarization and ternarization) while preserving model accuracy.
- To provide a mathematically rigorous alternative to ad-hoc quantization techniques that lack convergence guarantees.
- To demonstrate that quantized networks can achieve maximum compression (e.g., 1 bit per weight) with negligible performance degradation.
Proposed method
- Uses a constrained optimization formulation where the quantized weights are constrained to lie within a codebook, enabling joint optimization of weights and codebook entries.
- Employs an iterative 'learning-compression' (LC) algorithm alternating between stochastic gradient descent on real-valued weights and quantization via k-means (adaptive codebook) or optimal assignment (fixed codebook).
- For fixed codebooks (e.g., binarization), the quantization step uses sign-based assignment with optional global scaling, derived from the optimality conditions of the constrained problem.
- Introduces an efficient algorithm for optimal threshold selection in binarization by maximizing a function of the magnitude sum and square root of the number of active weights.
- Applies an augmented Lagrangian method to derive the alternating optimization steps, ensuring convergence to a local optimum under mild conditions.
- Uses a quadratic penalty term in the augmented Lagrangian to enforce the quantization constraint during optimization.
Experimental results
Research questions
- RQ1Can a principled, convergent method be developed for training quantized neural networks with minimal loss?
- RQ2How can the codebook be jointly optimized with network weights to achieve better compression and accuracy?
- RQ3Can the method achieve near-maximal compression (e.g., 1 bit per weight) without significant accuracy degradation?
- RQ4Does the proposed LC algorithm converge to a local optimum of the quantized network loss?
- RQ5How does the performance of the proposed method compare to existing quantization techniques in terms of compression ratio and accuracy?
Key findings
- The proposed learning-compression algorithm converges to a local optimum of the quantized network loss, providing a theoretical guarantee absent in prior methods.
- The method achieves significantly higher compression rates than previous approaches, including down to 1 bit per weight, with negligible accuracy degradation.
- For binarization, the algorithm computes an optimal global scaling factor and sign-based assignment that minimizes the reconstruction error of the original weights.
- The algorithm outperforms existing quantization techniques in both compression efficiency and accuracy preservation, especially at extreme bit rates.
- The optimal threshold for binarization is determined by maximizing a function involving the cumulative sum of absolute weights, ensuring consistency with the quantization constraint.
- The framework generalizes to ternarization, powers-of-two, and other fixed codebooks, enabling flexible and efficient quantization strategies.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.