Skip to main content
QUICK REVIEW

[论文解读] Arcee's MergeKit: A Toolkit for Merging Large Language Models

Charles Goddard, Shamane Siriwardhana|arXiv (Cornell University)|Mar 20, 2024
Topic ModelingComputer Science被引用 3
一句话总结

本文介绍了 MergeKit,一个开源工具包,可在无需微调的情况下高效合并大型语言模型检查点,利用线性插值(LERP)、球面线性插值(SLERP)以及 TIES 等技术,将架构相同的模型进行融合。其主要贡献是一个可扩展、硬件灵活的框架,已产出多个表现优异的开源模型,包括在 Open LLM Leaderboard 上排名靠前的合并模型变体。

ABSTRACT

The rapid expansion of the open-source language model landscape presents an opportunity to merge the competencies of these model checkpoints by combining their parameters. Advances in transfer learning, the process of fine-tuning pretrained models for specific tasks, has resulted in the development of vast amounts of task-specific models, typically specialized in individual tasks and unable to utilize each other's strengths. Model merging facilitates the creation of multitask models without the need for additional training, offering a promising avenue for enhancing model performance and versatility. By preserving the intrinsic capabilities of the original models, model merging addresses complex challenges in AI - including the difficulties of catastrophic forgetting and multitask learning. To support this expanding area of research, we introduce MergeKit, a comprehensive, open-source library designed to facilitate the application of model merging strategies. MergeKit offers an extensible framework to efficiently merge models on any hardware, providing utility to researchers and practitioners. To date, thousands of models have been merged by the open-source community, leading to the creation of some of the worlds most powerful open-source model checkpoints, as assessed by the Open LLM Leaderboard. The library is accessible at https://github.com/arcee-ai/MergeKit.

研究动机与目标

  • 解决部署和维护多个专用任务 LLM 所面临的挑战,每个模型都需要独立的存储和推理资源。
  • 通过在不微调的情况下融合预训练模型,克服持续学习和多任务学习中的灾难性遗忘问题。
  • 使研究人员和实践者能够将专业化模型(如医疗、编程)的优势整合为统一的高性能模型。
  • 提供一个社区驱动、可扩展的框架,支持多样化的融合策略,并可在 CPU 和 GPU 上扩展。
  • 通过降低模型开发和部署的成本与复杂性,使先进 LLM 能力更易获取。

提出的方法

  • 实现模块化、可扩展的架构,支持多种模型融合策略,包括 LERP、SLERP、TIES 和 DARE-TIES。
  • 利用线性模式连通性(LMC)和置换对称性,对从同一基础模型训练出的模型权重空间进行对齐,实现稳定融合。
  • 通过 TIES 等技术支持架构相同但初始化不同的模型融合,TIES 通过基于梯度的优化方法优化融合权重。
  • 设计工具包以在 CPU 和 GPU 硬件上高效运行,提升广泛可用性和部署灵活性。
  • 与 Hugging Face 模型中心集成,促进模型发现、共享以及开源社区内的互操作性。
  • 提供基于 YAML 的配置驱动接口,用于定义融合流程,确保可复现性与易用性。
Figure 1: Classification of model merging methods. We currently support the model merging methods outlined on the left, and we are actively working to incorporate additional merging techniques such as ZipIt, OT Fusion, and Git Rebasin.
Figure 1: Classification of model merging methods. We currently support the model merging methods outlined on the left, and we are actively working to incorporate additional merging techniques such as ZipIt, OT Fusion, and Git Rebasin.

实验结果

研究问题

  • RQ1如何系统性地应用模型融合技术,将专用任务 LLM 合并为单一统一模型,同时避免灾难性遗忘?
  • RQ2哪些融合技术——如 LERP、SLERP 或 TIES——最能有效保留并增强源模型在融合配置中的能力?
  • RQ3在医疗、编程或通用指令遵循等专业领域,融合模型在多大程度上能超越单个基础模型的性能?
  • RQ4在参数效率和推理质量方面,融合模型与最先进的大规模模型相比表现如何?
  • RQ5哪些架构与工程设计原则能够实现一个可扩展、社区可扩展的模型融合工具包,以适应多样化的硬件和使用场景?

主要发现

  • 所有融合模型在 USMLE、MedMCQA 和 PubMedQA 等医疗基准测试中均优于 Meditron-7B 模型,展现出更强的专业领域性能。
  • 采用 SLERP 和 LERP 技术融合的模型在通用基准测试中表现超越 Llama2-7B chat 模型,表明其具备更强的泛化能力和多任务处理性能。
  • 融合模型 'RubielLabarta/LogoS-7Bx2-MoE-13B-v0.2' 在 Open LLM Leaderboard 上排名第 17 位,仅用 130 亿参数即达到顶级性能,优于许多参数量达 350 亿至 700 亿以上的未融合模型。
  • 融合了专家混合(MoE)架构的模型展现出卓越性能,同时优化了计算效率,凸显了模型融合在参数高效扩展方面的潜力。
  • 已有数千个模型通过 MergeKit 成功融合,其中许多达到最先进水平,证实了该框架在现实世界中的影响力与可扩展性。
  • 该工具包可在内存受限的 CPU 上实现高性能融合,展示了其广泛的硬件兼容性与可及性,尤其惠及无高端 GPU 的研究人员。
Figure 2: MergeKit structure with key modules for adding new merge methods. The diagram depicts the workflow for introducing new merge methods in the MergeKit repository. Initially, tensors are extracted from two models, A and B, and processed by the ‘Architecture’ module to ensure their structural
Figure 2: MergeKit structure with key modules for adding new merge methods. The diagram depicts the workflow for introducing new merge methods in the MergeKit repository. Initially, tensors are extracted from two models, A and B, and processed by the ‘Architecture’ module to ensure their structural

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。