arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1910.06360cs.CLcs.LG
收藏

基于BERT的问答模型的结构化剪枝

Structured Pruning of a BERT-based Question Answering Model

IBM Research AI(IBM研究院AI)

J. S. McCarley, Rishav Chakravarti, Avirup Sil

摘要:

在行业设置的自然语言处理(NLP)研究的最新趋势是在严格的计算限制下操作大规模的预训练语言模型,如BERT。虽然大多数模型压缩工作都集中在使用昂贵的预训练蒸馏来“蒸馏”通用语言表示,但较少关注创建较小的特定于任务的语言表示,可以说,这些语言表示在行业环境中更有用。在本文中,我们研究压缩BERT和RobERTa为基础的问答系统的结构化修剪参数从底层的Transformer模型。我们发现,特定于任务的结构化修剪和特定于任务的蒸馏的廉价组合,而不需要预先训练蒸馏的费用,在一系列速度/精度权衡操作点上产生高性能的模型。我们从针对SQuAD 2.0或Natural Questions训练的现有全尺寸模型开始,并引入允许单独消除Transformers选定部分的门。具体来说,我们研究(1)结构化修剪,以减少每个Transformer层中的参数数量,(2)适用于基于BERT和RobERTa的模型,(3)适用于SQuAD 2.0和Natural Questions,以及(4)将结构化修剪与蒸馏相结合。我们实现了推理速度的近一倍,在自然问题的简短答案准确性方面损失不到0.5 F1点。

英文摘要:

The recent trend in industry-setting Natural Language Processing (NLP) research has been to operate large %scale pretrained language models like BERT under strict computational limits. While most model compression work has focused on "distilling" a general-purpose language representation using expensive pretraining distillation, less attention has been paid to creating smaller task-specific language representations which, arguably, are more useful in an industry setting. In this paper, we investigate compressing BERT- and RoBERTa-based question answering systems by structured pruning of parameters from the underlying transformer model. We find that an inexpensive combination of task-specific structured pruning and task-specific distillation, without the expense of pretraining distillation, yields highly-performing models across a range of speed/accuracy tradeoff operating points. We start from existing full-size models trained for SQuAD 2.0 or Natural Questions and introduce gates that allow selected parts of transformers to be individually eliminated. Specifically, we investigate (1) structured pruning to reduce the number of parameters in each transformer layer, (2) applicability to both BERT- and RoBERTa-based models, (3) applicability to both SQuAD 2.0 and Natural Questions, and (4) combining structured pruning with distillation. We achieve a near-doubling of inference speed with less than a 0.5 F1-point loss in short answer accuracy on Natural Questions.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