[论文解读] Model compression as constrained optimization, with application to neural nets. Part II: quantization
该论文提出了一种用于神经网络量化约束优化的框架,通过在训练实值网络与使用自适应或固定码书对权重进行量化之间交替进行,保证收敛至局部最优解,并实现最先进的压缩效果——每权重低至1比特,同时保持极小的精度损失,优于以往的量化方法,在压缩率和精度保持方面表现更优。
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.
研究动机与目标
- 解决缺乏系统性、可收敛的训练量化神经网络方法以实现最优损失的问题。
- 开发一个统一的框架,在约束优化下联合优化网络权重与量化码书。
- 实现在保持模型精度的前提下实现高比例压缩(包括二值化和三值化)。
- 为缺乏收敛性保证的启发式量化技术提供数学上严谨的替代方案。
- 证明量化网络可实现最大压缩(如每权重1比特),且性能退化可忽略。
提出的方法
- 采用约束优化公式,其中量化权重被约束在码书范围内,从而实现权重与码书条目联合优化。
- 采用一种迭代的“训练-压缩”(LC)算法,交替执行实值权重的随机梯度下降和通过k-means(自适应码书)或最优分配(固定码书)进行的量化。
- 对于固定码书(如二值化),量化步骤采用基于符号的分配,并可选地引入全局缩放,其推导基于约束问题的最优性条件。
- 通过最大化与幅值总和和活跃权重数量平方根相关的函数,提出一种高效算法以确定二值化中的最优阈值。
- 应用增广拉格朗日法推导交替优化步骤,确保在弱条件下收敛至局部最优解。
- 在增广拉格朗日函数中引入二次惩罚项,以在优化过程中强制执行量化约束。
实验结果
研究问题
- RQ1能否开发一种系统性、可收敛的方法,用于训练量化神经网络并实现最小损失?
- RQ2如何联合优化码书与网络权重,以实现更高的压缩率和精度?
- RQ3该方法能否在几乎达到最大压缩率(如每权重1比特)的情况下,实现显著的精度退化?
- RQ4所提出的LC算法是否收敛至量化网络损失的局部最优解?
- RQ5与现有量化技术相比,该方法在压缩率和精度方面表现如何?
主要发现
- 所提出的训练-压缩算法收敛至量化网络损失的局部最优解,提供了以往方法所缺乏的理论保证。
- 该方法的压缩率显著高于以往方法,包括压缩至每权重1比特,且精度损失可忽略不计。
- 在二值化中,算法计算出最优全局缩放因子和基于符号的分配方式,以最小化原始权重的重建误差。
- 该算法在压缩效率和精度保持方面均优于现有量化技术,尤其在极低比特率下表现更优。
- 二值化的最优阈值通过最大化涉及绝对权重累积和的函数来确定,确保与量化约束的一致性。
- 该框架可推广至三值化、2的幂次量化及其他固定码书,支持灵活高效的量化策略。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。