arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.00061cs.LGcs.AI
收藏

免训练异构模型合并

Training-free Heterogeneous Model Merging

Zhejiang University(浙江大学)

Zhengqi Xu, Han Zheng, Jie Song, Li Sun, Mingli Song

AI总结:

本文针对模型架构异构导致的合并困难,提出免训练异构模型合并框架,通过层对齐策略和弹性神经元压缩算法分别解决深度与宽度差异,在视觉和NLP任务上达到与同构合并相当的性能。

摘要:

模型合并作为一种强大的模型复用范式已引起广泛关注,它有助于将面向特定任务的模型整合到一个统一的、具备多种能力的框架中。以往的研究主要采用权重平均(Weight Average, WA)等方法,已经表明模型合并能够有效利用预训练模型,而无需进行繁重的重新训练。然而,模型之间固有的异构性对其适用性构成了重大限制,尤其是在面临模型架构差异时。为了克服这一挑战,我们提出了一种面向异构模型的创新模型合并框架,该框架同时涵盖深度异构和宽度异构。针对深度异构,我们引入了一种层对齐策略,通过对较深的模型进行分段来协调模型层,将具有相似表示的连续层视为一个内聚段,从而实现不同层深度模型的无缝合并。针对宽度异构,我们提出了一种新颖的弹性神经元压缩(elastic neuron zipping)算法,将不同宽度模型的权重投影到一个公共维度空间,从而无需相同宽度。大量实验验证了所提方法的有效性,表明在视觉和自然语言处理(NLP)任务中,结构异构模型的合并可以达到与同构合并相当的性能水平。我们的代码已公开发布在 https://github.com/zju-vipa/training_free_heterogeneous_model_merging。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