Model Merging › TIES Merging
Language AI HandbookAll chapters Model Merging › TIES MergingOne section · Sections in this chapter4 / 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
Uniform task arithmetic adds all task vectors together without accounting for conflicts. When two task vectors push the same parameter in opposite directions, the result can be worse than either individual model. TIES merging (Trim, Elect Sign, and Disjoint Merge) introduces three structured steps to handle these conflicts systematically, producing merged models that are more stable and reliable than naive task addition.
The method was introduced by Yadav et al. in their 2023 paper "Resolving Interference When Merging Models." The paper's central insight is that interference between task vectors is the primary cause of performance degradation in multi-task merges, and that this interference can be substantially reduced through a principled three-step process applied before the final combination.
The Interference Problem
To understand why TIES is necessary, consider what happens when you add two task vectors that conflict. Suppose model was fine-tuned to be more formal and model was fine-tuned to be more casual. For some parameter controlling the formality dimension of the model's output, (push toward formal) and (push toward casual). Simple addition gives , a value that may be small in magnitude because the two large signals cancelled. The merged model ends up with a parameter that was pushed hard in opposite directions and lands somewhere that neither task wanted: not formal, not casual, but incoherently in between.
More concretely, consider a single parameter in the pretrained model. After fine-tuning on task , it shifts by , and after fine-tuning on task , by . If and , simple addition gives , a value reduced in magnitude that incorporates conflicting signals. The interference is destructive: you lose the signal from both tasks without gaining a sensible compromise.
TIES addresses this through a structured three-step pipeline applied to the task vectors before combination.
Step 1: Trim
Many parameters in a task vector have very small magnitudes, representing fine-tuning noise rather than meaningful task-specific adaptation. These small values accumulate from gradient descent finding locally optimal adjustments that happen to be numerically nonzero but carry little semantic signal. When you sum multiple task vectors, these small noisy values add up and can overwhelm the large, meaningful signals that encode task-specific behavior.
The trim step removes this noise by keeping only the top- of parameters by absolute magnitude and setting the rest to zero:
where:
- : the trimmed task vector value at position for model
- : the original task vector value at position for model
- : the -th percentile threshold of , the magnitude threshold computed separately for each model
A typical setting keeps the top 20% of values (i.e., ), discarding the bottom 80% as noise. This sparse representation removes clutter before the merge. The intuition is that the parameters with the largest magnitude changes are the ones the optimizer found most useful for the task. The parameters with small magnitude changes were essentially unchanged by fine-tuning and contribute more noise than signal when merged.
The trim step turns each dense task vector into a sparse one: 80% zeros and 20% nonzero values. This sparsity is what allows the next step to reason clearly about conflicts.
Step 2: Elect Sign
After trimming, each parameter position may have nonzero values from multiple task vectors, potentially with opposing signs. For a parameter that two tasks disagree about, you need a principled way to decide which direction to trust. The elect sign step resolves this by choosing a "majority vote" direction for each parameter, weighted by magnitude.
For each parameter position , compute the total positive and negative momentum across all task vectors:
where:
- : total magnitude of positive updates at position across all models
- : total magnitude of negative updates at position across all models
- : indicator function (1 if condition holds, 0 otherwise)
The elected sign for position is:
where ties can be broken arbitrarily, often with a small positive bias. This elected sign vector represents the consensus direction: the direction that the majority of task vectors (weighted by magnitude) want to push each parameter.
The magnitude weighting is important. A single model with a large, confident update in one direction should outweigh several models with small, uncertain updates in the opposing direction. Simply counting votes without weighting by magnitude would give equal voice to a highly confident update and a near-zero noisy one. The weighted vote ensures that the consensus direction reflects where the most important adaptations agree.
Step 3: Disjoint Merge
With elected signs in hand, the final merge discards any task vector contributions that conflict with the consensus:
where:
- : the set of models with nonzero values agreeing with the elected sign at position
- : the number of models in agreement at position
Only task vectors with the consensus sign contribute to the average at each position. Models that disagree are silenced for that parameter. The average is taken only over the agreeing models, not over all models, so disagreeing models do not dilute the signal by contributing zeros to the denominator.
The final merged model is:
This three-step process is more conservative than simple task arithmetic. By filtering small values and resolving sign conflicts before averaging, TIES produces merged models with less destructive interference, particularly when merging three or more models with overlapping parameter sensitivities.
Understanding the Three Steps Together
The three steps address distinct sources of noise in a principled sequence. Trimming removes small, incidental changes that fine-tuning made but that carry little semantic meaning. Sign election identifies the consensus direction for parameters that multiple tasks care about. Disjoint merge combines only the aligned contributions, avoiding the cancellation that would occur if opposing signals were averaged together.
Consider a worked example with three models merging a parameter that controls formality of output. Model A pushes it strongly positive (formal). Model B pushes it moderately positive. Model C pushes it weakly negative. After trimming, suppose model C's small negative value is discarded as noise. Sign election sees two positive votes and zero negative votes: the elected sign is positive. Disjoint merge averages model A's and model B's contributions. The result is a clearly positive adaptation toward formality, which is what two of the three models confidently wanted.