Skip to main content
QUICK REVIEW

[Paper Review] Arcee's MergeKit: A Toolkit for Merging Large Language Models

Charles Goddard, Shamane Siriwardhana|arXiv (Cornell University)|Mar 20, 2024
Topic ModelingComputer Science3 citations
TL;DR

This paper introduces MergeKit, an open-source toolkit that enables efficient merging of large language model checkpoints without retraining, leveraging techniques like Linear and Spherical Linear Interpolation (LERP, SLERP) and TIES to combine models with identical architectures. The key contribution is a scalable, hardware-flexible framework that has produced top-performing open-source models, including merged variants ranking among the best on the 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.

Motivation & Objective

  • Address the challenge of deploying and maintaining multiple task-specific LLMs, each requiring separate storage and inference resources.
  • Overcome catastrophic forgetting in continual and multitask learning by fusing pretrained models without fine-tuning.
  • Enable researchers and practitioners to combine the strengths of specialized models (e.g., medical, coding) into unified, high-performing models.
  • Provide a community-driven, extensible framework that supports diverse merging strategies and scales across CPUs and GPUs.
  • Democratize access to advanced LLM capabilities by reducing the cost and complexity of model development and deployment.

Proposed method

  • Implement a modular, extensible architecture that supports multiple model merging strategies, including LERP, SLERP, TIES, and DARE-TIES.
  • Leverage Linear Mode Connectivity (LMC) and permutation symmetry to align weight spaces of models trained from a common base, enabling stable merging.
  • Support merging of models with identical architectures but different initializations through techniques like TIES, which optimize merging weights via gradient-based refinement.
  • Design the toolkit to operate efficiently on both CPU and GPU hardware, enabling broad accessibility and deployment flexibility.
  • Integrate with the Hugging Face model hub to facilitate model discovery, sharing, and interoperability across the open-source community.
  • Provide a configuration-driven interface using YAML-based specifications to define merging pipelines, enabling reproducibility and ease of use.
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.

Experimental results

Research questions

  • RQ1How can model merging be systematically applied to combine task-specific LLMs into a single, unified model without catastrophic forgetting?
  • RQ2What are the most effective merging techniques—such as LERP, SLERP, or TIES—for preserving and enhancing the capabilities of source models in merged configurations?
  • RQ3To what extent can merged models outperform individual base models in specialized domains like medicine, coding, or general instruction following?
  • RQ4How does the performance of merged models compare to state-of-the-art, larger-scale models, particularly in terms of parameter efficiency and inference quality?
  • RQ5What architectural and engineering design principles enable a scalable, community-extensible toolkit for model merging across diverse hardware and use cases?

Key findings

  • All merged models outperformed the Meditron-7B model across medical benchmarks, including USMLE, MedMCQA, and PubMedQA, demonstrating enhanced domain-specific performance.
  • Models merged using SLERP and LERP techniques surpassed the performance of the Llama2-7B chat model on general benchmarks, indicating improved generalization and multitask capability.
  • The merged model 'RubielLabarta/LogoS-7Bx2-MoE-13B-v0.2' ranked 17th on the Open LLM Leaderboard, achieving top-tier performance with only 13 billion parameters, outperforming many unmerged models with 35–70+ billion parameters.
  • Merged models incorporating mixture-of-experts (MoE) architectures demonstrated exceptional performance while optimizing computational efficiency, highlighting the potential of model merging for parameter-efficient scaling.
  • Thousands of models have been successfully merged using MergeKit, with many achieving state-of-the-art results, confirming the framework’s real-world impact and scalability.
  • The toolkit enables high-performance merging on memory-constrained CPUs, demonstrating broad hardware compatibility and accessibility for researchers without access to high-end GPUs.
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

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.