Understanding Model Merging: A Unified Generalization Framework for Heterogeneous Experts
Qinglun Li, Anke Tang, Miao Zhang, Mengzhu Wang, Quanjun Yin, Li Shen
TL;DR
The paper tackles the lack of a unified theory for model merging under heterogeneous fine-tuning hyperparameters by introducing an $L_2$-stability based excess-error bound for the merged model $oldsymbol{x}_{avg}$. It unifies diverse merging strategies by showing they optimize different terms in the bound and provides actionable guidance on selecting hyperparameters to build merge-friendly experts. The empirical validation spans thousands of finetuning and merging trials on ResNet and ViT across 20 tasks, demonstrating strong alignment between theory and practice and offering practical insights for pretrain-to-merge pipelines. Overall, the work transforms model merging from an empirical craft into a principled framework with theory-driven recommendations and broad applicability to heterogeneous downstream tasks.
Abstract
Model merging efficiently aggregates capabilities from multiple fine-tuned models into a single one, operating purely in parameter space without original data or expensive re-computation. Despite empirical successes, a unified theory for its effectiveness under heterogeneous finetuning hyperparameters (e.g., varying learning rates, batch sizes) remains missing. Moreover, the lack of hyperparameter transparency in open-source fine-tuned models makes it difficult to predict merged-model performance, leaving practitioners without guidance on how to fine-tune merge-friendly experts. To address those two challenges, we employ $L_2$-Stability theory under heterogeneous hyperparameter environments to analyze the generalization of the merged model $\boldsymbol{x}_{avg}$. This pioneering analysis yields two key contributions: (i) \textit{A unified theoretical framework} is provided to explain existing merging algorithms, revealing how they optimize specific terms in our bound, thus offering a strong theoretical foundation for empirical observations. (ii) \textit{Actionable recommendations} are proposed for practitioners to strategically fine-tune expert models, enabling the construction of merge-friendly models within the pretraining-to-finetuning pipeline. Extensive experiments on the ResNet/Vit family across 20/8 visual classification tasks, involving thousands of finetuning models, robustly confirm the impact of different hyperparameters on the generalization of $\boldsymbol{x}_{avg}$ predicted by our theoretical results.
