Introduction
Fine-tuning large language models (LLMs) is a critical step in adapting pre-trained architectures to specific downstream tasks. However, this process is notoriously sensitive to hyperparameter configurations. While techniques like Stochastic Weight Averaging (SWA) have proven effective in computer vision by finding "flat" minima in the loss landscape, their application to Natural Language Processing (NLP) has yielded inconsistent results. This paper introduces Bayesian Optimization Model Fusion (BOMF), a framework designed to overcome the unique challenges of NLP model optimization.
The Challenge: The Loss-Metric Mismatch
A fundamental observation driving this research is the misalignment between training loss and task-specific performance metrics (e.g., F1 score, accuracy) in NLP. In computer vision, the flattest region of the loss landscape typically coincides with the best generalization. In contrast, for models like RoBERTa, the region of minimum loss does not necessarily correspond to the peak of the metric landscape.
As illustrated in the figures, while SWA successfully identifies a low-loss region, it often misses the optimal performance point. This "flatness fallacy" explains why traditional weight-averaging methods often provide only marginal gains in language tasks compared to vision tasks where loss and metrics are more closely aligned.
Methodology: The BOMF Framework
BOMF addresses these issues through a two-stage optimization process:
1. Efficient Hyperparameter Search
The authors leverage the empirical finding that optimal hyperparameters—such as learning rate and batch size—are consistent across different model scales and configurations (e.g., frozen layers or lower LoRA ranks). By performing Bayesian Optimization (BO) on these "lightweight" model versions, BOMF identifies high-performing settings for full-scale fine-tuning at a fraction of the computational cost, reducing search time by up to 66%.
2. Multi-Objective Bayesian Optimization (MOBO) for Fusion
Rather than simple averaging, BOMF treats model fusion as a black-box optimization problem. It employs Multi-Objective Bayesian Optimization to determine the optimal averaging coefficients ($\delta$) for a set of candidate models. By optimizing both the differentiable loss and non-differentiable task metrics simultaneously using the Expected HyperVolume Improvement (EHVI) strategy, BOMF identifies a Pareto frontier that balances these objectives.
Experimental Results
The effectiveness of BOMF was validated across a diverse set of benchmarks:
- NLU (RoBERTa on GLUE): BOMF achieved an average score of 90.30, significantly outperforming standard fine-tuning (88.93) and SWA (89.17).
- NLG (LLaMA2 on Summarization): On the SAMSum dataset, BOMF reached a Rouge score of 42.19, surpassing the best single-model baseline (41.73).
- Question Answering & Medical QA: Consistent improvements were observed on SQuAD 2.0 and KorMedMCQA, demonstrating the framework's versatility across tasks and model sizes (up to LLaMA3-8B).
Conclusion
BOMF represents a significant advancement in LLM fine-tuning by explicitly addressing the loss-metric mismatch in NLP. By combining efficient hyperparameter transfer with multi-objective model fusion, it provides a robust and computationally efficient path to state-of-the-art performance. Future work will explore the application of these techniques to quantized models and seek a deeper theoretical understanding of hyperparameter alignment across model scales.
Summary updated