AI State of the Art
SOTA/Après l'ajustement fin : fusion, évaluation, extension/26 min
Section 122

Model Merging: TIES

Listen as a podcast →

The Flaw in Naive Averaging That TIES Fixes

In one sentence: blindly adding up the fine-tuning updates of several models lets noise accumulate and lets two models cancel each other out whenever one wants to raise a weight the other wants to lower; TIES removes the noise first, then makes the models vote on the direction of each weight.

TIES is an acronym the authors built out of their three steps: Trim, Elect Sign & Merge. The full name given in the paper is TrIm, Elect Sign & Merge.

The Crazy Idea: Merging Model Weights

Imagine you want a model that's good at code, good at mathematical reasoning, AND good at conversation. The classic approach: fine-tune a single model on all three tasks at once, expensive, and with a risk of catastrophic forgetting, i.e. losing skills the model had already acquired. The model merging approach:

  1. Fine-tune 3 models separately (each on its specialty)
  2. Merge their weights into a single model
  3. Get a model that combines all three skills

Sounds too good to be true? It works. Not perfectly, but well enough that it has become a common technique in the open-source community.

TIES-Merging: Resolving Interference When Merging Models (Yadav et al., 2023)
Why it works

The central hypothesis: when you fine-tune a model on a task, the weight modifications occupy a relatively narrow subspace of the parameter space, meaning they only move along a small number of directions, not all of them. If two different tasks modify sufficiently independent (perpendicular, or orthogonal) directions, you can superimpose the modifications without them stepping on each other. It's like writing on two different sides of the same sheet of paper.

This is a hypothesis, not a theorem: the paper's own abstract states that existing methods "often ignore the interference between parameters of different models, resulting in large performance drops." What follows is how the damage is limited, not how it is removed.

Task Vectors: The Founding Concept

A task vector is simply the difference between the weights of a fine-tuned model and the base model weights:

τ=θfine_tuned−θbase\tau = \theta_{\text{fine\_tuned}} - \theta_{\text{base}}

Reading the symbols: θ\theta (Greek letter theta) stands for the complete collection of a model's weights, θfine_tuned\theta_{\text{fine\_tuned}} those of the model after fine-tuning, θbase\theta_{\text{base}} those of the starting model, and τ\tau (Greek letter tau) their difference, coefficient by coefficient. In one sentence: subtract the old model from the new one, and what remains is what fine-tuning changed.

A task vector is made of learned weights, not activations

Worth getting right, because the whole page rests on it. A task vector is a difference between two sets of learned parameters, two frozen weight files you can subtract from one another without running the model even once.

It is not an activation: activations are recomputed for every text handed to the model and exist only in memory for the duration of one pass. All of model merging happens offline, on weight files, with no training data and no forward pass. That is precisely what makes it cheap.

This vector captures "everything the fine-tuning learned." It's a compact representation of the acquired skill. Treating that difference as a mathematical object in its own right (task arithmetic) comes from an earlier paper:

Editing Models with Task Arithmetic (Ilharco et al., 2022)
Four-panel diagram showing a task vector as the arrow from pre-trained weights to fine-tuned weights, then three operations: negating the vector, adding two task vectors, and a task analogy combining three vectors.
The task vector is the arrow from the base weights to the fine-tuned weights (panel a). Once you treat it as a vector, you can subtract it to unlearn a behaviour (b), add several of them to get a multi-task model (c), or combine differences to transfer a skill across domains (d). TIES starts from this arithmetic and fixes what breaks when you add the vectors naively.Source : Task Arithmetic paper by Ilharco et al. (figure 1), via Ionio

To combine NN models, the naive approach is to add the task vectors:

θmerged=θbase+∑iλi×τi\theta_{\text{merged}} = \theta_{\text{base}} + \sum_i \lambda_i \times \tau_i

Reading the symbols: θmerged\theta_{\text{merged}} is the final model's weight set, τi\tau_i the task vector of model number ii, λi\lambda_i (lambda) the weight given to that model in the blend, and the symbol ∑\sum (capital sigma) means "add up all the terms that follow, for ii running from the first to the last model." In one sentence: start from the base weights and stack each specialist's correction on top, each one dosed by its coefficient.

On paper, it's elegant. In practice, it works poorly. Performance often collapses compared to individual models.

The Problem: Noise and Sign Conflicts

