4 points
One spectrum: closed-form → Gauss-Newton → block-wise → end-to-end
Under Review · Model Merging
A budgeted functional view of model consolidation. Closed-form merging and end-to-end refinement are not rival algorithms but approximations to one functional objective, chosen by how faithfully you can afford to preserve expert behavior under a data, compute, and memory budget.
A cheap closed-form merge wins under tight data / compute / memory; end-to-end refinement (E2E-Merge) pays once resources are ample and the closed-form gap is large — up to +9.5 at 20 experts. And a label-free residual read from the merged model predicts the gain in advance, getting 92.9% of refine-or-stop calls right.
One spectrum: closed-form → Gauss-Newton → block-wise → end-to-end
Data crossover: refinement overtakes the closed-form merge here
E2E over RegMean++ at 1024 examples/task (ViT-B/32)
Label-free refine-or-stop decision accuracy (70 subsets)
E2E edge at the full-budget endpoint (ViT-L/14, 20 tasks)
Model consolidation combines task-specific experts into one deployable model. We frame method choice as deciding how faithfully to preserve expert behavior within a resource budget. Inexpensive mergers solve tractable surrogates, while refinement spends data and computation to match expert behavior more directly.
A task-indexed functional objective separates the realized gap left by a low-cost merge from refinement's finite-data and optimization errors. Local quadratic analysis gives exact excess-loss formulas for metric mismatch, restricted updates, and omitted cross-layer coupling, and combining these gaps yields a condition for the budget-dependent transition to higher-fidelity refinement.
Across six data budgets with five paired ViT-B/32 runs each, RegMean++ leads at 32–64 examples per task, whereas representation distillation leads from 128 onward and reaches a 4.20-point advantage at 1024. Across all 70 four-task subsets, a label-free residual predicts how much refinement will help and achieves 92.9% leave-one-task-out decision accuracy at a 2.5-point utility threshold. Gauss–Newton and block-wise refinement supply intermediate compute and memory tradeoffs, and a three-seed Flan-T5 sweep shows a complementary regime in which closed form wins at all four data budgets.
Merging and distillation are not two camps but operating points on one functional-fidelity spectrum. Each rung restores more of the deployed function — target metric, update scope, cross-layer geometry, nonlinear trajectory — at a higher cost in data, compute, and memory.
Collect a few statistics and solve once. RegMean / RegMean++ regress per-layer activations in closed form — a statistics pass plus sequential solves, 26 s at N = 256. Negligible optimization error, but a fixed structural gap: it only approximates the objective.
GN-Merge relinearizes the objective at the current merge and solves a damped Gauss–Newton system matrix-free, restoring current-point cross-layer coupling. Six steps from RegMean++ lift accuracy 84.3 → 86.9 without a full training trajectory.
Train consecutive block groups from the input side while freezing and caching the prefix. Group size is an explicit memory–fidelity dial: on ViT-B/32 it spans 85.3%@3.7 GiB → 89.8%@5.4 GiB, and even one block beats the closed-form reference.
E2E-Merge drops the layer-local surrogate and optimizes the task-indexed representation objective directly — task-arithmetic init, experts frozen, stop-gradient targets, all student weights updated. It samples the objective exactly, but pays finite-data and optimization error.
Every point returns one shared encoder — no learned router, no task-specific module, and the same per-example inference cost. They chase the same functional target; they just spend a different budget to get there. So the useful question is not which merger is best, but which level of functional fidelity is worth its cost.
For merged encoder g_θ and experts g_{θₐ}:
Representation matching supervises the full shared space; logit / KL matching only controls the directions each task's text-prototype head can see — a separate design axis from closed-form-vs-iterative.
Closed-form wins at 32–64 examples/task; refinement overtakes at 128 and widens through 1024.
+0.68 → +2.14 → +3.42 → +4.20 (128→1024)
At N = 256, E2E clears RegMean++ at the first 500-step point (56 s); gains taper after 2k.
84.2 (26 s) → 86.5 (8k, 533 s)
Block-wise spans 85.3%@3.7GiB → 89.8%@5.4GiB → 90.2%@~8GiB (full).
even one block beats RegMean++
| Distinct examples / task | 32 | 64 | 128 | 256 | 512 | 1024 |
|---|---|---|---|---|---|---|
| RegMean++ (closed-form) | 82.5 | 83.5 | 84.0 | 84.4 | 84.3 | 84.5 |
| E2E-Merge (refinement) | 78.7 | 82.3 | 84.6 | 86.4 | 87.7 | 88.6 |
The ordering reverses at 128 examples and holds in every one of the five paired subsets from there on — below it, the cheap merge is simply the better bet.
The regime condition becomes an actionable rule: before spending any end-to-end budget, measure the closed-form model's remaining functional discrepancy. The merged model's own held-out squared residual — no labels, no test data — predicts how much refinement will actually help.
Across the full 70-subset enumeration, Spearman ρ = 0.96, and 0.63 after additive task adjustment.
Leave-one-task-out: 0.265-pt RMSE and 92.9% refine-or-stop decisions, vs 73.9% from initial accuracy and 57.5% from task-vector cosine.
The signal persists on an independent slice, with as few as 16 examples/task, and across nine backbone / task-count settings at ρ = 0.992.
The residual turns the qualitative regime condition into an objective-aligned, label-free triage rule: fit the cheap merge, read its functional residual, and only pay for refinement where the residual says it will pay back.
A counter-example that proves the point: across a three-seed Flan-T5 GLUE sweep, closed-form RegMean wins all 12 paired runs against iterative output distillation (by 0.76–0.94 pt), and both beat task arithmetic (79.0) and TIES (80.2). Different functional readouts favor the cheap regime.
The refinement edge grows with consolidation load — +2.6 → +4.4 → +6.0 from 2 to 6 to 8 experts, and +13.7 at 20 — and is larger on smaller backbones for the same 20 tasks.
| Setting | Closed-form ref | E2E-Merge | Δ | Expert avg. |
|---|---|---|---|---|
| ViT-B/32 · 8 tasks | 84.2 (RegMean++) | 89.9 | +5.7 | 90.4 |
| ViT-B/16 · 8 tasks | 87.3 (RegMean++) | 91.9 | +4.6 | 92.4 |
| ViT-L/14 · 8 tasks | 90.9 (RegMean++) | 94.2 | +3.3 | 94.3 |
| ViT-L/14 · 20 tasks | 83.4 (Iso-C) | 92.9 | +9.5 | — |
At the high-fidelity endpoint, the merged model essentially matches the individual fine-tuned experts on ViT-L/14 (94.2 ≈ 94.3).
A closed-form solver can be near-optimal at every layer and still land far from each expert at the output, because small residuals compound through depth. Refinement controls what actually reaches the output — which is exactly what its extra compute buys, and why the gap widens with more experts and weaker backbones. A matched-target control confirms the mechanism: representation supervision adds 1.6–2.2 points over the strongest logit control, while the restricted-coefficient gradient merger AdaMerging reaches only 82.6%.
Under review. Coming soon.
Reference implementation and reproduction. Coming soon.
A narrated, animated video tour — one objective, the fidelity spectrum, and the budget frontier, built for a general audience.
For questions about this project, contact zhiren001@e.ntu.edu.sg.