[Paper Review] Know What You Don't Need: Single-Shot Meta-Pruning for Attention Heads
This paper proposes Single-Shot Meta-Pruning (SMP), a method to prune up to 50% of attention heads in pre-trained BERT models before fine-tuning, using a meta-learned criterion that preserves the distribution of text representations. SMP achieves comparable or better performance than fine-tuned baselines while reducing both fine-tuning and inference costs, with pruned models showing improved generalization on semantic relatedness tasks.
Deep pre-trained Transformer models have achieved state-of-the-art results over a variety of natural language processing (NLP) tasks. By learning rich language knowledge with millions of parameters, these models are usually overparameterized and significantly increase the computational overhead in applications. It is intuitive to address this issue by model compression. In this work, we propose a method, called Single-Shot Meta-Pruning, to compress deep pre-trained Transformers before fine-tuning. Specifically, we focus on pruning unnecessary attention heads adaptively for different downstream tasks. To measure the informativeness of attention heads, we train our Single-Shot Meta-Pruner (SMP) with a meta-learning paradigm aiming to maintain the distribution of text representations after pruning. Compared with existing compression methods for pre-trained models, our method can reduce the overhead of both fine-tuning and inference. Experimental results show that our pruner can selectively prune 50% of attention heads with little impact on the performance on downstream tasks and even provide better text representations. The source code will be released in the future.
Motivation & Objective
- To reduce the computational overhead of fine-tuning and inference in large pre-trained Transformer models.
- To identify and remove unnecessary attention heads in pre-trained models before fine-tuning, rather than after.
- To develop a generalizable, single-shot pruning method that maintains model performance across diverse downstream tasks.
- To learn implicit pruning rules via meta-learning that are transferable across different model sizes and tasks.
Proposed method
- Train a meta-learner (SMP) to predict attention head importance using a self-supervised objective that maintains the distribution of text representations after pruning.
- Use a meta-learning paradigm with diverse corpora to simulate various downstream tasks during pruner training.
- Apply a single-shot pruning strategy that removes attention heads in one step before fine-tuning, avoiding iterative optimization.
- Measure head importance via a score function that reflects informativeness, with high scores indicating useful heads.
- Use the pruner to identify and remove heads with low scores, which are deemed non-informative.
- Evaluate the pruned model on downstream tasks to assess performance and efficiency gains.
Experimental results
Research questions
- RQ1Can we effectively prune attention heads in pre-trained Transformers before fine-tuning to reduce computational cost?
- RQ2Does a meta-learned pruner generalize across different downstream tasks and model architectures?
- RQ3Can single-shot pruning achieve performance comparable to or better than iterative fine-tuning-based compression?
- RQ4Does pruning a subset of attention heads improve model generalization on certain NLP tasks?
- RQ5What implicit patterns do the pruned attention heads reveal, and are they consistent with human-interpretation of attention?
Key findings
- SMP can prune up to 50% of attention heads in BERT with minimal performance drop on GLUE benchmark tasks.
- Pruning 50% of heads results in a 30% reduction in memory usage, enabling more efficient training with higher batch sizes.
- In some cases, pruning improves performance—especially on semantic relatedness tasks in SentEval, where SMP outperforms random pruning and matches HISP-retrain.
- The pruner achieves comparable or better results than post-fine-tuning compression baselines, even with fewer parameters.
- The implicit pruning rules learned by SMP align with human intuition, as shown in visualizations of attention matrices.
- The pruner demonstrates strong transferability: a model trained on BERT_BASE generalizes well to BERT_LARGE, and performs well on new tasks like QNLI.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.