Block Pruning For Faster Transformers

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


Abstract
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.
Anthology ID:
2021.emnlp-main.829
Volume:
Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing
Month:
November
Year:
2021
Address:
Online and Punta Cana, Dominican Republic
Venue:
EMNLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
10619–10629
Language:
URL:
https://aclanthology.org/2021.emnlp-main.829
DOI:
10.18653/v1/2021.emnlp-main.829
Bibkey:
Cite (ACL):
François Lagunas, Ella Charlaix, Victor Sanh, and Alexander Rush. 2021. Block Pruning For Faster Transformers. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 10619–10629, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
Cite (Informal):
Block Pruning For Faster Transformers (Lagunas et al., EMNLP 2021)
Copy Citation:
PDF:
https://aclanthology.org/2021.emnlp-main.829.pdf
Video:
 https://aclanthology.org/2021.emnlp-main.829.mp4
Code
 huggingface/nn_pruning
Data
CNN/Daily MailMultiNLIQuora Question PairsSQuADSST