2 regimes
Closed-form merging vs end-to-end distillation
Under Review · Model Merging
From closed-form merging to end-to-end distillation. Both fold task experts into one model by optimizing the same functional objective — so the real question isn't which is better, but when each is worth its cost.
A cheap closed-form merge wins under tight data / compute / memory; end-to-end distillation (E2E-Merge) pays off once resources are ample and the structural gap is large — reaching 94.3% on ViT-L/14, essentially the fine-tuned experts. Not a universal winner — a frontier.
Closed-form merging vs end-to-end distillation
Data crossover: distillation overtakes here
Of the total distillation gain, then it saturates
Block-wise memory frontier: 85.3% → 90.2%
Distillation's edge at the full-budget endpoint (20 tasks)
Data-assisted model consolidation comes in two computational regimes: closed-form merging, which cheaply solves a parameter- or layer-local surrogate, and end-to-end distillation, which spends iterative computation to match expert behavior. We study when each regime is preferable rather than treating one as universally superior.
Both are organized around one task-conditioned functional objective: on inputs from task a, one shared model should reproduce expert a. Our analysis separates the fixed surrogate gap of closed-form regression from the data- and compute-dependent errors of distillation. Locally, RegMean is the exact optimizer of an expert-centered, layer-wise, isotropic surrogate; dropping cross-layer coupling incurs an exact quadratic excess loss. Under smoothness and Polyak–Łojasiewicz conditions, iterative refinement reduces the functional error with compute and admits a break-even budget.
Existing experiments map three slices of the resulting frontier — across data, compute, and memory. The evidence supports a regime view: closed-form merging is preferable under severe constraints and a tight surrogate; end-to-end distillation pays when unlabeled data and offline computation are available and the structural gap is large.
Collect a few statistics and solve once. RegMean / RegMean++ regress per-layer activations in closed form — on the order of a minute after one pass. Negligible optimization error, but a fixed structural gap: it only approximates the objective.
E2E-Merge repeatedly queries the frozen experts and, on their own unlabeled inputs, makes one shared student reproduce each expert's representation. It samples the objective directly — but pays finite-data and optimization error, and real compute.
Model consolidation folds several experts — fine-tuned from a shared checkpoint — into one model, with no joint retraining. Both regimes chase the same thing; they just spend a different budget to get there. So the useful question is the frontier: how much accuracy each buys per unit of data, compute, and memory.
For merged encoder g_θ and experts g_{θₐ}:
Representation matching supervises the full shared representation; logit distillation only controls directions the task heads can see — a separate design axis.
Closed-form wins at 64–128 examples/task; distillation overtakes at 256+.
256 ex: 86.1 (E2E) vs 84.4 (RegMean++)
4k steps recover 83% of the gain (89.2); it saturates by 8k (90.1 → 90.2).
RegMean++ reference: 84.2
Block-wise merge spans 85.3%@3.7GB → 89.8%@5.4GB → 90.2%@~8GB.
even one block beats RegMean++
| Distinct examples / task | 64 | 128 | 256 | 512 | 1024 |
|---|---|---|---|---|---|
| RegMean++ (closed-form) | 83.3 | 83.9 | 84.4 | 84.3 | 84.5 |
| E2E-Merge (distillation) | 81.3 | 83.5 | 86.1 | 87.7 | 88.5 |
The ordering reverses at 256 examples — below it, the cheap merge is simply the better bet.
A counter-example that proves the point: on a Flan-T5 GLUE probe, closed-form RegMean (83.0) beats iterative E2E (81.9) — different functional readouts favor the cheap regime.
The distillation edge grows with expert count — +2.6 → +6.0 from 2 to 8 experts, and +13.7 at 20 — and on weaker backbones.
| Setting | Closed-form ref | E2E-Merge | Δ |
|---|---|---|---|
| ViT-B/32 · 8 tasks | 84.2 (RegMean++) | 89.8 | +5.6 |
| ViT-B/16 · 8 tasks | 87.3 (RegMean++) | 92.0 | +4.7 |
| ViT-L/14 · 8 tasks | 90.9 (RegMean++) | 94.3 | +3.3 |
| ViT-L/14 · 20 tasks | 83.4 (Iso-C) | 92.9 | +9.5 |
At the full budget, the merged model reaches the individual fine-tuned accuracy on ViT-L/14 (94.3 ≈ 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. Distillation 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.
We report cost as a resource vector (data, updates, memory, time) with Pareto dominance — not a fragile accuracy-per-minute scalar. The point is the frontier, not a single winner.
Under review. Coming soon.
Reference implementation and reproduction. Coming soon.
A narrated, animated ~7-minute video tour — the two regimes, the shared objective, and the budget frontier, built for a general audience.
For questions about this project, contact zhiren001@e.ntu.edu.sg.