Skip to main content
QUICK REVIEW

[论文解读] Learned Step Size Quantization

Steven K. Esser, Jeffrey L. McKinstry|arXiv (Cornell University)|Feb 21, 2019
Advanced Neural Network Applications参考文献 34被引用 296
一句话总结

引入 Learned Step Size Quantization (LSQ) 用于训练带有激活和权重的低精度网络(2–4 位),在 ImageNet 上达到最先进的准确率,并使 3 位模型能够达到全精度性能。

ABSTRACT

Deep networks run with low precision operations at inference time offer power and space advantages over high precision alternatives, but need to overcome the challenge of maintaining high accuracy as precision decreases. Here, we present a method for training such networks, Learned Step Size Quantization, that achieves the highest accuracy to date on the ImageNet dataset when using models, from a variety of architectures, with weights and activations quantized to 2-, 3- or 4-bits of precision, and that can train 3-bit models that reach full precision baseline accuracy. Our approach builds upon existing methods for learning weights in quantized networks by improving how the quantizer itself is configured. Specifically, we introduce a novel means to estimate and scale the task loss gradient at each weight and activation layer's quantizer step size, such that it can be learned in conjunction with other network parameters. This approach works using different levels of precision as needed for a given system and requires only a simple modification of existing training code.

研究动机与目标

  • 动机:在不牺牲精度的前提下,推动深度网络降低精度以提升吞吐量和能耗效率。
  • 开发一种量化方法,将步长作为模型参数进行学习以最小化任务损失。
  • 确保与现有的反向传播和 SGD 训练流程兼容。
  • 在 ImageNet 上对多种架构展示 LSQ 的性能,并与现有的量化方法进行比较。

提出的方法

  • 定义一个量化器,使用步长 s 和由 QP 与 QN 设置的裁剪界限,将实值映射到离散水平。
  • 通过直通估计引入步长 s 的梯度,考虑量化状态之间的转换(方程式 3)。
  • 通过每层因子 g 缩放步长梯度,以在权重/激活更新之间实现平衡(方程式 4)。
  • 在前向/反向传播过程中,使用全精度权重、量化权重/激活,并采用余弦学习率衰减。
  • 按数据统计从头初始化每层的 LSQ 步长,并从预训练的全精度模型进行微调。

实验结果

研究问题

  • RQ1通过基于梯度的优化学习量化器的步长,是否能在任务性能上优于固定或误差最小化的量化器?
  • RQ2LSQ 是否使 2、3、4 位网络在 ImageNet 上在各架构中接近或达到全精度的准确率?
  • RQ3步长梯度缩放对收敛性和最终准确率的影响?
  • RQ4为获得高任务性能,量化误差最小化是否必要,还是其他目标可以带来更好的结果?

主要发现

网络方法23482348
ResNet-18LSQ (Ours)67.670.271.171.187.689.490.090.1
ResNet-18QIL65.769.270.1
ResNet-18FAQ----89.189.3--
ResNet-18LQ-Nets64.968.269.385.987.988.8-
ResNet-18PACT64.468.169.285.688.289.0-
ResNet-18NICE67.769.8--87.989.21--
ResNet-18Regularization61.7-67.368.184.4-87.988.2
ResNet-34LSQ (Ours)71.673.474.174.190.391.491.791.8
ResNet-34QIL70.673.173.7----
ResNet-34NICE71.773.5--90.891.4--
ResNet-34FAQ-73.373.7-91.391.6--
ResNet-34LQ-Nets69.871.9--89.190.2--
ResNet-50LSQ (Ours)73.775.876.776.891.592.793.293.4
ResNet-50PACT72.275.376.590.592.693.2-
ResNet-50NICE75.176.5--92.393.3--
ResNet-50FAQ-76.376.5-92.993.1--
ResNet-50LQ-Nets71.574.275.1-90.391.692.4-
ResNet-101LSQ (Ours)76.177.578.378.192.893.694.094.0
ResNet-101FAQ--------
ResNet-152LSQ (Ours)76.978.278.578.593.293.994.194.2
VGG-16bnLSQ (Ours)71.473.474.073.590.491.592.091.6
  • 在 ImageNet 的多种架构上,LSQ 在 2、3、4 位方法中实现更高的 top-1/top-5 准确率。
  • 在若干情形中,使用 LSQ 训练的 3 位网络达到或非常接近全精度的准确率。
  • 逐层步长梯度缩放可改善收敛并在权重/激活梯度更新之间实现平衡。
  • LSQ 并非在量化误差最小化方面表现最佳,但在任务性能上优于以量化误差最小化的方法。
  • 结合 LSQ 的知识蒸馏进一步提升准确率,部分 3 位模型甚至可达到全精度基线。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。