TIES Model Merging Interference Tests
A reproducible guide to TIES model merging: construct task vectors, trim weak updates, elect conflict signs, aggregate disjoint means, and test every stage.
Averaging fine-tuned checkpoints can cancel the exact parameter updates that made each specialist useful. TIES model merging interference is addressed by trimming small task-vector changes, electing one sign at each parameter, and averaging only updates that agree with the elected direction.
The method becomes dependable when those three operations are separately observable and the merged model is evaluated on every source task plus joint controls. The receipt distinguishes trim elect disjoint merge, task vector sign conflict, model merge density, and TIES merge evaluation.
Trace TIES model merging interference from one exact base
A merge begins with a base parameter vector and several descendants fine-tuned from that same base. For model i, the task vector is delta_i = tuned_i - base. TIES operates on those deltas and later adds the merged update back to the base. If one checkpoint came from a different base revision, vocabulary, tensor layout, adapter composition, or preprocessing lineage, subtraction no longer means “what this task changed.” It becomes a mixture of task learning and unrelated checkpoint drift.
Pin repository commits, model hashes, tokenizer files, parameter names, shapes, dtypes, adapter state, and any tied-weight handling. Load tensors in a deterministic ordered map and reject missing, extra, or reshaped parameters. Decide whether embeddings, normalization terms, task heads, and buffers participate. Some artifacts should be copied from a named source rather than numerically merged, but that choice belongs in the receipt, not in an implicit loader fallback.
Calculate baseline reconstruction before attempting TIES: adding each task vector back to the base should reproduce its source checkpoint within exact or declared conversion tolerance. Run each reconstructed specialist on a small task fixture. This catches quantization, casting, and serialization mistakes early. Model distillation solves a different problem by training behavior into another model; do not call a distillation pipeline a merge or assume its validation transfers. TIES model merging interference can only be measured after task-vector lineage is clean.
Measure interference at parameter resolution
The TIES arXiv paper identifies two broad interference sources: redundant changes whose small magnitudes may add noise, and sign disagreement where task vectors move the same parameter in opposing directions. A whole-model cosine similarity compresses both into one number. Build a richer census by tensor, layer, parameter family, magnitude bucket, and task pair.
For each coordinate, count positive, negative, and zero deltas; sum positive and negative magnitude separately; record the winning margin; and note how many tasks would be excluded by the elected sign. Plot conflict rate against magnitude. A large number of tiny disagreements may be removed by trimming, while a smaller set of high-magnitude conflicts can dominate behavior. Inspect embeddings and output heads separately because scale and tying can make them unlike transformer blocks.
The sign-conflict rose below is conceptual, not a production statistic. In an actual report, petal direction should map to a declared parameter group and length to surviving signed mass. Keep a plain-mean control so reviewers can see whether conflict handling improves anything. Also retain individual specialists and the untouched base. The merged model can look balanced only because every task degraded toward base performance; per-task deltas prevent that false success. This same discipline appears in DPO training drift checks: aggregate objectives need sliced evidence of what moved. TIES model merging interference needs those slices.
- Positive elected sign
- Negative elected sign
- Trimmed update
Trim by magnitude with deterministic ties
Trimming keeps a chosen density of the largest-magnitude entries in each task vector and sets the rest to zero. The hypothesis is that small changes are more likely to be redundant or noisy, leaving a sparse set of salient task updates. Density is therefore a hyperparameter, not a universal constant. Sweep it from aggressive sparsity to no trimming and report both retained coordinates and downstream quality.
Specify whether density is global, per tensor, or per layer. Global top-k can concentrate nearly all surviving updates in large or high-variance tensors. Per-tensor top-k guarantees local representation but may retain unimportant changes in tiny tensors. Deterministic tie-breaking matters when many values share a magnitude because different devices or sorting routines can otherwise produce different masks. Use stable parameter order as the secondary key and store a hash of each mask.
Trimming should never mutate source task vectors. Preserve untrimmed deltas for reconstruction, ablation, and alternative densities. Record zero handling, NaN rejection, casting precision, and whether threshold comparison includes equality. After trimming, calculate survivor counts, signed mass, layer distribution, and overlap among tasks. An unexpectedly empty or dense tensor is a diagnostic. The official TIES code provides the method's original implementation and configuration vocabulary; pin its revision when reproducing results, then test any optimized rewrite against a small exact fixture for TIES model merging interference.
Elect a sign, then take the disjoint mean
After trimming, TIES elects a sign for each parameter from the aggregate surviving updates. A common rule takes the sign of summed task-vector mass. Exact zero needs a policy: return no update, use a stable tie-break, or defer to another declared rule. Silently letting library behavior choose is dangerous because sign(0), negative zero, and empty selections can flow differently through vectorized code.
Disjoint aggregation then keeps values whose sign matches the election and averages those values, excluding losers rather than allowing them to cancel the winner. If positive mass wins for a coordinate with updates [5, -2], the disjoint mean is 5, not the ordinary mean 1.5. If aligned values are [5, 3, 0], define whether zero participates in the denominator; normally it should not dilute the elected update. Apply a global merge scale only after aggregation, then add the result to the exact base.
Operation order is part of the algorithm. Electing before trimming lets weak noisy mass influence direction. Averaging before disjoint selection recreates cancellation. Scaling task vectors individually changes their voting power. The NeurIPS TIES paper should be the semantic reference, while the runnable fixture below makes local choices inspectable. For production tensors, stream chunks to bound memory but preserve global threshold and deterministic ordering rules around TIES model merging interference.
- 1Vectorize
Subtract the shared base checkpoint. Never merge full weights blindly.
- 2Trim
Keep high-magnitude task updates. Record density and tie rules.
- 3Elect
Choose sign from surviving mass. Expose exact-zero conflicts.
- 4Disjoint
Average only sign-aligned values. Scale once before reconstruction.
Runnable artifact: The TIES model merging interference implementation exercises unconflicted averaging, trimming, elected-sign conflict, exact cancellation, scaling, shape and configuration failures, source immutability, and repeatability with eight assertions.
Save this as ties-trim-elect-disjoint.mjs and run node ties-trim-elect-disjoint.mjs. Expected final line: PASS: 8 TIES merge assertions.
import assert from "node:assert/strict";
const trim = (vector, keep) => {
if (!Array.isArray(vector) || vector.some((x) => !Number.isFinite(x))) throw new TypeError("invalid_vector");
const count = Math.max(1, Math.ceil(vector.length * keep));
const selected = new Set(vector.map((value, index) => ({ index, magnitude: Math.abs(value) }))
.sort((a, b) => b.magnitude - a.magnitude || a.index - b.index).slice(0, count).map((item) => item.index));
return vector.map((value, index) => selected.has(index) ? value : 0);
};
export function tiesMerge(vectors, { keep = 0.5, scale = 1 } = {}) {
if (!Array.isArray(vectors) || vectors.length < 2) throw new TypeError("need_multiple_vectors");
const width = vectors[0].length;
if (width === 0 || vectors.some((vector) => vector.length !== width)) throw new RangeError("shape_mismatch");
if (!(keep > 0 && keep <= 1) || !Number.isFinite(scale)) throw new RangeError("invalid_config");
const trimmed = vectors.map((vector) => trim(vector, keep));
const merged = Array.from({ length: width }, (_, column) => {
const values = trimmed.map((vector) => vector[column]);
const mass = values.reduce((sum, value) => sum + value, 0);
const elected = Math.sign(mass);
if (elected === 0) return 0;
const aligned = values.filter((value) => Math.sign(value) === elected);
return scale * aligned.reduce((sum, value) => sum + value, 0) / aligned.length;
});
return Object.freeze(merged);
}
let assertions = 0;
const check = (fn) => { fn(); assertions += 1; };
check(() => assert.deepEqual(tiesMerge([[4, 2], [2, 6]], { keep: 1 }), [3, 4]));
check(() => assert.deepEqual(tiesMerge([[5, 0.1], [3, -0.2]], { keep: 0.5 }), [4, 0]));
check(() => assert.deepEqual(tiesMerge([[5, 1], [-2, 3]], { keep: 1 }), [5, 2]));
check(() => assert.deepEqual(tiesMerge([[2], [-2]], { keep: 1 }), [0]));
check(() => assert.deepEqual(tiesMerge([[2], [4]], { keep: 1, scale: 0.5 }), [1.5]));
check(() => assert.throws(() => tiesMerge([[1, 2], [1]]), /shape_mismatch/));
check(() => assert.throws(() => tiesMerge([[1], [2]], { keep: 0 }), /invalid_config/));
check(() => {
const vectors = Object.freeze([Object.freeze([3, -1, 0.2]), Object.freeze([1, -2, -0.1])]);
assert.deepEqual(tiesMerge(vectors), tiesMerge(vectors));
assert.deepEqual(vectors[0], [3, -1, 0.2]);
});
assert.equal(assertions, 8);
console.log("PASS: 8 TIES merge assertions");
Sweep density and scale as a surface
TIES still leaves at least two influential controls: trim density and merged-update scale. Evaluate them as a two-dimensional surface rather than tuning density, freezing it, and then tuning scale on the same test set. Use a development split or nested procedure, keep the final test untouched, and include a plain mean, task arithmetic, base, and individual specialists as controls. If compute is limited, choose a coarse grid first and refine only stable regions.
Report every source task, a joint or compositional suite, general capabilities, calibration, safety behavior, and resource cost. A merged checkpoint that preserves four benchmark means can still fail one minority class, instruction format, or tool schema. Include prompts that require capabilities from more than one specialist; independent task scores do not prove useful composition. Multi-agent testing with causal traces offers a pattern for attributing failures when the merged model sits inside a larger agent rather than being scored alone.
Use repeated seeds or bootstrap intervals for noisy generation metrics. Separate selection metrics from release metrics, and record the complete surface—even unattractive points. Look for broad plateaus rather than a single sharp winner; a narrow optimum is fragile to checkpoint, precision, or data changes. Compare conflict buckets: low-margin elected coordinates may deserve different density or exclusion rules, but any extension should remain an ablation, not be labeled standard TIES. The goal is to learn where TIES model merging interference remains fundamentally incompatible across source tasks.
Attribute gains with staged ablations
Run four candidates from the same task vectors: plain mean, trim only, trim plus sign election with an ordinary reducer, and complete trim-elect-disjoint aggregation. This ladder asks whether gains come from sparsity, direction choice, or excluding losing signs. Add a random mask matched to trim density so top-magnitude selection has a real control. When possible, include a sign-shuffled control that preserves magnitude distribution but destroys coherent task direction.
Slice results by layer conflict and task pair. If full TIES helps only when one specialist dominates elected mass, the merge may be choosing a winner rather than composing skills. Compare elected-sign margin with parameter sensitivity through small perturbations or structured layer restoration. Restore one source tensor group at a time and observe task deltas. These interventions turn the conflict census into causal evidence rather than decoration.
Efficiency belongs in the ablation too. Measure merge peak memory, elapsed time, checkpoint size, load time, and inference performance. Sparse intermediate vectors do not necessarily produce a sparse final checkpoint or faster serving. If the goal includes deployment savings, evaluate that separately from interference resolution. The ablation ledger makes claims appropriately narrow: TIES improved particular source-task retention at a named density and scale, while serving cost stayed equal—or it did not. That statement makes TIES model merging interference more useful than calling the resulting model universally merged.
| Candidate | What it controls | Decision evidence |
|---|---|---|
| Plain mean | No interference handling | Regression baseline |
| Trim only | Redundant small updates | Density sweep |
| Trim + elect | Adds sign resolution | Conflict buckets |
| Full TIES | Adds disjoint mean | Per-task and joint evals |
Release the merge with a reversible receipt
The receipt should include base and source hashes, parameter inclusion rules, reconstruction checks, trim scope, density, stable tie-break, sign-election rule, zero policy, disjoint reducer, scale, accumulation precision, implementation commit, mask hashes, and output hash. Store the full evaluation table and ablation surface with it. A future team should be able to reproduce the checkpoint without guessing what “TIES 20%” meant.
Canary the merged model alongside the strongest specialist and base for real traffic categories. Track per-capability success, refusal and safety changes, calibration, latency, fallback rate, and user corrections. Canary evaluations for AI releases helps keep the rollout decision tied to sliced evidence. Rollback is a routing change to known checkpoints; do not try to reverse a merge in place by subtracting an incompletely recorded vector.
TIES model merging interference is controlled when source lineage is exact, interference is measured, every trim-elect-disjoint choice is deterministic, and per-task evaluation shows composition rather than averaged damage. The sign-conflict rose, staged ablation, and tiny fixture serve the same purpose at different scales: they make cancellation visible. Once that evidence exists, the merged checkpoint is not a mysterious arithmetic artifact. It is a versioned decision about which task updates survived, which direction won each conflict, and what behavior that compromise retained.