arXiv:2503.12649cs.LGcs.AI2025-03ICCV被引 6

用优化算法提升模型合并效率,支持海量模型快速融合且不增加内存开销。

FW-Merging: Scaling Model Merging with Frank-Wolfe Optimization

  • 基于Frank-Wolfe优化思想,逐轮选择最相关模型进行局部合并。
  • 在20个视觉任务上合并20个ViT模型,性能比先进方法高8.39%。
  • 适合处理来源多样、信息未知的开源模型合并,尤其适合大规模场景。

模型合并已成为多任务学习的有前景方法,提供数据高效的替代方案。然而,随着开源AI生态快速发展和微调基础模型数量激增,现有方法面临两大局限:(i) 主要针对内部微调模型设计,难以适应来源多样、任务信息部分未知的模型;(ii) 合并大量检查点时难以有效扩展。为此,我们将模型合并建模为约束优化问题,提出全新方法——Frank-Wolfe合并(FW-Merging)。受Frank-Wolfe优化启发,该方法迭代选择池中最具相关性的模型,以最小化目标函数的线性近似,并执行类似Frank-Wolfe更新的局部合并。目标函数捕捉期望的合并模型行为,而微调候选模型构成约束集。更重要的是,FW-Merging可与现有合并方法正交集成,进一步提升准确率。实验表明,其在多样化模型源上具备良好扩展性,在16个无关模型下保持稳定,16个相关模型时提升15.3%(20个CV任务),且内存开销恒定,优于数据依赖型方法的线性增长。相比最先进方法,合并20个ViT模型时,较无数据合并方法提升32.8%,较数据依赖的Adamerging提升8.39%。代码已开源:github.com/hmarkc/FW-Merging。

原文摘要 · Abstract (English)

Model merging has emerged as a promising approach for multi-task learning (MTL), offering a data-efficient alternative to conventional fine-tuning. However, with the rapid development of the open-source AI ecosystem and the increasing availability of fine-tuned foundation models, existing model merging methods face two key limitations: (i) They are primarily designed for in-house fine-tuned models, making them less adaptable to diverse model sources with partially unknown model and task information, (ii) They struggle to scale effectively when merging numerous model checkpoints. To address these challenges, we formulate model merging as a constrained optimization problem and introduce a novel approach: Frank-Wolfe Merging (FW-Merging). Inspired by Frank-Wolfe optimization, our approach iteratively selects the most relevant model in the pool to minimize a linear approximation of the objective function and then executes a local merging similar to the Frank-Wolfe update. The objective function is designed to capture the desired behavior of the target-merged model, while the fine-tuned candidate models define the constraint set. More importantly, FW-Merging serves as an orthogonal technique for existing merging methods, seamlessly integrating with them to further enhance accuracy performance. Our experiments show that FW-Merging scales across diverse model sources, remaining stable with 16 irrelevant models and improving by 15.3% with 16 relevant models on 20 CV tasks, while maintaining constant memory overhead, unlike the linear overhead of data-informed merging methods. Compared with the state-of-the-art approaches, FW-Merging surpasses the data-free merging method by 32.8% and outperforms the data-informed Adamerging by 8.39% when merging 20 ViT models. Our code is open-sourced at github.com/hmarkc/FW-Merging.

模型合并优化算法多任务学习ViT

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。