Exploiting Redundancy in Pre-trained Language Models for Efficient Transfer Learning

Fahim Dalvi, Hassan Sajjad, Nadir Durrani, Yonatan BelinkovarXiv 2020

TL;DR

This paper demonstrates that popular Transformer models like BERT and XLNet are massive over-achievers—up to 85% of their neurons are redundant in general, and over 92% can be stripped away for specific downstream tasks. By systematically identifying these redundancies at both the layer and neuron levels, the authors propose a transfer learning procedure that maintains 97% of original performance while using less than 10% of the neurons, leading to speedups of up to 6.2x.

What Problem Does This Paper Address?

State-of-the-art NLP models have ballooned in size, with parameters now measured in the billions. While these models perform exceptionally well, their sheer scale makes them impractical for deployment in resource-constrained environments (like mobile devices or real-time systems).

While techniques like distillation and pruning exist, they are often empirically driven. We lack a deep understanding of why these models are so large and where the fat can be trimmed. The authors address this by formalizing two types of redundancy:

  1. General Redundancy: Information that is duplicated across the model regardless of the task, often an artifact of over-parameterization.
  2. Task-specific Redundancy: Information that might be useful for some tasks but is irrelevant for the specific downstream task at hand.

Methods

The authors dissect BERT-base and XLNet-base using a multi-pronged analytical approach:

  • Layer-level Analysis: They use Center Kernel Alignment (CKA) to measure how similar representations are between different layers. High similarity indicates that a layer isn't adding much new information.
  • Neuron-level Analysis: They employ Correlation Clustering (CC) to group neurons that fire similarly across a dataset. If two neurons are highly correlated, one is redundant.
  • Task-specific Probing: To find task-specific redundancy, they use Linear Probing (training simple classifiers on top of individual layers) and Linguistic Correlation Analysis to rank individual neurons by their importance to a specific task.

Finally, they combine these insights into a three-step Efficient Transfer Learning pipeline:

  1. LayerSelector (LS): Identify and use only the lowest layers necessary to reach "oracle" performance.
  2. Correlation Clustering (CC): Filter out generally redundant neurons from those layers.
  3. Feature Selection (FS): Select the minimal set of top-ranked neurons required for the task.

Datasets

The study evaluates redundancy across a diverse suite of benchmarks:

  • General Redundancy: Analyzed using the Penn Treebank (PTB) development set.
  • Sequence Labeling (Core NLP): POS tagging (PTB), CCG super tagging, Semantic tagging, and Syntactic chunking (CoNLL 2000).
  • Sequence Classification (GLUE Benchmark): SST-2 (sentiment), MRPC & QQP (equivalence), MNLI, QNLI, & RTE (inference), and STS-B (similarity).

Key Insights and Ideas

  • The "Neighbor" Rule: Redundancy is highly localized. As shown in Figure 3, roughly 95% of redundant neuron clusters contain neurons from the same or adjacent layers. This suggests that pruning should focus on compressing layers rather than just removing entire depths. Figure 3: Redundancy is mostly local to the same or adjacent layers.
Figure 3: Redundancy is mostly local to the same or adjacent layers.
  • The Final Layer Exception: While adjacent layers are generally very similar, the similarity drops sharply at the very last layers (see Figure 1). The authors speculate that while lower layers encode general linguistic knowledge, the final layers are highly specialized for the pre-training objective. Figure 1: Pairwise similarity between layers in BERT and XLNet.
Figure 1: Pairwise similarity between layers in BERT and XLNet.
  • XLNet vs. BERT: XLNet exhibits higher redundancy than BERT. It learns high-level concepts much earlier in the network, making it a better candidate for aggressive pruning of higher layers.
  • Task Complexity vs. Neuron Count: Interestingly, "simple" core linguistic tasks like POS tagging actually require more neurons (but fewer layers) than "complex" sequence-level tasks like sentiment analysis. This is because word-level tasks require the model to maintain distinct information for every word, whereas classification tasks allow the model to "filter and mold" features into a few high-level sentence representations.

Key Results

The quantitative findings are striking. The authors found that 85% of neurons in BERT and 92% in XLNet can be removed without any loss in accuracy during general analysis.

Figure 2: General neuron-level redundancy in BERT and XLNet; comparing the average reduction of neu- rons for different CC thresholds and the average accu- racy across all downstream tasks. See Appendix A.2 for detailed per-task results.

When applying their efficient transfer learning procedure:

  • Performance: They maintained 97% of oracle performance while using at most 10% of the original neurons.
  • Efficiency: For sequence labeling tasks, they achieved an average speedup of 2.8x for BERT and 6.2x for XLNet.
  • Extreme Compression: Some tasks, like QNLI, required as few as 10 neurons to maintain performance.

Limitations and Future Work

The authors acknowledge a few constraints:

  • Model Scale: Due to computational limits, the study was restricted to "base" models. Analyzing "large" versions (340M+ parameters) might reveal even higher levels of redundancy.
  • Feature-based focus: The work focuses on feature-based transfer learning. While this is efficient, the redundancy patterns might shift during full model fine-tuning.
  • Architectural Implications: The findings suggest that current "rectangular" architectures (same width at every layer) are sub-optimal. The authors propose that pyramid-shaped architectures—wide at the bottom for linguistic features and narrow at the top for task-specific abstractions—could be significantly more efficient.

Summary updated

BibTeX
@misc{dalvi2020exploiting,
  author = {Fahim Dalvi and Hassan Sajjad and Nadir Durrani and Yonatan Belinkov},
  title = {{Exploiting Redundancy in Pre-trained Language Models for Efficient Transfer Learning}},
  year = {2020},
  eprint = {2004.04010},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.04010},
}
Figure