TIES identifies two fundamental problems in naive merging:

  1. Redundant parameters: the vast majority of weight modifications are tiny, statistical noise that contributes nothing. Adding them amplifies this noise.

  2. Sign conflicts: for the same parameter, one model wants to increase it (+0.3) while another wants to decrease it (-0.2). These opposing forces cancel out and destroy useful information. It's like pulling in opposite directions on the same rope.

Diagram comparing the original values of two models and the merged values, over three parameters drawn as a square (no interference), a circle (redundant update) and a hexagon (sign conflict), with simple mean and TIES side by side.
The two kinds of interference, on three parameters. On the circle, one model's tiny update (dashed arrow) drags the mean down while contributing nothing: that is redundancy. On the hexagon, the two models push in opposite directions and the mean nearly collapses to zero: that is a sign conflict. The green arrows show what TIES recovers once both cases are handled.Source : TIES-Merging paper by Yadav et al. (figure 2)

TIES-Merging: Three Surgical Steps

Diagram of the TIES-Merging pipeline: task vectors from three models go through a Trim step producing trimmed task vectors, then an Elect Sign step producing a sign vector, then a Disjoint Merge step producing the merged task vector.
The full pipeline, read left to right. Each square is a parameter and each coloured arrow is the update one model wants to apply to it: direction gives the sign, length gives the magnitude. Trim (1) drops the short dashed arrows, Elect Sign (2) builds the green sign vector by vote, and Disjoint Merge (3) averages only the arrows pointing the elected way.Source : TIES-Merging paper by Yadav et al. (figure 1)

Step 1: Trim

Eliminate small changes that are just noise. Keep only the top kk % of modifications by absolute size, and reset all the others to zero. The paper settles on k=20k = 20 % after comparing k∈{10,20,30}k \in \{10, 20, 30\} (hyperparameter section of the paper, not the abstract).

Concretely: for each task vector, if the absolute value of a modification is below the threshold, it's set to zero. On a 7-billion-parameter model, keeping 20 % leaves about 1.4 billion modifications standing and zeroes out 5.6 billion. It's like cleaning an image by removing background noise.

Step 2: Elect Sign (Conflict Resolution)

For each parameter, determine the "majority sign" among all models.

If 3 models want to increase a parameter and 1 model wants to decrease it, the 3 win. The minority model is set to zero for that parameter. It's a democratic vote: the majority rules.

Intuition

A parameter increased by 3 models and decreased by 1? It should probably be increased. The paper's abstract names sign disagreement as one of the two major sources of interference, and its conclusion stresses "the importance of resolving sign interference." Majority voting is simple, but it is the step that pays the most.

Step 3: Merge

The cleaned task vectors (trimmed, then sign conflicts resolved) are averaged and added to the base weights:

θmerged=θbase+λ×mean_nonzero(τ~1,τ~2,…,τ~n)\theta_{\text{merged}} = \theta_{\text{base}} + \lambda \times \text{mean\_nonzero}(\tilde{\tau}_1, \tilde{\tau}_2, \ldots, \tilde{\tau}_n)

Reading the symbols: the tilde on τ~i\tilde{\tau}_i marks a task vector already cleaned by steps 1 and 2, λ\lambda is a single global scaling factor (the paper settles on λ=1\lambda = 1), and mean_nonzero\text{mean\_nonzero} averages only the values that survived. In one sentence: stack the average of the surviving corrections onto the starting weights.

Why ignore the zeros? Because a modification kept by only one model out of five would be divided by five if you counted the four zeros in the average. You would shrink it fivefold even though nobody contradicts it. Averaging only the non-zero values avoids that dilution.

Results: What the Paper Actually Measures

The numbers below come from Table 1 of the paper (the columns without a validation set, i.e. without tuning the coefficients on held-out data). Each figure is an average accuracy across all the merged tasks.

Vision, ViT-L/14, 8 image tasks:

MethodAverage accuracy
The 8 specialist models, each on its own task94.2%
Simple weight average79.6%
Task arithmetic (raw addition)83.3%
TIES-Merging86.0%

Language, T5-Large, 7 text tasks:

MethodAverage accuracy
The 7 specialist models, each on its own task88.8%
Simple weight average59.6%
Task arithmetic (raw addition)73.5%
TIES-Merging74.4%

Two readings. First, the simple average is a disaster: 29 points below the specialists on language. Second, TIES recovers most of the gap, but a gap remains, 8 points on vision, 14 on language. Merging is not free: it buys a single all-round model with no extra training, at the cost of a few points on each specialty.

