Home Knowledge Base Model Merging

Model Merging is the technique of combining the weights of multiple independently fine-tuned models into a single model without additional training — creating models that inherit capabilities from all parent models simultaneously, enabling zero-cost composition of specialized skills like coding + instruction following + math reasoning into one unified model.

Why Model Merging?

Merging Methods

MethodTechniqueStrengths
Linear (Lerp)$W = (1-\alpha)W_A + \alpha W_B$Simple, effective baseline
SLERPSpherical interpolationPreserves weight magnitudes better
TIESTrim, Elect Sign, MergeResolves parameter conflicts
DAREDrop And REscaleRandomly drops delta params before merge
Task ArithmeticAdd task vectors to baseCompositional task addition
Model SoupsAverage multiple fine-tuned modelsRobust, reduces variance

SLERP (Spherical Linear Interpolation)

$W = \frac{\sin((1-t)\Omega)}{\sin(\Omega)} W_A + \frac{\sin(t\Omega)}{\sin(\Omega)} W_B$

where $\Omega = \arccos(\frac{W_A \cdot W_B}{||W_A|| \cdot ||W_B||})$

TIES-Merging (Yadav et al., 2023)

1. Trim: Zero out small-magnitude task vector components (keep top-K%). 2. Elect Sign: For each parameter, use majority sign across models (resolve conflicts). 3. Merge: Average the remaining aligned parameters.

DARE (Yu et al., 2023)

1. Compute task vectors: $\Delta W_i = W_{fine-tuned,i} - W_{base}$. 2. Randomly drop (set to zero) p% of delta parameters (p=90-99%). 3. Rescale remaining: $\Delta W_i' = \Delta W_i / (1-p)$. 4. Merge rescaled deltas.

Task Arithmetic

$W_{merged} = W_{base} + \lambda_1 \tau_1 + \lambda_2 \tau_2 + ...$

where $\tau_i = W_{fine-tuned,i} - W_{base}$ (task vector)

Practical Tips

Tools: mergekit (most popular), Hugging Face model merger, LM-Cocktail.

Model merging is a uniquely practical innovation from the open-source AI community — by enabling zero-cost combination of specialized capabilities, it has become the dominant technique for creating top-performing open-source models and represents a form of collective intelligence where independent fine-tuning efforts compound.

model mergingmodel soupslerp mergeties mergedare merge

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.