Generalizable and Stable Finetuning of Pretrained Language Models on Low-Resource Texts

Sai Ashish Somayajula, Youwei Liang, Abhishek Singh, Li Zhang, Pengtao Xie

TL;DR

Finetuning large language models on small datasets often leads to severe overfitting and performance instability. This paper introduces an attention-guided weight mixup technique optimized via a bi-level framework to dynamically select and regularize sub-networks, significantly improving generalization and stability on low-resource tasks.

What Problem Does This Paper Address?

Pretrained Language Models (PLMs) like BERT and RoBERTa are incredibly powerful, but adapting them to low-resource settings—where downstream training data is scarce—remains a major hurdle. Two primary issues arise:

  1. Instability: The model's final performance can vary wildly depending on the random seed used for initialization.
  2. Overfitting: Because PLMs have massive parameter capacities, they easily memorize small training sets, leading to poor generalization on unseen data.

Previous approaches tried to mitigate this by identifying a "child network" (a subset of important weights) to update while keeping the rest of the pretrained weights frozen. However, these methods typically rely on the Fisher Information Matrix (FIM) to select the sub-network. In low-resource scenarios, data scarcity skews the gradients used to compute the FIM, making it a noisy and suboptimal heuristic for parameter selection.

Methods

To overcome the limitations of discrete, heuristic-based sub-network selection, the authors propose Attention-Guided Weights Mixup embedded within a Bi-Level Optimization (BLO) framework.

1. Continuous Relaxation via Weight Mixup

Instead of making a hard binary choice about whether a weight belongs to the child network, the authors introduce a continuous relaxation. Each network weight ($\tilde{W}$) is represented as an element-wise interpolation (mixup) of a task-specific weight ($W$) and the frozen pretrained weight ($W_0$):

$$\tilde{W} = \alpha \odot W + (1 - \alpha) \odot W_0$$

Here, $\alpha \in [0, 1]$ acts as an "attention parameter" regulating the balance between the two weights. To prevent the attention matrix itself from overfitting the small dataset, it is constrained using a low-rank approximation ($r=1$).

2. Bi-Level Optimization (BLO)

Learning both the task weights ($W$) and the attention parameters ($\alpha$) on the same small dataset would trigger immediate overfitting. To solve this, the authors split the training data into two distinct sets ($80\%$ training, $20\%$ validation) and set up a two-stage optimization game:

  • Stage I (Lower-level): Optimize the task weights ($W$) by minimizing cross-entropy loss on the training split, keeping $\alpha$ fixed.
  • Stage II (Upper-level): Optimize the attention parameters ($\alpha$) by minimizing loss on the validation split, given the optimal task weights from Stage I.
Overview of the proposed bi-level optimization framework

This formulation ensures that the sub-network selection ($\alpha$) is directly optimized for downstream generalization performance rather than raw training set memorization.

Datasets

The method was evaluated using eight datasets from the standard GLUE benchmark, covering a variety of NLP tasks:

  • Sentiment Classification: SST-2
  • Natural Language Inference: RTE, QNLI, MNLI
  • Paraphrasing & Similarity: MRPC, STS-B, QQP
  • Linguistic Acceptability: CoLA

To simulate low-resource environments, the authors randomly downsampled the training sets of these benchmarks into splits of 300, 500, and 1,000 samples.

Key Insights and Ideas

  • Soft Selection Beats Hard Thresholds: Moving from discrete sub-network masks to continuous weight mixups allows gradient descent to smoothly navigate the parameter space, finding finer-grained balances between pretraining knowledge and task adaptation.
  • Direct Optimization Over Heuristics: Sidestepping the Fisher Information Matrix in favor of a validation-targeted bi-level optimization loop eliminates the gradient noise inherent to small-sample FIM estimation.
  • Data Splitting is Crucial for Meta-Variables: Learning routing or regularization parameters ($\alpha$) on validation splits acts as an effective regularizer, preventing the model from exploiting shortcuts in the training data.

Key Results

  • Superiority in Low-Resource Regimes: On the ultra-scarce 300-sample split using $\text{BERT}_{\text{LARGE}}$, the proposed method outperformed the best previous sub-network method ($\text{CHILD-TUNING}_D$) by an average of 6.43% across all GLUE tasks. It maintained a 3.43% lead on 500 samples and a 1.68% lead on 1,000 samples.
Results on downsampled GLUE splits using BERT-Large
  • Outperforming PEFT: The approach consistently beat popular Parameter-Efficient Finetuning (PEFT) methods like LoRA, Prefix-Tuning, and Prompt Tuning, which often struggle to match vanilla finetuning performance when data is extremely limited.
Figure 2: Averaged performance across CoLA, RTE, STSB, and MRPC datasets for Vanilla, Prompt Tuning, Prefix-Tuning, LoRA, and our method in low-resource scenarios with 500 and 1000 training instances. Results on each dataset are presented in Table 9.
  • Cross-Architecture Stability: The method successfully stabilized and boosted performance across five distinct PLM architectures ($\text{BERT}$, $\text{BART}$, $\text{RoBERTa}$, $\text{DeBERTa}$, and $\text{XLNet}$), significantly reducing the standard deviation across different random seeds.
Performance across different pretrained language models

Limitations and Future Work

The primary drawback of this method is its computational overhead during training. Because bi-level optimization involves a nested dependency, calculating the gradients for $\alpha$ requires evaluating a complex Hessian-vector product. Even with finite-difference approximations, the training process takes between 1.8x to 4x longer than standard vanilla finetuning.

To mitigate this, the authors suggest exploring intermittent updates for the attention parameters (e.g., updating $\alpha$ every $T$ iterations instead of every step) in future work. They also note that extending this continuous relaxation framework to lifelong learning and multilingual adaptation represents a promising research direction.

Summary updated

Abstract

Pretrained Language Models (PLMs) have advanced Natural Language Processing (NLP) tasks significantly, but finetuning PLMs on low-resource datasets poses significant challenges such as instability and overfitting. Previous methods tackle these issues by finetuning a strategically chosen subnetwork on a downstream task, while keeping the remaining weights fixed to the pretrained weights. However, they rely on a suboptimal criteria for sub-network selection, leading to suboptimal solutions. To address these limitations, we propose a regularization method based on attention-guided weight mixup for finetuning PLMs. Our approach represents each network weight as a mixup of task-specific weight and pretrained weight, controlled by a learnable attention parameter, providing finer control over sub-network selection. Furthermore, we employ a bi-level optimization (BLO) based framework on two separate splits of the training dataset, improving generalization and combating overfitting. We validate the efficacy of our proposed method through extensive experiments, demonstrating its superiority over previous methods, particularly in the context of finetuning PLMs on low-resource datasets.
BibTeX
@inproceedings{somayajula2024generalizable,
  author = {Sai Ashish Somayajula and Youwei Liang and Abhishek Singh and Li Zhang and Pengtao Xie},
  title = {{Generalizable and Stable Finetuning of Pretrained Language Models on Low-Resource Texts}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.naacl-long.277},
}
Figure