The density parameter (k)

kk is the percentage of modifications kept after trimming. The paper settles on k=20k = 20 %, and tools have adopted that as the default. The trade-off is intuitive: too low and you throw away useful information, too high and noise comes back to contaminate the merge. The authors only explored k∈{10,20,30}k \in \{10, 20, 30\}, beyond that you are in undocumented territory.

Applications: Creating Super-Models

The open-source community has enthusiastically adopted model merging. The typical process:

  1. Take a model strong in reasoning (fine-tuned on math/logic datasets)
  2. A model strong in code (fine-tuned on code)
  3. A model strong in conversation (fine-tuned on chat)
  4. Merge them with TIES
  5. Get a "super-model" that combines all three skills

This has become a common strategy for producing an all-round model with no training budget, and a sizeable share of the models published on sharing platforms are merges rather than models trained from scratch. The exact proportion is not stably measurable: public leaderboards change their rules and their population too often for any single figure to hold.

Merging LoRA Adapters

TIES can also merge LoRA adapters (Low-Rank Adaptation) directly, without touching the full weights.

A reminder of what is being manipulated then, because the distinction matters: in LoRA the base model's large matrices stay frozen, and you only learn two small extra matrices, called AA and BB, whose product is added to the result. AA and BB are genuinely learned parameters, there are just far fewer of them. So merging "LoRAs" means merging those small learned matrices with each other, which is cheaper still than merging whole models. The mechanism is spelled out in LoRA in detail and compared with the alternatives in PEFT: comparing the methods PEFT standing for Parameter-Efficient Fine-Tuning.

MergeKit: The Reference Tool

MergeKit (published by Arcee AI) makes model merging accessible. You describe the merge in a YAML file (YAML Ain't Markup Language, a human-readable configuration format):

merge_method: ties
base_model: mistralai/Mistral-7B-v0.1
parameters:
  density: 0.2
  normalize: true
models:
  - model: model_code
    parameters:
      weight: 1.0
  - model: model_reasoning
    parameters:
      weight: 0.7
  - model: model_chat
    parameters:
      weight: 0.5

The density field is the kk of the trimming step (0.2 = 20 %), and the weight fields are the λi\lambda_i coefficients of the addition formula. Always check these field names against the documentation of the version you are running: merging tools move fast and rename their options.

Limitations to Keep in Mind

No Theoretical Guarantees

Model merging relies on empirical assumptions (the independence of the modified directions) that aren't always verified. Result quality is unpredictable a priori: you always need to evaluate empirically. How to do that is covered in Evaluation after fine-tuning.

Evaluation is essential

Never deploy a merged model without rigorous testing. A merged model can excel on task A but regress severely on task B. Systematically test all the skills that matter.

Same Architecture Required

Merging is only possible between models of the same architecture and generally from the same base model. The reason is mechanical: you subtract weight sets coefficient by coefficient, which only means something if coefficient number 4,217 refers to the same thing in both files. Across two different model families the parameters don't have the same meaning, and the subtraction produces noise.

Impact: Accumulating Skills Without Training

The economic argument is simple, and it can be derived without quoting any dubious figure. Merging two models means reading two weight files, doing some subtractions and averages, and writing a third file. There is no forward pass, no backward pass, no training data, no gradient. The cost is that of a file operation, not that of a training run.

The consequence: with no powerful graphics processing unit (GPU) and no training budget, you can produce an all-round model out of existing ones. It is the only lever in this course that improves a model without consuming any learning compute.


The essentials: TIES-Merging merges models by first trimming the noise, then letting the models vote on the direction of each weight. Three steps: trim (keep the strongest 20 % of modifications), elect the majority sign, average the survivors. It combines the skills of several models into one with no extra training, at the cost of a few points on each specialty.

Check your understanding0 / 5

1. What exactly is a task vector, the object TIES manipulates?

2. Two models being merged pull the same parameter in opposite directions: one wants to raise it by 0.3, the other to lower it by 0.2. What does naive addition do, and what does TIES do?

3. In the final step, TIES averages only the non-zero values instead of dividing by the total number of models. Why?

4. A merged model scores brilliantly on the coding task you cared about. What can you conclude about its other skills?

5. Why can't you merge a model from the Mistral family with a model from another family, even at a comparable size?