TIES-Merging: Task Vectors, Interference, TIES and DARE
Read first: Model soups: averaging fine-tuned weights, and why merging works · LoRA: Low-Rank Adaptation of Large Language Models
TL;DR. A task vector is fine-tuned weights minus pre-trained weights. Adding task vectors to the base model adds skills, subtracting one removes a skill, and analogies like A − B + C work too (Ilharco et al., 2212.04089). Adding many of them loses information, though, because small noisy entries dilute important ones and opposite signs cancel. TIES fixes this in three steps: keep only each vector’s top-k% entries by magnitude, elect one sign per parameter, then average only the entries that agree with that sign. DARE (2311.03099) randomly drops 90–99% of a supervised fine-tuning (SFT) delta and multiplies the survivors by 1/(1 − p). This preserves each delta coordinate in expectation, and preserves a linear layer’s output in expectation when its input is held fixed; it is not an exact preservation theorem for a complete nonlinear network. These two ideas sit behind most open-weight LLM merges, including the ties and dare_ties options in MergeKit and PEFT.
Why it matters now. Merging lets you combine separately trained specialists (math, code, chat, domain rerankers) into one model on a CPU. The basic merge arithmetic needs no gradient training. Fixed recipes can use weights alone; selecting checkpoints and hyperparameters normally needs held-out data, and Fisher/RegMean additionally need data-derived statistics. Sparse deltas still produce a dense base-plus-update model, so DARE/TIES are not automatically inference-compression methods. You will see these merges in leaderboard models, in post-training pipelines, and as the baseline that MOPD beats. Knowing what each knob does lets you tell a principled merge from a lucky one.
First read: task-vector notation, the two interference mechanisms, TIES with its six-coordinate example, and DARE with its expectation check (§§1–4). Fisher/RegMean, the refinements, and their cross-method question are optional second-pass material.
Key idea
Section titled “Key idea”Notation. (written on some sibling pages) is the shared pre-trained (or parent) checkpoint, the model fine-tuned on task , and its task vector; DARE’s paper calls this . Parameter coordinates are indexed by . For sparsification, is the drop probability and is the density (keep fraction). is one overall scale on the merged task vector.
1. Task vectors and task arithmetic
Section titled “1. Task vectors and task arithmetic”Intuition first. Fine-tuning moves the weights a small distance from the pre-trained point. Ilharco et al. treat that movement as a vector you can scale, add and subtract, much like word vectors. With chosen on validation data,
Here can be any of three things:
- Addition, , builds a multitask model. With CLIP models, adding a pair of task vectors keeps 98.9% of the two fine-tuned models’ normalised accuracy on average. Adding all eight image tasks reaches 91.2%. (Normalised task accuracy means merged accuracy divided by that task’s separately fine-tuned model accuracy, averaged across tasks; 1.0 is a reference, not a hard upper bound.)
- Negation, , makes the model forget a task. On ViT-L/14 it cuts target-task accuracy from 64.8% to 19.0% while ImageNet (the control task) only moves from 75.5% to 72.9%. For GPT-2 Large, subtracting a “toxic” task vector cuts toxic generations from 4.8% to 0.8%, and WikiText-103 perplexity rises only from 16.4 to 16.9.
- Analogy, , solves a task with no labels: Yelp sentiment ≈ Amazon sentiment + (Yelp LM − Amazon LM). On T5-base this gives 93.0 on Yelp, against 92.3 for training on Amazon only and 93.4 for training on Yelp itself. For that result, the applied update is with two separately searched coefficients, not one equally scaled three-vector expression.
Why does plain addition work at all? Task vectors from different tasks are nearly orthogonal: their cosine similarities are mostly 0.01–0.03, rising to 0.18 for related tasks such as MNIST and SVHN. The paper observes this for CLIP task vectors and hypothesizes that it helps explain their compatibility. Euclidean orthogonality alone does not imply that updates affect independent functions or avoid task interference. IR analogy: task arithmetic resembles CombSUM over weight deltas, an additive combination of complementary signals. Unlike CombSUM, it combines parameter changes inside a nonlinear model, so compatibility is an additional empirical requirement.
λ in practice. The main addition experiments use one global , grid-searched over 0, 0.05, …, 1.0 on held-out validation data. The sentiment analogy is an exception: Table 4 uses one coefficient for the auxiliary sentiment vector and another for the language-modelling vectors, searching each over 0, 0.1, …, 1.0. For negation the paper picks the largest that keeps at least 95% of the control-task accuracy. Values of 0.3–0.5 tend to work when adding vectors, and the TIES paper uses 0.4 when there is no validation set. Tuning is cheap because changing it needs no training.
2. What goes wrong when you add: interference
Section titled “2. What goes wrong when you add: interference”TIES names two failure modes, and the worked example in §3 shows both. Many of its experiments use (IA)³, a parameter-efficient adapter that learns vectors scaling the model’s internal activations; it is not LoRA.
- Redundant parameters. Most entries of a task vector barely matter. Keeping only the top 20% by magnitude of each (IA)³ task vector does not hurt that task (Fig. 3). But when the entries are averaged, one task’s important value is diluted by the near-zero values from tasks that did not need that parameter.
- Sign conflicts. One task pushes a parameter up and another pushes it down, so the average cancels and neither task gets what it needs. Conflicts remain even after trimming, and they grow with the number of models (Fig. 4). Flipping the signs of a task’s top-20% entries is catastrophic, while flipping its bottom 80% barely matters (Fig. 7). For large entries, sign is what counts.
3. TIES: trim, elect, disjoint merge
Section titled “3. TIES: trim, elect, disjoint merge”Write each trimmed task vector as sign × magnitude, , where is element-wise product. For each coordinate , let . This implementation-level definition elects when and otherwise:
In plain words:
- The elected sign belongs to whichever direction has more total mass (the sum of the trimmed values), not more votes.
- The disjoint mean averages only the non-zero values that agree with that sign; if there are none, the merged delta is zero. Zeros never enter the denominator, so a parameter that only one task needs keeps its full value. IR analogy: this is CombANZ (sum divided by the number of non-zero scores) restricted to agreeing runs.
- The positive-tie convention matches PEFT and current MergeKit. The original TIES implementation instead resolves zero signs using the aggregate sign across coordinates (
resolve_zero_signs). - Because the result is a mean, is the natural scale, whereas task arithmetic needs –0.5 on a sum.
The default recipe, used when there is no validation set, is and , chosen by a search over 10, 20, 30 and from 0.8 to 3.0.
What the code does. The paper trims over the whole model at once. Model Breadcrumbs describes TIES’s mask as “overall masking” rather than per layer. Library versions work one tensor at a time. In PEFT’s merge utilities, magnitude_based_pruning keeps int(density * numel) entries of each tensor, density is the fraction kept (), and majority_sign_method is total (TIES’s mass vote) or frequency (a count of signs). Per-model weights are applied after the sign election and before the disjoint mean, which divides by the number of agreeing entries. MergeKit differs: it multiplies deltas by their weights first, elects signs on the weighted deltas, and (when normalizing) divides by the sum of the agreeing models’ weights, so in MergeKit the per-model weights can change the elected sign. Its DARE rescaling is also not the paper’s fixed inverse-keep-probability rule (§4). Both are correct descriptions of their own library; see MergeKit for its semantics.
Worked example: TIES (by hand, checked in Python)
Section titled “Worked example: TIES (by hand, checked in Python)”There are three task vectors over six coordinates , labelled c1–c6. Use density 50% (), so each vector keeps its top 3 entries.
| c1 | c2 | c3 | c4 | c5 | c6 | |
|---|---|---|---|---|---|---|
| τ₁ | 0.4 | −0.1 | 0 | 0.8 | −0.2 | 0.1 |
| τ₂ | 0.3 | 0.5 | −0.1 | −0.6 | 0.05 | 0 |
| τ₃ | −0.1 | 0.6 | 0.2 | −0.3 | 0 | −0.7 |
| Sum Σ τ | 0.6 | 1.0 | 0.1 | −0.1 | −0.15 | −0.6 |
| Task arithmetic, λ = 0.4 | 0.24 | 0.40 | 0.04 | −0.04 | −0.06 | −0.24 |
Step 1: trim. Keep the 3 largest magnitudes in each row: τ₁ keeps c4, c1, c5; τ₂ keeps c4, c2, c1; τ₃ keeps c6, c2, c4.
| c1 | c2 | c3 | c4 | c5 | c6 | |
|---|---|---|---|---|---|---|
| τ̂₁ | 0.4 | 0 | 0 | 0.8 | −0.2 | 0 |
| τ̂₂ | 0.3 | 0.5 | 0 | −0.6 | 0 | 0 |
| τ̂₃ | 0 | 0.6 | 0 | −0.3 | 0 | −0.7 |
| Σ τ̂ (mass) | 0.7 | 1.1 | 0 | −0.1 | −0.2 | −0.7 |
| Elected sign | + | + | + (tie) | − | − | − |
| Agreeing values | 0.4, 0.3 | 0.5, 0.6 | none | −0.6, −0.3 | −0.2 | −0.7 |
| TIES (λ = 1) | 0.35 | 0.55 | 0 | −0.45 | −0.2 | −0.7 |
What to notice:
- Trimming removed most sign conflicts. Before trimming, c1, c2, c3, c4 and c5 all had mixed signs; afterwards only c4 does.
- Redundancy fixed (c5, c6). At c6, task 3’s −0.7 survives intact under TIES. Task arithmetic gives −0.24, and the plain mean gives −0.2.
- Sign conflict (c4). Task arithmetic nearly cancels it to −0.04. TIES elects ”−” because 0.9 of negative mass beats 0.8 of positive mass, and it returns −0.45. The cost: task 1’s strong +0.8 is thrown away completely. TIES picks a winner; it does not compromise.
- Empty set (c3). All trimmed values are zero, so the tie elects ”+” but no entry participates and the merged delta is 0.
4. DARE: drop and rescale
Section titled “4. DARE: drop and rescale”Intuition. If you randomly delete half of a sum’s terms and double the rest, the sum is right on average. This is the inverse-propensity idea from counterfactual learning to rank, applied to weights. DARE applies it to the SFT task vector (the paper’s ):
Why the expectation is preserved. For a linear layer, output is . After DARE, each becomes with probability and 0 otherwise. Therefore
and gives . The expectation is over independent parameter masks for a fixed input . Earlier DARE-modified layers change the inputs to later layers, and activation functions, attention softmaxes and normalization are nonlinear. Consequently, matching this local expectation does not imply that the model’s final expected hidden states, predictions or accuracy are unchanged (§3.1 of the paper calls its own proof rough and checks the rest empirically). The paper calls the outputs “embeddings”; it means hidden states. It also tests DropOnly, which drops without rescaling. Layer-wise cosine similarity to the original hidden states falls to about 0.85 at and 0.68 at on WizardMath-7B, while DARE stays above 0.95 even at .
Why it works for SFT deltas but not continued pretraining. Expectation is only half the story. For a fixed input and independent masks, the output-error variance is
including the bias if it is masked. This variance argument is my reading; the paper’s evidence is empirical. Width can improve relative concentration when contributions are spread out, but increasing width alone does not guarantee small noise: large activations, concentration on a few coordinates, or cancellation in the original sum can make it substantial. SFT deltas are tiny (mostly within 0.002), so small perturbations are more plausible, but their effect also depends on inputs, the drop rate, and the network. The paper finds that larger models tolerate larger : WizardMath-70B still works at , while the 7B and 13B models fail. Its counter-example: WizardCoder-Python-13B measured against Llama-2-13b rather than its real parent CodeLlama-13b-Python. That delta includes about 500B tokens of code pretraining and has entries often above 0.01, against about 0.0002 when measured from the true parent. Dropping only 10% of it takes HumanEval/MBPP from 63.41/55.4 to 0.0/0.0. Dropping 10% of the full fine-tuned weights, rather than the deltas, is equally catastrophic.
As a plug-in. DARE sparsifies each and then hands it to any merge rule: task arithmetic (dare_linear) or TIES (dare_ties). DARE does not resolve sign conflicts by itself. PEFT dare_ties performs random pruning followed by sign election and the disjoint merge, without an additional top-k trim. The paper’s DARE and PEFT’s random pruning rescale by 1/density. Current MergeKit instead restores the masked tensor’s original L1 norm when its rescale option is on, and does not rescale when it is off; that is a different estimator, and the exact expectation argument above should not be attributed to it. DARE’s random drop (with rescale) also beats magnitude pruning (MP) of deltas. DARE §4.5 reports that adding the rescale operation to MP at makes it worse, e.g. 46.70 → 0.37 on GSM8K for 7B models. Do not read this as the score of every magnitude-pruning variant: deterministic magnitude selection does not justify DARE’s inverse-inclusion-probability rescale.
Worked example: DARE (same three task vectors)
Section titled “Worked example: DARE (same three task vectors)”Fixed masks with , so survivors are doubled. Kept coordinates: τ₁ keeps c2, c4, c5; τ₂ keeps c1, c4, c6; τ₃ keeps c2, c3, c6.
| c1 | c2 | c3 | c4 | c5 | c6 | |
|---|---|---|---|---|---|---|
| DARE(τ₁) | 0 | −0.2 | 0 | 1.6 | −0.4 | 0 |
| DARE(τ₂) | 0.6 | 0 | 0 | −1.2 | 0 | 0 |
| DARE(τ₃) | 0 | 1.2 | 0.4 | 0 | 0 | −1.4 |
| DARE + sum | 0.6 | 1.0 | 0.4 | +0.4 | −0.4 | −1.4 |
Check the expectation for τ₁ with input x = (1, 1, 1, 1, 1, 1). The original delta contribution is Σ τ₁ = 1.0. This mask keeps −0.1 + 0.8 − 0.2 = 0.5, so DropOnly gives 0.5 and DARE gives 2 × 0.5 = 1.0. Under independent Bernoulli sampling at , each of the 64 keep/drop patterns has probability 1/64; averaged over them, DARE gives exactly 1.0 and DropOnly 0.5. (This is not the same as sampling only the 20 masks that keep exactly three entries, as the illustrative masks happen to do.) A single mask is noisy, though: keeping c1, c4 and c6 instead would give 2.6. The standard deviation over masks is √(p/(1 − p) · Σ τ₁²) = √0.86 ≈ 0.93. With six weights that noise is large relative to the signal. Also note c4: dropping τ₃’s −0.3 flipped the summed sign to +0.4. DARE does not resolve sign conflicts, which is why dare_ties adds TIES’s election on top.
5. “Weighted” merges: Fisher and RegMean (second pass)
Section titled “5. “Weighted” merges: Fisher and RegMean (second pass)”Fisher uses coordinatewise scalar weights. RegMean uses input Gram matrices and can linearly mix rows as well as reweight them; only diagonal Gram matrices reduce it to independent row weighting.
- Fisher merging (Matena & Raffel, 2111.09832) treats each model as a Gaussian posterior. Its precision (inverse variance) is the diagonal Fisher information , the mean squared gradient of the log-likelihood. The squared gradient is averaged over labels drawn from the model’s own predictive distribution, not necessarily over the training labels. The merge is for each coordinate . A parameter that strongly affects model ‘s outputs pulls the merge towards model ‘s value. With a positive denominator, Fisher merging is uniform for arbitrary input parameter values when the products are equal across models. Equal positive Fisher values alone give the -weighted average; they give a uniform average only when the model-level are equal. IR analogy: inverse-variance-weighted fusion. Cost: one gradient pass over about examples per model.
- RegMean (Jin et al., 2212.09849) asks, for each linear layer, which single best reproduces every model’s outputs on that model’s own inputs. Here has shape and has shape , so layer outputs are and is . Assuming the summed Gram matrix is invertible (otherwise a regularization or pseudoinverse convention is needed), least squares gives . This formula writes a linear layer as , so has input rows; transpose to compare with the pruning page’s convention (one row per output). Only the Gram matrices are shared, not the data. Their off-diagonal entries are multiplied by (0.9 in most runs) because applying the formula directly can produce degenerate models. If all the are equal, the formula collapses to plain averaging.
Both methods need data statistics comparable in size to the model, which is why they appear here as baselines rather than defaults.
6. Refinements: Breadcrumbs, DELLA, Model Stock (second pass)
Section titled “6. Refinements: Breadcrumbs, DELLA, Model Stock (second pass)”Breadcrumbs and DELLA are optional alternatives to the drop rule, not extra required algorithms.
- Model Breadcrumbs (2312.06795) masks both tails of each layer’s distribution: the tiny entries (below percentile β) and the outliers (above percentile γ). The rest is summed with a scale α. For example, β = 90% and γ = 99% keeps the band between those percentiles, about 9% of entries. On all eight vision tasks with ViT-B/32, average normalised accuracy is 83.35 versus 77.66 for task arithmetic: +5.69 normalised-accuracy percentage points, or about +7.33% relative. The paper claims its hyperparameters transfer as more tasks are added.
- DELLA (2406.11617) replaces DARE’s uniform with MagPrune. Within each row, deltas are ranked by magnitude, and larger ones get lower drop probabilities, spread linearly over a window of width ε around the mean drop rate . Each survivor is rescaled by its own , then TIES-style elect and disjoint mean follow. With ε = 0 its drop operator becomes DARE; retaining the elect/disjoint-mean stages gives a DARE-TIES-style merger. Setting to 0 for the top-k entries and 1 for the rest describes deterministic top-k selection (TIES’s trim), not a valid unbiased rescale at : those entries must simply be set to zero. The paper compares drop operators while holding its elect/fuse stages fixed. The authors report it is 2.4 points better on average than DARE and TIES baselines (1.2 over DARE, 3.6 over TIES), but TIES still wins on GSM8K.
- Model Stock (2403.19522) handles same-task fine-tuning noise through geometry and a pretrained anchor; the full explanation is on Model soups. In brief, under an equal-norm/equal-angle approximation with angle between updates measured from , it sets per layer
For two models with , ; (plain average) only when . Its main recipe periodically merges during fine-tuning: Table 2 reports 79.89 ImageNet / 50.99 average shifts at the cost of two fine-tunes, versus 79.76 / 52.08 for the 48-model uniform soup. Its separate post-training experiment (Table 7) applies the merge to finished runs: with two models, 80.3 / 50.4 versus 80.2 / 47.8 for their uniform average.
7. LoRA-specific caveat: merge the products
Section titled “7. LoRA-specific caveat: merge the products”A LoRA update is . Merging rules are defined on , but averaging the factors does not average the products:
Tiny check: and . The sum of products is the identity matrix ; the product of sums is the all-ones matrix. Two more traps make factor-space merging worse. Two adapters can have the same with different factors, since for any invertible . And TIES or DARE masks applied to and do not correspond to masks on . PEFT’s own docstring says its linear combination (on factors) is “a very rough approximation”. Its svd, ties_svd, dare_ties_svd and similar options build each adapter’s , merge in that space and re-factorise with a truncated SVD, while cat concatenates the factors so the sum of products is exact, at the cost of a rank equal to the sum of ranks. If you serve a single merged model, fold the merged into the base weights and avoid re-factorising altogether.
Hyperparameters and how they are tuned
Section titled “Hyperparameters and how they are tuned”| Method | Knobs | Paper defaults / grids | Tuned how |
|---|---|---|---|
| Task arithmetic | λ (one global) | grid 0–1 in steps of 0.05; 0.3–0.5 typical; 0.4 when no validation set | held-out validation; no retraining needed |
| TIES | k (density ρ = k/100), λ | k = 20%, λ = 1; λ grid 0.8–3.0 | small validation set, or the fixed recipe |
| DARE | p (drop rate; density ρ = 1 − p), λ | p up to 0.9–0.99 for SFT; λ in [0.5, 1.0] when merging | sweep p per model size; check delta magnitudes first |
| Breadcrumbs | β, γ (tail percentiles), α | e.g. β = 90%, γ = 99% | claimed to transfer across task counts |
| DELLA | p, ε, λ | λ by search; row-wise ranking | grid on validation |
| Fisher / RegMean | λ_i; examples N / α | RegMean α = 0.9 (0.1 for T5-base) | needs data statistics per model |
| Model Stock | none | t from the angle φ, per layer | computed, not tuned |
What the numbers say
Section titled “What the numbers say”TIES, Table 1 (average accuracy, with a validation set for tuning; NLP = T5, vision = CLIP ViT):
| Method | (IA)³ T0-3B | T5-base | T5-large | ViT-B/32 | ViT-L/14 |
|---|---|---|---|---|---|
| Fine-tuned (one per task) | 71.4 | 82.8 | 88.8 | 90.5 | 94.2 |
| Multitask training | 73.1 | 83.6 | 88.1 | 88.9 | 93.5 |
| Fisher merging | 62.2 | 68.9 | 64.6 | 68.3 | 82.2 |
| RegMean | 58.0 | 71.2 | 73.2 | 71.8 | 83.7 |
| Task arithmetic | 63.9 | 73.2 | 73.3 | 70.1 | 84.5 |
| TIES | 66.4 | 73.9 | 76.9 | 73.6 | 86.0 |
- Out of domain (Table 2, six held-out tasks): TIES scores 35.3 / 40.4 on T5-base / T5-large, against 34.3 / 36.0 for the best baseline (RegMean).
- Scaling with the number of tasks (Fig. 5): with two tasks, TIES and task arithmetic both stay near 1.0 normalised accuracy and averaging loses about 10%. Task arithmetic degrades faster as tasks are added.
- λ sensitivity: across the λ values tried, TIES stays within 68–75% accuracy and task arithmetic ranges 55–75% (App. B.2).
- Signs matter a lot (Table 5, (IA)³): using the sign vector of a real multitask model gives 72.0, against 66.4 for TIES and 73.1 for multitask training. That recovers 5.6 of the 6.7-point gap in this setting; it is evidence for this setting, not proof of a universal bottleneck.
Ablation. The results below are validation-set scores (Table 6), not the test-set scores in Table 1. This is why the full method is 74.5 / 70.7 here but 73.9 / 66.4 in the main test table.
| Variant (Table 6) | T5-base | (IA)³ |
|---|---|---|
| Full TIES | 74.5 | 70.7 |
| Without trim | 73.0 | 70.6 |
| Without elect | 73.1 | 69.6 |
| Without disjoint mean | 72.6 | 67.5 |
| Without scaling (λ = 1 fixed) | 72.0 | 65.5 |
DARE (Llama-2-13B experts: WizardLM = LM, WizardMath = Math, llama-2-13b-code-alpaca = Code):
- Merged versus sources. Task arithmetic + DARE gets 66.26 on GSM8K for LM & Math, against 64.22 for Math alone. However, the same merge without DARE gets 66.34, so here the gain comes from merging, not from DARE.
- TIES + DARE on hard pairs. For LM & Code, plain TIES collapses to 0.0 / 0.0 on HumanEval / MBPP, and adding DARE gives 18.29 / 26.40. For LM & Math, GSM8K goes from 15.77 to 36.16.
- Encoder models (BERT and RoBERTa on GLUE): the average gains from DARE are small: +0.58 for averaging, +0.36 for task arithmetic, +0.37 for Fisher, −0.03 for RegMean and +0.84 for TIES.
Caveats
Section titled “Caveats”- Same parent required. All of these methods assume one shared initialisation and architecture. DARE’s failure on continued-pretraining deltas is the sharpest version of this. TIES lists “merging relies on common initialization” as a limitation.
- Merging still trails multitask training. In all five aggregate settings in TIES Table 1, the TIES merge trails the multitask-trained model. Its oracle-sign experiment closes most of that gap in the separate (IA)³ setting.
- Evidence base. TIES evaluates mostly T5, (IA)³ adapters and CLIP classifiers. DARE’s LLM merges are 13B Llama-2 models with greedy decoding and small grids, with no reported mask-repetition count or mask-seed uncertainty in the main merge table. The main merged-model comparison tables in both papers do not give seed/mask uncertainty. TIES does repeat its sign-flipping experiment over three independent runs (§7.2) and averages over task subsets in its scaling experiment; those repetitions are distinct from uncertainty for the main merge comparison.
- Validation leakage. “Tuned λ” means tuned on validation data from the tasks being merged, so the “no data needed” pitch holds only for the fixed recipes (TIES k = 20, λ = 1; task arithmetic λ = 0.4).
- Learning rate matters. Ilharco et al. find that task vectors degrade faster than individual models as the fine-tuning learning rate grows. Community checkpoints trained with high learning rates merge worse.
- Unshared parameters. Heads with incompatible output meanings must remain separate or be explicitly aligned; compatible shared heads can be merged. Added-token embeddings can also be merged after aligning token identities and choosing how to supply missing rows; resizing alone does not align token meanings.
- Interpretation. TIES’s “majority mass” and DARE’s “SFT unlocks rather than adds” are heuristics backed by measurements, not theorems.
Connections
Section titled “Connections”- Before this: Model soups & weight averaging explains why averaging fine-tunes of one task works (a shared basin). This page focuses on different-task merges, where interference is especially important; the same mechanisms can also arise between runs of one task. Model Stock bridges the two.
- Tooling: MergeKit implements
task_arithmetic,ties,dare_ties,dare_linear,breadcrumbs,dellaandmodel_stockas YAML configs. Itsdensityis the fraction kept (), not a percentage. In current MergeKit,weightsets relative per-model contributions and can affect sign election; normalized TIES divides by the sum of the agreeing model weights, so multiplying every weight by the same positive constant does not apply the paper’s global λ. Use the separatelambdaparameter for global post-merge scaling. PEFT has different weighting semantics: its TIES utilities elect signs before applying weights and divide by the number of agreeing entries. - Practice: Merging in practice covers post-training and retriever merges. Related site pages: Qwen3-Embedding slerps checkpoints, Gemini Embedding and Llama-Embed-Nemotron average runs, and OLMo soups checkpoints. These are same-task merges, closer to soups than to TIES.
- Pruning cousin: LLM pruning prunes the weights. TIES and DARE prune the deltas, which is why they can drop 90%+ with no retraining when pruning weights cannot (DARE §4.7).
- RL: MOPD compares against task-arithmetic merging of RL specialists (0.857 normalised, against MOPD’s 0.937) and merges by on-policy distillation instead. WARM averages reward models from one initialisation, which is the soup regime.
- Adapters: LoRA defines the update whose products you must merge. Knowledge distillation is the data-based alternative when a merge loses too much.
If you want to try it (optional)
Section titled “If you want to try it (optional)”Take two LoRA adapters from one base and use PEFT’s add_weighted_adapter with combination_type="ties_svd", density=0.2 and weights of 1.0. Compare against linear and cat on a small dev set per task. Then sweep density and the weights; no training is needed between runs.
You should now be able to…
Section titled “You should now be able to…”- Compute task arithmetic, TIES and DARE merges of small vectors by hand, and say which entries each method loses.
- Explain why task arithmetic needs λ ≈ 0.3–0.5 but TIES uses λ ≈ 1.
- Derive DARE’s 1/(1 − p) rescale and its fixed-input variance, and explain why it fails when the delta includes continued pretraining.
- State the conditions under which Fisher merging, RegMean or Model Stock reduce to plain averaging.
- Merge LoRA adapters correctly (products, not factors) and choose density and λ with a small validation set.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Derive / compute
For n = 7 models from one base, compare uniform averaging, task arithmetic at λ = 0.4, and TIES at λ = 1. At three coordinates, the complete task-vector entries are: (a) +0.01 in one model and zero in six; (b) +0.01 in all seven; (c) +0.02, −0.01, −0.005 and four zeros. Assume trimming retains all listed nonzero entries. Compute the merged updates and explain how sum-versus-disjoint-mean normalization creates different scaling trade-offs.
What a strong answer covers
- (a) averaging 0.01/7 ≈ 0.0014; task arithmetic 0.4 × 0.01 = 0.004; TIES 0.01 (disjoint mean over the single non-zero value). Averaging and task arithmetic shrink a parameter that only one task needs.
- (b) averaging 0.01; task arithmetic 0.4 × 0.07 = 0.028, which is 2.8× the individual agreed update (whether that is harmful must be measured); TIES 0.01.
- (c) elected sign = sgn(0.02 − 0.015) = +; TIES keeps only +0.02, so 0.02. Task arithmetic gives 0.4 × 0.005 = 0.002, averaging ≈ 0.0007: the sign conflict nearly cancels the value.
- Task arithmetic's λ multiplies a sum, so it is kept small to stop agreed coordinates growing with n, which in turn shrinks task-specific values. TIES takes a mean, so λ ≈ 1 is natural; the paper notes λ = 1 for TIES is similar to 1/#tasks for task arithmetic.
- Appendix B.2: across the λ values tried, TIES stays within 68–75% accuracy while task arithmetic ranges 55–75%, consistent with this scale argument.
- Mechanism
DARE independently keeps each delta coordinate with probability 1 − p and rescales survivors by 1/(1 − p). Derive the expected output and output-error variance for one linear layer at fixed input x, including a masked bias. Explain why that result does not establish unbiased final predictions in a nonlinear network, and connect the variance to the WizardCoder wrong-parent failure and to choosing p.
What a strong answer covers
- Conditioning on fixed x, each kept Δw_ij becomes Δw_ij/(1 − p), so E[ĥ_i] = h_i. Without rescaling (DropOnly) only the delta contribution shrinks by (1 − p); the base contribution does not. It is an inverse-inclusion-probability (Horvitz–Thompson style) estimator.
- The paper measures layer-wise cosine similarity to the original hidden states: DARE stays above 0.95 at p = 0.9, while DropOnly falls to about 0.85 at p = 0.5 and 0.68 at p = 0.9 on WizardMath-7B.
- For independent masks, Var(ĥ_i − h_i) = p/(1 − p) × [Σ_j (Δw_ij x_j)² + (Δb_i)²]. Small parameters or large width alone are not enough; activation magnitudes, concentration on a few coordinates and cancellation in the original sum all matter.
- Nonlinear activations, attention softmax and normalization, and the changed inputs that earlier DARE layers pass to later ones, prevent lifting the local result to exact expectations of final predictions. Hidden-state similarity and retained task accuracy are empirical checks.
- Against Llama-2-13b, WizardCoder's deltas include about 500B tokens of code pretraining and are often above 0.01. Dropping only 10% of them takes HumanEval/MBPP from 63.41/55.4 to 0.0/0.0. Measured against its true parent CodeLlama-13b-Python the deltas are around 0.0002 and DARE works.
- Practical rule: compute deltas against the closest common ancestor, inspect delta magnitudes, and sweep p on validation data (WizardMath-70B tolerated p = 0.99 where the 7B and 13B models did not).
- What if…
Table 6 of the TIES paper removes one component at a time (trim, elect, disjoint mean, scaling) on T5-base and on (IA)³ adapters for T0-3B, and Table 5 swaps the elected sign for the sign of a real multitask model. Table 6 reports validation scores; Table 5 reports the separate (IA)³ oracle-sign experiment. What does each removal cost, which step matters most, and what does the oracle-sign result say about the remaining gap to multitask training?
What a strong answer covers
- T5-base / (IA)³ (validation): full TIES 74.5 / 70.7; without trim 73.0 / 70.6; without elect 73.1 / 69.6; without disjoint mean 72.6 / 67.5; without scaling (λ = 1 fixed) 72.0 / 65.5.
- Scaling and disjoint mean are the largest: −2.5 and −1.9 points on T5-base, −5.2 and −3.2 on (IA)³. Trim matters little for (IA)³ (−0.1), which already has few parameters.
- "Without disjoint mean" averages elected values together with trimmed zeros, i.e. it re-introduces the dilution the method is meant to remove; this explains why its removal hurts.
- Oracle signs give 72.0 versus 66.4 for TIES and 73.1 for multitask training, recovering 5.6 of the 6.7-point gap in this (IA)³ experiment. That shows substantial recoverable information in the signs, but does not prove sign estimation is the only bottleneck for other architectures, tasks or recipes.
- Estimating signs from a few-shot multitask model with 32 examples per task, initialised from the mean, gives 67.7: some, but not most, of the oracle gain.
- Connect
Compare uniform averaging, task arithmetic, Fisher merging, RegMean and Model Stock. For each, explain what determines its coefficients and what extra information it requires. State assumptions under which it becomes a uniform average for arbitrary input weights, rather than merely coinciding with that average on one accidental example. Explain why RegMean can mix rows and why model-level Fisher weights matter.
What a strong answer covers
- Task arithmetic equals a uniform average for λ = 1/n and a common base. Validation data is needed to tune λ, not to apply a fixed λ.
- Fisher requires equal positive λ_i × F_i at coordinate j across models; equal F alone leaves a λ-weighted average. Its statistics use per-example gradients with labels drawn from the model's own predictive distribution.
- With equal Gram matrices and an invertible sum, RegMean is the uniform average. Unequal off-diagonal Gram entries can mix rows, not just weight them independently. Other parameters use ordinary averaging in the paper.
- Under Model Stock's equal-norm/equal-angle approximation, t = N·cosφ / [1 + (N − 1)·cosφ]. For finite N and nondegenerate updates, t = 1 only at cosφ = 1. The approximation and the angle's base-relative origin must be stated.
- TIES and DARE edit coordinate participation; they are not one scalar-weighted average of whole input models.
- Critique
DARE Table 1 reports GSM8K scores of 64.22 for Math alone, 66.34 for the LM+Math task-arithmetic merge without DARE, and 66.26 with DARE. For LM+Code, MBPP is 27.60 for Code alone, 32.40 without DARE and 33.00 with DARE. Separate source-relative gains from DARE's incremental effect, and design a comparison that isolates the pruning contribution rather than checkpoint selection or hyperparameter budget.
What a strong answer covers
- GSM8K: the DARE merge gains 2.04 points (3.18% relative) over Math, but loses 0.08 points versus the same merge method without DARE.
- MBPP: 5.40 points (19.57% relative) over Code, but only 0.60 points over the no-DARE merge.
- DARE matters most with TIES on hard pairs: LM+Code goes from 0.0 / 0.0 to 18.29 / 26.40 on HumanEval / MBPP, and LM+Math from 15.77 to 36.16 on GSM8K, which points at TIES's top-k trim at the tried densities.
- The code expert is weaker than WizardLM on code; comparisons against one named expert need the other ingredient's score too.
- Use matched method, search budget, decoding and evaluation splits; compare no-drop, magnitude selection, DARE and magnitude-aware stochastic selection (e.g. DELLA) across mask seeds and expert sets.
- The main table supplies no mask-seed uncertainty. Include per-capability results and an appropriate multitask-trained reference; do not infer a single-mask count from the omission.
- Design
You have one 7B decoder base and three LoRA adapters (r = 16) fine-tuned from it: a biomedical reranker, a legal reranker and a code-search reranker. You want one served model without retraining. Choose a merging recipe (method, where the merge happens, density and λ), justify it, and describe how you would tune and validate it without access to the original training data.
What a strong answer covers
- Merge per-layer products ΔW_t = (alpha_LoRA/r)·B_t A_t, not A and B separately: the sum of products differs from the product of summed factors by cross terms B_i A_j. In PEFT, linear and ties on factors are rough approximations; svd, ties_svd, dare_ties_svd or cat work on (or exactly preserve) products.
- First compare the single adapters, their plain dense-delta average, and task arithmetic; then try TIES/DARE-TIES at a small development-set-tuned density/scale grid. Densities of 0.2–0.5 and λ near 1 are starting experiments, not established optima for these rerankers.
- A plain sum of three rank-16 updates has rank at most 48, and concatenation can represent it exactly. Elementwise masks and sign selection can destroy that low-rank bound. After a TIES/DARE merge, choose any SVD rank by reconstruction error plus downstream validation, or fold the full merged delta into the base to avoid truncation.
- Tune λ and density on a small labelled dev set per domain (nDCG@10), since λ can be changed with no training; also track a general held-out set (e.g. BEIR-style mix) to detect regressions.
- Baselines: each single adapter on its own domain (specialist reference, not an upper bound), routing to the right adapter per query, and the plain average. Report the per-domain fraction of single-adapter nDCG retained.