arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2109.04838cs.LGcs.CL
收藏

用于更快的Transformers的块修剪

Block Pruning For Faster Transformers

Hugging Face

François Lagunas, Ella Charlaix, Victor Sanh, Alexander M. Rush

摘要:

预训练提高了分类和生成任务的模型准确性,但代价是引入了更大更慢的模型。修剪方法已被证明是减少模型大小的有效方法,而蒸馏方法被证明可以加速推理。我们介绍了一个块修剪的方法,针对小型和快速的模型。我们的方法通过考虑任何大小的块扩展结构化方法,并将此结构集成到运动修剪范式中进行微调。我们发现,这种方法学会了修剪掉底层模型的完整组件,例如注意力头。实验考虑了分类和生成任务,产生了一个修剪模型,它比SQuAD v1快2.4倍,BERT小74%,比F1小1%,在速度和大小上都与蒸馏模型竞争。

英文摘要:

Pre-training has improved model accuracy for both classification and generation tasks at the cost of introducing much larger and slower models. Pruning methods have proven to be an effective way of reducing model size, whereas distillation methods are proven for speeding up inference. We introduce a block pruning approach targeting both small and fast models. Our approach extends structured methods by considering blocks of any size and integrates this structure into the movement pruning paradigm for fine-tuning. We find that this approach learns to prune out full components of the underlying model, such as attention heads. Experiments consider classification and generation tasks, yielding among other results a pruned model that is a 2.4x faster, 74% smaller BERT on SQuAD v1, with a 1% drop on F1, competitive both with distilled models in speed and pruned models in size.

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

↑