On Surgical Fine-tuning for Language Encoders

Abhilasha Lodha, Gayatri Belapurkar, Saloni Chalkapurkar, Yuanming Tao, Reshmi Ghosh, Samyadeep Basu, Dmitrii Petrov, Soundararajan Srinivasan

TL;DR

This paper introduces a novel method for "surgical fine-tuning" of pre-trained language models, where only a select subset of layers are tuned for a specific downstream task. By using the Fisher Information Matrix (FIM) score, they efficiently identify these crucial layers, achieving performance comparable to or even better than full model fine-tuning, especially on tasks requiring localized linguistic knowledge.

What Problem Does This Paper Address?

Adapting large, pre-trained language models (like BERT) to new tasks typically involves fine-tuning all of their layers. While effective, this process can be computationally expensive, require significant data, and potentially lead to overfitting or reduced generalization. Existing parameter-efficient fine-tuning methods often introduce new architectural components. This paper addresses the challenge of efficiently adapting pre-trained models to new tasks by identifying and tuning only the most relevant layers, without modifying the model architecture, and using minimal task-specific data.

Methods

The core of this paper's contribution is the Fisher Information Matrix (FIM) score as a criterion for selecting layers to fine-tune. The FIM quantifies how much a parameter's change impacts the model's output distribution. By analyzing the diagonal elements of the FIM, the authors estimate the importance of individual layers. They propose using this score to rank layers and then selectively fine-tune a small subset (specifically, the top 5 layers) identified by this ranking. A key finding is that these layer importance rankings, determined by the FIM score, remain remarkably stable throughout the fine-tuning process, suggesting that important layers can be identified even before training begins.

Datasets

The experiments were conducted on standard NLP benchmarks:

  • GLUE (General Language Understanding Evaluation): A collection of diverse language understanding tasks.
  • SuperGLUE: A more challenging successor to GLUE, featuring tasks that require more complex reasoning.

The authors used these datasets for evaluating the performance of their surgical fine-tuning approach against full model fine-tuning.

Key Insights and Ideas

  • Task-specific knowledge is localized: The paper strongly suggests that for many NLP tasks, the information crucial for adaptation is concentrated in a small subset of the pre-trained model's layers, rather than being distributed evenly across all of them.
  • FIM as an efficient layer selector: The FIM score provides a data-driven, efficient way to identify these critical layers, requiring only a small amount of task-specific data (around 100 samples).
  • Layer importance is stable: The ranking of layers by FIM score is consistent across different stages of the fine-tuning process, meaning you can identify the layers to tune before you start fine-tuning.
  • Surgical fine-tuning can outperform full fine-tuning: In some cases, tuning only the selected layers yields better results than fine-tuning the entire model, likely due to reduced overfitting.
  • Not all tasks benefit equally: While effective for many tasks, surgical fine-tuning based on FIM scores may be less optimal for tasks requiring deep semantic understanding, logical reasoning, or handling complex linguistic phenomena like textual entailment or commonsense reasoning.

Key Results

  • Surgical fine-tuning using FIM-selected layers achieved performance comparable to full model fine-tuning on most GLUE and SuperGLUE tasks, often within a ±5% range.
  • For some tasks, surgical fine-tuning outperformed full model fine-tuning.
  • The paper highlights that tasks relying on localized linguistic knowledge (e.g., discourse, syntax, semantics) benefit significantly from this approach.
  • Tasks requiring more complex reasoning (e.g., textual entailment, commonsense) showed sub-optimal results with surgical fine-tuning, suggesting that these tasks might indeed require tuning more layers or a different approach.
  • The layer rankings determined by FIM remained consistent across optimization checkpoints for both GLUE and SuperGLUE tasks.

Limitations and Future Work

  • Task complexity: The authors acknowledge that for complex tasks requiring holistic understanding (e.g., RTE, COPA, CB), FIM-based surgical fine-tuning may not be sufficient for optimal performance.
  • Distributional shifts: The FIM approach appears less effective for tasks sensitive to temporal drifts in language compared to domain or environmental shifts.
  • Larger models: The current study focuses on BERT-base. Future work should investigate the effectiveness of FIM on larger language models (LLMs) and in zero-shot settings.
  • Comparison with other methods: The authors plan to compare their FIM-based approach with other parameter-efficient fine-tuning methods like LoRA.
  • Linguistic correlates: Future research could explore the linguistic properties of different layers in LLMs and how FIM can reveal these.

Summary updated

BibTeX
@inproceedings{lodha2023surgical,
  author = {Abhilasha Lodha and Gayatri Belapurkar and Saloni Chalkapurkar and Yuanming Tao and Reshmi Ghosh and Samyadeep Basu and Dmitrii Petrov and Soundararajan Srinivasan},
  title = {{On Surgical Fine-tuning for Language Encoders}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=q0c1JTukWE},
}
Figure