On the Effect of Dropping Layers of Pre-trained Transformer Models
arXiv:2004.03844 · doi:10.1016/j.csl.2022.101429
Abstract
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.
References in corpus (13)
- Distilling the Knowledge in a Neural Network
- HuggingFace's Transformers: State-of-the-art Natural Language Processing
- Q8BERT: Quantized 8Bit BERT
- Well-Read Students Learn Better: On the Importance of Pre-training Compact Models
- Distilling Task-Specific Knowledge from BERT into Simple Neural Networks
- Reducing Transformer Depth on Demand with Structured Dropout
- Revisiting Few-sample BERT Fine-tuning
- Comparing Rewinding and Fine-tuning in Neural Network Pruning
- TinyBERT: Distilling BERT for Natural Language Understanding
- Evaluating Layers of Representation in Neural Machine Translation on Part-of-Speech and Semantic Tagging Tasks
- Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT
- Discovering Latent Concepts Learned in BERT
- Probing for Constituency Structure in Neural Language Models
Cited by in corpus (7)
- On the Opportunities and Risks of Foundation Models
- A Practical Survey on Faster and Lighter Transformers
- No One Left Behind: Inclusive Federated Learning over Heterogeneous Devices
- LGViT: Dynamic Early Exiting for Accelerating Vision Transformer
- The EarlyBIRD Catches the Bug: On Exploiting Early Layers of Encoder Models for More Efficient Code Classification
- EWasteNet: A Two-Stream Data Efficient Image Transformer Approach for E-Waste Classification
- Convexity-based Pruning of Speech Representation Models