model-merging

Merge fine-tuned language models with mergekit using SLERP, TIES, DARE, and Task Arithmetic.

13.0k|930|Updated Nov 3, 2025
One-click install
npx skills add https://github.com/Orchestra-Research/AI-research-SKILLs --skill model-merging-orchestra-research
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: model-merging
Source: https://github.com/Orchestra-Research/AI-research-SKILLs/tree/main/19-emerging-techniques/model-merging
Command: npx skills add https://github.com/Orchestra-Research/AI-research-SKILLs --skill model-merging-orchestra-research

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mergekit, transformers, torch, and includes references (resource) components.

What problem does it solve? Combining capabilities from multiple fine-tuned models normally requires expensive retraining; this Skill merges model weights directly with mergekit so you can blend math, coding, and chat expertise into one model on CPU in minutes. ## Core Features & Use Cases - Multiple Merge Methods: Configure linear, SLERP, Task Arithmetic, TIES-Merging, and DARE merges through mergekit YAML configs, including layer-wise and MoE-style merging. - Unsupervised Coefficient Tuning: Select optimal merge coefficients without labeled data using generation consistency (AdaMMS), detailed in references/coefficient-tuning.md. - Evaluation & Production Guidance: Benchmark merged models on Open LLM Leaderboard, MT-Bench, MMLU, HumanEval, and GSM8K, then quantize and deploy to HuggingFace Hub. - Use Case: Merge WizardMath, OpenHermes, and a code model with TIES-Merging to create a single Mistral-7B variant that retains all three capabilities without catastrophic forgetting. ## Quick Start Merge Mistral-7B and OpenHermes-2.5-Mistral-7B with a SLERP configuration at t=0.5 and benchmark the result on MMLU.

Frequently Asked Questions about model-merging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I merge two LLMs with mergekit?▼

Write a YAML config specifying a merge_method such as slerp or linear, list the source models with weights or an interpolation factor t, then run mergekit-yaml config.yml ./merged-model --cuda. The merged model loads with standard transformers APIs.

Which model merging method should I use: SLERP, TIES, or DARE?▼

Use SLERP for smoothly blending two models, linear averaging for a few similar models, and Task Arithmetic or TIES-Merging when combining multiple task-specific models. DARE or DARE-TIES reduces redundancy and often performs best when merging three or more models.

Can I merge models with different architectures like Llama and Mistral?▼

No, merging only works between models sharing the same architecture, such as two Mistral-7B variants. Mismatched architectures like Llama and Mistral have incompatible weight layouts and cannot be merged.

How do I choose merge weights without labeled evaluation data?▼

Use generation consistency: merge with several candidate coefficients, generate responses on a small unlabeled prompt set, and pick the coefficient whose outputs are most similar to its neighbors. This unsupervised proxy from AdaMMS (arXiv:2503.23733) avoids manual grid search.

Why does my merged model perform worse than its parents?▼

Common causes include over-weighting one model beyond the 0.3-0.7 range, merging incompatible architectures, or excessive sparsity in TIES/DARE density settings. Always benchmark the merged model on MMLU, GSM8K, or MT-Bench before deploying.