Skip to main content
QUICK REVIEW

[论文解读] To prune, or not to prune: exploring the efficacy of pruning for model compression

Michael Zhu, Suyog Gupta|arXiv (Cornell University)|Oct 5, 2017
Advanced Neural Network Applications被引用 661
一句话总结

该论文比较大规模稀疏剪枝模型与小型密集模型在视觉与语言任务上的表现,显示大量稀疏模型在同等规模的密集模型上往往表现更好,并引入一种简单的渐进剪枝方法。

ABSTRACT

Model pruning seeks to induce sparsity in a deep neural network's various connection matrices, thereby reducing the number of nonzero-valued parameters in the model. Recent reports (Han et al., 2015; Narang et al., 2017) prune deep networks at the cost of only a marginal loss in accuracy and achieve a sizable reduction in model size. This hints at the possibility that the baseline models in these experiments are perhaps severely over-parameterized at the outset and a viable alternative for model compression might be to simply reduce the number of hidden units while maintaining the model's dense connection structure, exposing a similar trade-off in model size and accuracy. We investigate these two distinct paths for model compression within the context of energy-efficient inference in resource-constrained environments and propose a new gradual pruning technique that is simple and straightforward to apply across a variety of models/datasets with minimal tuning and can be seamlessly incorporated within the training process. We compare the accuracy of large, but pruned models (large-sparse) and their smaller, but dense (small-dense) counterparts with identical memory footprint. Across a broad range of neural network architectures (deep CNNs, stacked LSTM, and seq2seq LSTM models), we find large-sparse models to consistently outperform small-dense models and achieve up to 10x reduction in number of non-zero parameters with minimal loss in accuracy.

研究动机与目标

  • 推动模型压缩以实现能效高的设备端推理。
  • 评估两种压缩路径:大规模稀疏(剪枝后的大模型)与小规模密集(密集的小模型)。
  • 开发一种在训练过程中易于应用的简单渐进剪枝技术。

提出的方法

  • 通过对每个被剪枝的层使用二值掩码,在前向传播时将小幅度权重置零,扩展 TensorFlow。
  • 引入一个逐步稀疏度时间表 s_t,在 n 次剪枝步骤中从 s_i 增长到 s_f,由三次方时间表控制: s_t = s_f + (s_i - s_f)(1 - (t - t_0)/(nΔt))^3。
  • 每 Δt 次训练更新掩码,以允许从剪枝引起的损失中恢复。
  • 在多种架构上应用剪枝(InceptionV3、MobileNets、堆叠 LSTM、seq2seq LSTM、NMT)。
  • 在相同内存占用下比较大-稀疏与小-密集模型在各任务上的表现。

实验结果

研究问题

  • RQ1将大模型剪枝以实现高稀疏是否能超越在相同内存占用下训练一个较小的密集模型?
  • RQ2渐进剪枝如何影响视觉和NLP架构的准确性?
  • RQ3在设备端推理中使用稀疏与密集模型时,实际的硬件与存储考虑因素有哪些?
  • RQ4对于给定的参数预算,是否存在能最大化准确性的最优稀疏度?

主要发现

  • 在可比内存占用下,跨任务的大规模稀疏模型始终优于小规模密集模型。
  • 在 InceptionV3 中,50% sparse 达到 13.6M NNZ,78.0% top-1,94.2% top-5 的准确率,而 0% 稀疏时为 27.1M NNZ,78.1% top-1,94.3% top-5。
  • 在 87.5% 稀疏时,InceptionV3 降至 3.3M NNZ,74.6% top-1,92.5% top-5,考虑到大幅压缩,准确率的下降相对温和。
  • MobileNets 剪枝至 75% 稀疏(1.09M NNZ)达到 67.7% top-1,超过同 NNZ 预算的密集 0.75 宽度移动网路;90–95% 稀疏模型在准确度方面高于等同大小的密集网络。
  • 在 Penn Tree Bank 上,90% 稀疏的大模型(6.6M NNZ)达到困惑度 80.24,优于密集中等模型(19.8M NNZ)的 83.37;85% 稀疏(3.0–3.0M NNZ)产生的困惑度在 85.17–85.87 左右,指示了一个最佳压缩范围。
  • 在 Google 神经机器翻译中,90% 稀疏(23M NNZ)模型的 BLEU 分数接近甚至优于更大规模的密集基线,其中 80% 稀疏偶有让 BLEU 提高;90% 稀疏的 1024 单元模型(23M NNZ)与密集的 512 单元模型(81M 参数)具有可比性。
  • 总体而言,大规模稀疏模型显示出更有利的权衡,表明在给定大小下,先训练一个更大模型再进行剪枝比剪枝一个较小的密集模型能获得更高的准确性。

更好的研究,从现在开始

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

无需绑定信用卡

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