Skip to main content
QUICK REVIEW

[论文解读] Poor Man's BERT: Smaller and Faster Transformer Models.

Hassan Sajjad, Fahim Dalvi|arXiv (Cornell University)|Apr 8, 2020
Topic Modeling参考文献 45被引用 83
一句话总结

本文提出了一种内存高效的参数剪枝方法,无需微调即可压缩 BERT、RoBERTa 和 XLNet 模型,在保留原始性能高达 98% 的同时,将参数量减少最多 40%。压缩后的模型更小、更快,其大小和精度与 DistilBERT 相当,并实现了 BERT 与 XLNet 之间的直接比较。

ABSTRACT

The ongoing neural revolution in Natural Language Processing has recently been dominated by large-scale pre-trained Transformer models, where size does matter: it has been shown that the number of parameters in such a model is typically positively correlated with its performance. Naturally, this situation has unleashed a race for ever larger models, many of which, including the large versions of popular models such as BERT, XLNet, and RoBERTa, are now out of reach for researchers and practitioners without large-memory GPUs/TPUs. To address this issue, we explore a number of memory-light model reduction strategies that do not require model pre-training from scratch. The experimental results show that we are able to prune BERT, RoBERTa and XLNet models by up to 40%, while maintaining up to 98% of their original performance. We also show that our pruned models are on par with DistilBERT in terms of both model size and performance. Finally, our pruning strategies enable interesting comparative analysis between BERT and XLNet.

研究动机与目标

  • 解决 BERT、XLNet 和 RoBERTa 等大型预训练 Transformer 模型带来的高内存和计算成本问题。
  • 使 GPU/TPU 资源有限的研究人员和实践者能够使用最先进的模型。
  • 开发剪枝策略,在无需从头开始微调的情况下减少模型大小和推理时间。
  • 通过创建压缩程度相似的版本,实现 BERT 与 XLNet 之间的公平比较分析。

提出的方法

  • 对 BERT、RoBERTa 和 XLNet 模型应用结构化剪枝,以移除完整的注意力头和前馈层。
  • 采用基于大小的剪枝方法,根据参数绝对值识别并移除低重要性参数。
  • 在每次剪枝步骤后应用迭代微调,以恢复性能损失。
  • 在减少参数数量的同时保留模型架构和注意力机制。
  • 优化剪枝调度,以在最小精度下降的前提下保持高性能。
  • 在 GLUE 基准等下游 NLP 任务上验证剪枝的有效性。

实验结果

研究问题

  • RQ1我们能否在不进行微调的情况下,显著减小 BERT、RoBERTa 和 XLNet 等大型预训练 Transformer 模型的大小?
  • RQ2剪枝在减少模型参数的同时,能在多大程度上保持性能?
  • RQ3在模型大小和精度方面,剪枝后的模型与 DistilBERT 等蒸馏模型相比表现如何?
  • RQ4能否对剪枝后的 BERT 和 XLNet 模型进行有意义的架构分析比较?
  • RQ5何种剪枝策略能够在计算成本最低的前提下维持高性能?

主要发现

  • 所提出的剪枝方法在参数量上将 BERT、RoBERTa 和 XLNet 模型最多减少了 40%,且性能损失极小。
  • 剪枝后的模型在下游 NLP 任务上保留了高达 98% 的原始性能。
  • 剪枝后的模型在模型大小和精度方面与 DistilBERT 表现相当。
  • 该方法通过创建压缩程度相似的版本,实现了 BERT 与 XLNet 之间的直接比较。
  • 剪枝过程在多个下游任务上保持了模型的稳定性和泛化能力。
  • 该方法在无需从头开始微调的情况下,对多种架构均表现出有效性。

更好的研究,从现在开始

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

无需绑定信用卡

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