[论文解读] Trained Ternary Quantization
训练的三值量化(TTQ)通过可学习的正向和负向缩放因子对每一层的三值权重进行训练,在模型大小约减少16倍的同时,精度损失很小,甚至在 CIFAR-10 和 ImageNet 上略有提升。
Deep neural networks are widely used in machine learning applications. However, the deployment of large neural networks models can be difficult to deploy on mobile devices with limited power budgets. To solve this problem, we propose Trained Ternary Quantization (TTQ), a method that can reduce the precision of weights in neural networks to ternary values. This method has very little accuracy degradation and can even improve the accuracy of some models (32, 44, 56-layer ResNet) on CIFAR-10 and AlexNet on ImageNet. And our AlexNet model is trained from scratch, which means it's as easy as to train normal full precision model. We highlight our trained quantization method that can learn both ternary values and ternary assignment. During inference, only ternary values (2-bit weights) and scaling factors are needed, therefore our models are nearly 16x smaller than full-precision models. Our ternary models can also be viewed as sparse binary weight networks, which can potentially be accelerated with custom circuit. Experiments on CIFAR-10 show that the ternary models obtained by trained quantization method outperform full-precision models of ResNet-32,44,56 by 0.04%, 0.16%, 0.36%, respectively. On ImageNet, our model outperforms full-precision AlexNet model by 0.3% of Top-1 accuracy and outperforms previous ternary models by 3%.
研究动机与目标
- 通过降低模型尺寸与能量消耗来促进在移动设备上部署深度神经网络。
- 引入一种能够学习权重的三值取值与三值分配的量化方法。
- 在训练期间保持潜在的全精度权重表示以指导量化。
- 使用仅有的三值权重和每层缩放因子实现高效推理。
- 在 CIFAR-10 和 ImageNet 上 Demonstrate improved or comparable accuracy to full-precision models on CIFAR-10 and ImageNet.
提出的方法
- 使用每层缩放系数 Wp_l 和 Wn_l 将权重量化为 {+Wp_l, 0, -Wn_l}。
- 将梯度反向传播到潜在的全精度权重和缩放系数,以学习三值取值和分配。
- 通过阈值 Delta_l 进行量化,Delta_l 与该层的最大绝对权值成正比,跨层使用固定因子 t。
- 在训练过程中,使用对 Ip_l 和 In_l 的方程对梯度反向传播到 Wp_l、Wn_l 以更新码本与潜在权重。
- 在推理阶段,扔弃全精度权重,仅使用三值权重和缩放因子进行计算。
- 通过固定阈值启发式探索稀疏性,并展示训练过程中 Wp_l 和 Wn_l 的逐层行为。
实验结果
研究问题
- RQ1TTQ 是否能够在 CIFAR-10 和 ImageNet 上维持或提高相较于全精度网络的准确性,即使在量化程度较高的情况下?
- RQ2可学习的三值取值与非对称缩放因子如何影响模型容量与学习动力学?
- RQ3在常见架构中,TTQ 的压缩与能效收益在实际应用中的表现如何?
- RQ4TTQ 与现有的三值/二值量化方法(如 TWN、DoReFa-Net)在标准基准上的对比如何?
主要发现
- TTQ 通过使用带有逐层缩放因子的 2-bit 三值权重,在参数规模上实现了 16x 的减少。
- 在 CIFAR-10 上,TTQ 在 ResNet-32/44/56 的准确率分别比全精度基线提升 0.04%、0.16% 和 0.36%。
- 在 ImageNet 上,使用 AlexNet 从头训练的 TTQ 达到 42.5% Top-1 准确率,领先全精度 AlexNet 1.6%,并在报告的结果中约超越此前的三值模型 0.3% 的 Top-1。
- TTQ 在 ImageNet 上约比先前的三值网络(TWN)多出约 3% 的 Top-1。
- Wp_l ≠ Wn_l 的非对称性增加了模型容量,三值权重在反向传播中充当学习率乘子。
- 可视化显示学习到的三值卷积核在低精度下仍保留关键的边缘/角检测器,表明特征提取有效。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。