Training-free Heterogeneous Model Merging

Zhengqi Xu, Han Zheng, Jie Song, Li Sun, Mingli Song
12/29/2024
cs.LGcs.AI

Official code: zju-vipa/training_free_heterogeneous_model_merging (12 stars, last commit 2024-12-29).

Abstract

Model merging has attracted significant attention as a powerful paradigm for model reuse, facilitating the integration of task-specific models into a singular, versatile framework endowed with multifarious capabilities. Previous studies, predominantly utilizing methods such as Weight Average (WA), have shown that model merging can effectively leverage pretrained models without the need for laborious retraining. However, the inherent heterogeneity among models poses a substantial constraint on its applicability, particularly when confronted with discrepancies in model architectures. To overcome this challenge, we propose an innovative model merging framework designed for heterogeneous models, encompassing both depth and width heterogeneity. To address depth heterogeneity, we introduce a layer alignment strategy that harmonizes model layers by segmenting deeper models, treating consecutive layers with similar representations as a cohesive segment, thus enabling the seamless merging of models with differing layer depths. For width heterogeneity, we propose a novel elastic neuron zipping algorithm that projects the weights from models of varying widths onto a common dimensional space, eliminating the need for identical widths. Extensive experiments validate the efficacy of these proposed methods, demonstrating that the merging of structurally heterogeneous models can achieve performance levels comparable to those of homogeneous merging, across both vision and NLP tasks. Our code is publicly available at https://github.com/zju-vipa/training_free_heterogeneous_model_merging.

View on arXivView PDF

Code Implementations(1)

127Shell, PythonDec 29, 20241 years ago

Similar Papers

Cite this paper

@article{xu2024trainingfree,
  title  = {Training-free Heterogeneous Model Merging},
  author = {Zhengqi Xu and Han Zheng and Jie Song and Li Sun and Mingli Song},
  year   = {2024},
  eprint = {2501.00061},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.00061v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.00061.svg)](https://codeofpaper.com/paper/2501.00061)

Discussion