Skip to main content
QUICK REVIEW

[Paper Review] An Empirical Study on Hyperparameter Optimization for Fine-Tuning Pre-trained Language Models

Xueqing Liu, Chi Wang|arXiv (Cornell University)|Jun 17, 2021
Topic ModelingComputer Science32 references5 citations
TL;DR

This paper empirically evaluates hyperparameter optimization (HPO) methods—Bayesian optimization, random search, and early stopping—on fine-tuning BERT and RoBERTa across GLUE tasks. Despite using the same time budget as grid search, HPO often underperforms due to insufficient budget and overfitting; however, a systematic troubleshooting procedure with expanded budget and reduced search space enables HPO to surpass grid search in several cases, highlighting the need for careful configuration and overfitting mitigation in HPO for NLP fine-tuning.

ABSTRACT

The performance of fine-tuning pre-trained language models largely depends on the hyperparameter configuration. In this paper, we investigate the performance of modern hyperparameter optimization methods (HPO) on fine-tuning pre-trained language models. First, we study and report three HPO algorithms' performances on fine-tuning two state-of-the-art language models on the GLUE dataset. We find that using the same time budget, HPO often fails to outperform grid search due to two reasons: insufficient time budget and overfitting. We propose two general strategies and an experimental procedure to systematically troubleshoot HPO's failure cases. By applying the procedure, we observe that HPO can succeed with more appropriate settings in the search space and time budget; however, in certain cases overfitting remains. Finally, we make suggestions for future work. Our implementation can be found in https://github.com/microsoft/FLAML/tree/main/flaml/nlp/.

Motivation & Objective

  • To evaluate whether automated HPO methods can outperform traditional grid search in fine-tuning pre-trained language models under the same time budget.
  • To identify root causes of HPO failure in NLP fine-tuning, particularly insufficient time budget and overfitting.
  • To design and validate a systematic experimental procedure for troubleshooting HPO failures in hyperparameter optimization for language model fine-tuning.
  • To provide actionable recommendations for improving HPO performance in practice, especially for low-resource or high-variance NLP tasks.

Proposed method

  • The study evaluates three HPO methods—Bayesian optimization, random search, and early stopping—on two SOTA models (Electra and RoBERTa) across GLUE tasks.
  • A fixed time budget B is imposed on each HPO method to ensure fair comparison with grid search, with trials involving model training and validation on D_val.
  • The search space S is defined over key hyperparameters: initial learning rate, batch size, and weight decay, with configurations sampled or optimized accordingly.
  • A systematic troubleshooting procedure is proposed, involving iterative refinement of the search space and increasing the time budget to reduce overfitting and improve HPO performance.
  • The evaluation protocol f(·) uses validation accuracy (or Pearson score for STS-B), and final model performance is tested on D_test to assess generalization.
  • Experiments are conducted with a fixed random seed (42) to eliminate variance from stochasticity, ensuring reproducibility and fair comparison.

Experimental results

Research questions

  • RQ1Can automated HPO methods outperform grid search in fine-tuning pre-trained language models when using the same time budget?
  • RQ2On which NLP tasks do HPO methods show superior performance compared to grid search?
  • RQ3What are the primary causes of HPO failure in the context of fine-tuning pre-trained language models?
  • RQ4How can overfitting and insufficient budget be systematically mitigated to improve HPO performance?
  • RQ5What role does the search space configuration play in HPO success, and how can it be optimized per model and task?

Key findings

  • With the same time budget as grid search, HPO methods often fail to outperform grid search due to insufficient exploration and overfitting to the validation set.
  • Overfitting remains a persistent issue even when searching only over learning rate and batch size, particularly on tasks like RTE, MRPC, and CoLA.
  • By expanding the time budget and narrowing the search space based on model- and task-specific patterns, HPO outperforms grid search in multiple GLUE tasks.
  • Random search consistently performs strongly, often matching or exceeding more advanced Bayesian optimization and early stopping methods under limited budget.
  • The study identifies that default grid search configurations are already highly tuned, which may explain why HPO struggles to surpass them without careful configuration.
  • The proposed systematic troubleshooting procedure significantly improves HPO reliability and reveals that search space design is critical for success.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.