贪婪层修剪:加速自然语言处理的Transformer模型
Greedy-layer Pruning: Speeding up Transformer Models for Natural Language Processing
摘要:
在无监督预训练之后微调Transformer模型在许多不同的自然语言处理任务上达到了非常高的性能。不幸的是,Transformers遭受长的推理时间,这大大增加了生产成本。一个可能的解决方案是使用知识蒸馏,它通过将信息从大型教师模型转移到较小的学生模型来解决这个问题。知识蒸馏保持高性能并达到高压缩率,然而,学生模型的大小在预训练后是固定的,并且不能针对给定的下游任务和用例单独改变以达到期望的性能/加速比。另一种以更细粒度和计算成本更低的方式减小模型大小的解决方案是在预训练后修剪层。代价是逐层剪枝算法的性能不能与最先进的知识蒸馏方法相提并论。在本文中,贪婪层修剪引入(1)优于当前的逐层修剪的最新技术水平,(2)关闭性能差距相比,知识蒸馏,同时(3)提供了一种方法,以适应模型的大小动态地达到所需的性能/加速比的权衡,而不需要额外的预训练阶段。我们的源代码可以在https://github.com/deepopinion/greedy-layer-pruning上找到。
英文摘要:
Fine-tuning transformer models after unsupervised pre-training reaches a very high performance on many different natural language processing tasks. Unfortunately, transformers suffer from long inference times which greatly increases costs in production. One possible solution is to use knowledge distillation, which solves this problem by transferring information from large teacher models to smaller student models. Knowledge distillation maintains high performance and reaches high compression rates, nevertheless, the size of the student model is fixed after pre-training and can not be changed individually for a given downstream task and use-case to reach a desired performance/speedup ratio. Another solution to reduce the size of models in a much more fine-grained and computationally cheaper fashion is to prune layers after the pre-training. The price to pay is that the performance of layer-wise pruning algorithms is not on par with state-of-the-art knowledge distillation methods. In this paper, Greedy-layer pruning is introduced to (1) outperform current state-of-the-art for layer-wise pruning, (2) close the performance gap when compared to knowledge distillation, while (3) providing a method to adapt the model size dynamically to reach a desired performance/speedup tradeoff without the need of additional pre-training phases. Our source code is available on https://github.com/deepopinion/greedy-layer-pruning.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。