SuperMerge: An Approach For Gradient-Based Model Merging
Haoyu Yang, Zheng Zhang, Saket Sathe
TL;DR
SuperMerge presents a gradient-based approach to merge multiple fine-tuned models into a single multitask model by learning per-layer merging weights with a small validation-driven objective. The key idea is to represent the merged weights as ${m{ heta}}^m(j) = {m{ heta}}^p(j) + \sum_{i=1}^k \tanh(w(i, j)) ({m{ heta}}^f(i,j) - {m{ heta}}^p(i,j))$, where ${m{ au}}(i,j) = {m{ heta}}^f(i,j) - {m{ heta}}^p(i,j)$ and $W = [w(i,j)]$ is trained on a small validation set. The method uses a tanh activation to bound contributions, enabling negative and positive adjustments with a tiny number of parameters, and introduces hierarchical merging to reduce peak memory when combining many tasks. Experiments across NLP and CV tasks show that SuperMerge generally outperforms existing merging methods in-domain and generalizes better to unseen tasks, while hierarchical merging substantially lowers memory requirements with little to no loss in accuracy. These results imply a practical, scalable pathway to extend task coverage for large pretrained models without full re-fine-tuning.
Abstract
Large language models, such as ChatGPT, Claude, or LLaMA, are gigantic, monolithic, and possess the superpower to simultaneously support thousands of tasks. However, high-throughput applications often prefer smaller task-specific models because of their lower latency and cost. One challenge of using task-specific models is the incremental need for solving newer tasks after the model is already deployed for existing tasks. A straightforward solution requires fine-tuning the model again for both existing and new tasks, which is computationally expensive and time-consuming. To address this issue, we propose a model merging based approach called SUPERMERGE. SUPERMERGE is a gradient-based method to systematically merge several fine-tuned models trained on existing and new tasks. SUPERMERGE is designed to be lightweight and fast, and the merged model achieves similar performance to fully fine-tuned models on all tasks. Furthermore, we proposed a hierarchical model merging strategy to reduce the peak space requirement without sacrificing the performance of the merged model. We experimentally demonstrate that SUPERMERGE outperforms existing model merging methods on common natural language processing and computer vision tasks.
