Noise Stability Regularization for Improving BERT Fine-tuning

Hang Hua, Xingjian Li, Dejing Dou, Cheng-Zhong Xu, Jiebo Luo

Introduction: The Brittleness of Small-Scale Fine-tuning

Fine-tuning large-scale pre-trained models like BERT has become the standard for NLP tasks. However, this process is notoriously "brittle" when applied to small datasets (typically fewer than 10,000 examples). Performance can vary significantly based on the random seed used for initialization and data shuffling, making it difficult to achieve consistent, state-of-the-art results.

This paper identifies noise sensitivity as a primary cause of this instability. In a robust model, small perturbations in lower-layer representations should not lead to dramatic shifts in higher layers. However, the authors demonstrate that in standard BERT fine-tuning, the top layers remain highly sensitive to noise injected at the input. As shown in Figure 1, models that achieve higher final accuracy naturally exhibit lower "error ratios" in their top layers, suggesting that stability is a prerequisite for good generalization.

Error ratio across BERT layers for different performance levels. Higher layers in standard models often show increased volatility.

Methodology: Layer-wise Noise Stability Regularization (LNSR)

To address this volatility, the authors propose Layer-wise Noise Stability Regularization (LNSR). This lightweight method improves the model's local Lipschitz continuity by forcing internal representations to be insensitive to small perturbations. The process involves three key steps:

  1. Noise Injection: Gaussian noise is injected into the input of a specific layer (typically the first layer) during the training phase.
  2. Consistency Constraint: A regularization term is added to the loss function that calculates the $L^2$ distance between the original output and the noise-perturbed output for every subsequent layer.
  3. Optimization: By minimizing this distance, the model learns "stable" representations where small feature shifts do not propagate into large output changes.

Unlike standard data augmentation, LNSR explicitly constrains the consistency of intermediate representations. Theoretically, this approach acts as a form of Tikhonov regularization involving both the Jacobian and Hessian of the loss function, providing a stronger smoothing effect than input-only noise.

Experimental Results and Stability

The authors evaluated LNSR on four "few-sample" tasks from the GLUE (General Language Understanding Evaluation) benchmark: CoLA, MRPC, RTE, and STS-B. These tasks were selected specifically because they contain fewer than 10,000 training samples, where BERT's instability is most pronounced.

Across 25 random seeds, LNSR consistently outperformed standard fine-tuning and state-of-the-art stabilizers like Mixout and SMART. As illustrated in Figure 6, LNSR not only achieves higher mean and maximum evaluation scores but also significantly reduces the variance (standard deviation) of the results.

Comparison of LNSR against baselines (BERT, L2-SP, Mixout, SMART) across four GLUE tasks. LNSR shows higher mean scores and reduced variance.

Key Findings:

  • Higher Accuracy: On the RTE task, LNSR reached a mean accuracy of 73.31%, a substantial improvement over the 70.13% achieved by standard fine-tuning.
  • Enhanced Stability: On MRPC, the standard deviation dropped from 0.92 to 0.56, indicating a much more reliable training process.
  • Computational Efficiency: Unlike adversarial methods like SMART, which require iterative gradient steps to find worst-case perturbations, LNSR uses simple Gaussian noise, making it computationally lighter while delivering superior performance.

Conclusion

Layer-wise Noise Stability Regularization (LNSR) offers a simple yet effective solution to the instability of BERT fine-tuning on small datasets. By smoothing the loss landscape and enforcing consistency across layers, LNSR narrows the generalization gap and prevents the model from over-memorizing training noise. This makes it a valuable tool for researchers working in low-data regimes where model robustness is critical.

Summary updated

BibTeX
@inproceedings{hua2021noise,
  author = {Hang Hua and Xingjian Li and Dejing Dou and Cheng-Zhong Xu and Jiebo Luo},
  title = {{Noise Stability Regularization for Improving BERT Fine-tuning}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.naacl-main.258},
}
Figure