预训练Transformer模型的降层效应研究
On the Effect of Dropping Layers of Pre-trained Transformer Models
摘要:
基于transformer的NLP模型使用数亿甚至数十亿个参数进行训练,限制了它们在计算受限环境中的适用性。虽然参数的数量通常与性能相关,但尚不清楚下游任务是否需要整个网络。受最近关于修剪和提取预训练模型的工作的启发,我们探索了在预训练模型中删除层的策略,并观察修剪对下游GLUE任务的影响。我们能够将BERT、RoBERTa和XLNet模型修剪高达40%,同时保持高达98%的原始性能。此外,我们表明,我们的修剪模型与那些使用知识蒸馏,无论是在规模和性能方面。我们的实验产生了有趣的观察结果,例如,(i)较低的层对于维持下游任务性能是最关键的,(ii)一些任务,如释义检测和句子相似性对层的丢弃更鲁棒,以及(iii)使用不同目标函数训练的模型表现出不同的学习模式和层丢弃。
英文摘要:
Transformer-based NLP models are trained using hundreds of millions or even billions of parameters, limiting their applicability in computationally constrained environments. While the number of parameters generally correlates with performance, it is not clear whether the entire network is required for a downstream task. Motivated by the recent work on pruning and distilling pre-trained models, we explore strategies to drop layers in pre-trained models, and observe the effect of pruning on downstream GLUE tasks. We were able to prune BERT, RoBERTa and XLNet models up to 40%, while maintaining up to 98% of their original performance. Additionally we show that our pruned models are on par with those built using knowledge distillation, both in terms of size and performance. Our experiments yield interesting observations such as, (i) the lower layers are most critical to maintain downstream task performance, (ii) some tasks such as paraphrase detection and sentence similarity are more robust to the dropping of layers, and (iii) models trained using a different objective function exhibit different learning patterns and w.r.t the layer dropping.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。