Model Merging › Model Merging

Michael BrenndoerferFebruary 28, 20263 min read
Language AI HandbookAll chapters
Part 41 of 67Model Compression
Chapter 311Model Merging › Model Merging
Reading section 1 of 9 · Model Merging · 3 minSection 1 of 9 · 3 min

Book contents

Section 1 of 9 · 3 min read

Model Merging › Model MergingOne section · Sections in this chapter1 / 9 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

What if you could combine two separately trained language models, each expert in different domains, into a single model that inherits skills from both, without any additional training? That is the promise of model merging, a family of techniques that combine the weights of multiple models into one. Unlike ensemble methods that run several models in parallel, model merging produces a single model with the same architecture and inference cost as each individual component. You get multi-task capability with single-model overhead.

Model merging has become an important tool in the modern LLM toolkit. It enables practitioners to blend capabilities without data, without gradient computation, and often without access to the original training pipelines. You might merge a reasoning-specialized model with a coding-specialized model, or average dozens of checkpoints from different stages of a training run to find a set of weights that generalizes better. The results can be surprising: merged models frequently outperform any single component on benchmarks that span multiple capabilities. On the Open LLM Leaderboard maintained by Hugging Face, merged models have repeatedly ranked at the top, sometimes outperforming models with significantly more parameters and substantially more training compute.

The economics of model merging explain its appeal. Fine-tuning a 7-billion parameter language model from a strong base checkpoint costs a fraction of pretraining, and releasing fine-tuned variants has become common practice in the open-source community. When dozens of fine-tunes of the same base model are publicly available, each specialized for a different skill or domain, merging them becomes an attractive way to assemble a generalist model at nearly zero cost. The alternative, collecting data for all desired skills and running a joint fine-tune, requires coordination, data curation, and compute that most practitioners do not have access to.

This chapter covers the four core techniques: weight averaging, task arithmetic, TIES merging, and DARE merging. We will build intuition for why each approach works, examine the mathematical operations involved, trace through the history of how each idea emerged, and implement them from scratch. Along the way, we will pay close attention to when each method is likely to succeed and where it fails.