NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Hyperparameter Optimization for Large Language Model Instruction-Tuning

Christophe Tribes, Sacha Benarroch-Lelong, Peng Lu, Ivan Kobyzev · OpenReview

TL;DR

This paper explores how to automatically find the best hyperparameters for instruction-tuning Large Language Models (LLMs) using parameter-efficient methods like LoRA. By employing Black-Box Optimization (BBO) techniques, they demonstrate that systematic hyperparameter tuning significantly improves LLM performance on downstream tasks and human preference, outperforming default settings.

What Problem Does This Paper Address?

Large Language Models (LLMs) have become incredibly powerful, but making them follow specific user instructions (instruction-tuning) is crucial for practical applications. While methods like LoRA (Low-Rank Adaptation) make fine-tuning more efficient by only updating a small fraction of model weights, their performance is highly sensitive to various hyperparameters (e.g., LoRA rank, learning rate, scaling factor). Manually finding the optimal combination of these hyperparameters is a tedious and time-consuming process. This paper addresses the challenge of efficiently and effectively optimizing these hyperparameters to achieve better instruction-tuned LLMs.

Methods

The core of this work is the application of Black-Box Optimization (BBO) techniques to find optimal hyperparameters for LoRA-based instruction-tuning. BBO algorithms treat the entire fine-tuning and validation process as a "black box," meaning they don't need to know the internal workings of the model or the objective function's analytical form. Instead, they iteratively propose hyperparameter settings, evaluate the model's performance, and use this feedback to guide future proposals.

The authors specifically compare two BBO algorithms:

  • MADS (Mesh Adaptive Direct Search) implemented in NOMAD: A direct search algorithm known for its ability to handle complex, non-smooth, and potentially constrained optimization problems. It uses a mesh-based approach to explore the search space.
  • TPE (Tree-structured Parzen Estimator) implemented in NNI (Neural Network Intelligence): A Bayesian optimization method that builds a probabilistic model of the objective function to balance exploration and exploitation of the hyperparameter space.

They frame the hyperparameter optimization problem as minimizing the validation loss of the instruction-tuned model.

Datasets

The paper uses a combination of two instruction-following datasets for training and evaluation:

  • Stanford Alpaca Project dataset: A large dataset with diverse instructions.
  • Databricks' Dolly dataset: Another dataset with 15,000 instruction-output pairs.

These were combined to create a 54k-sized training set and a 13k-sized validation set. For evaluating the performance of the optimized models on downstream tasks, they utilize the Instruct-Eval benchmark, which includes tasks like MMLU, BBH, DROP, and HumanEval.

Key Insights and Ideas

  • Validation loss is a useful proxy, but not the whole story: While optimizing for validation loss yielded good results, the paper highlights that the best models in terms of validation loss didn't always achieve the highest scores on all downstream benchmarks. This suggests that a single objective might not fully capture the desired model capabilities.
  • NOMAD and NNI-TPE show different exploration patterns: NOMAD tended to focus on higher LoRA ranks, potentially due to its search strategy and the warm-start from previous experiments. NNI-TPE, on the other hand, explored a wider range of hyperparameters, including lower LoRA ranks, and achieved better validation losses.
  • Human preference matters: Beyond automated benchmarks, human evaluation revealed a clear preference for models tuned with the proposed hyperparameter optimization methods over those with default settings. This underscores the importance of human alignment in LLM development.
  • Hyperparameter optimization is crucial for instruction-tuning: The study strongly confirms that careful selection of hyperparameters significantly boosts the performance of instruction-tuned LLMs, both on objective metrics and subjective human judgment.

Key Results

  • Performance Improvement: The best models found through hyperparameter optimization (both NOMAD and NNI-TPE) generally outperformed the model with default LoRA hyperparameters on downstream instruction-following tasks, particularly for MMLU and HumanEval.
  • NOMAD vs. NNI-TPE: While NNI-TPE achieved lower validation losses and explored a broader range of LoRA ranks, NOMAD found models with slightly higher average scores on MMLU, DROP, and HumanEval among its top 10.
  • Human Preference: Models tuned with NOMAD's optimized hyperparameters showed a 5% human preference advantage over the default settings on a randomly sampled set of questions from the Vicuna human preference dataset.
  • LoRA Rank Sensitivity: The experiments indicated that higher LoRA ranks (e.g., 512) often led to lower validation losses, but this wasn't always directly correlated with better performance on all downstream tasks, suggesting a potential trade-off with overfitting or generalization.

Limitations and Future Work

  • Single Objective vs. Multi-objective: The authors acknowledge that using only validation loss as the sole objective for BBO might not be sufficient for finding truly optimal models across all downstream tasks. They suggest that future work could explore multi-objective BBO to consider multiple performance metrics simultaneously.
  • Computational Budget: The HPO was performed with a fixed and relatively small evaluation budget, which might have limited the thoroughness of the search.
  • Generalizability: While the study focuses on LLaMA 2 7B, further research could investigate the effectiveness of these HPO techniques across different LLM architectures and sizes.
  • Picking a Single Best Model: Developing a robust methodology to select a single best model from a set of candidates, especially when trade-offs exist between different evaluation criteria, is identified as a key area for future work.

Summary updated

BibTeX
@misc{tribes2023hyperparameter,
  author = {Christophe Tribes and Sacha Benarroch-Lelong and Peng Lu and Ivan Kobyzev},
  title = {{Hyperparameter Optimization for Large Language Model Instruction-Tuning}},
  year = {2023},
  eprint = {2312.00949},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.00949},
}
Figure