TL;DR
Can we merge multiple neural networks trained on separate data shards into a single high-performing model without accessing any original training data? This paper shows that uniform weight averaging (the popular "model soup" method) is simply a single step of gradient descent on a surrogate quadratic loss. By reframing model merging as Amortized Model Ensembling (AME)—a data-free meta-optimization process guided by "pseudogradients"—the authors show that applying multi-epoch updates and adaptive optimizers (like AdamW) significantly outperforms standard model soups, particularly in harsh out-of-distribution scenarios.
What Problem Does This Paper Address?
Suppose you have several neural networks, each fine-tuned on disjoint data slices (e.g., specialized domain experts or clients in federated learning). Deploying all of them as an ensemble requires parallel compute and memory overhead. "Model souping"—linearly averaging their weight vectors—has emerged as a surprisingly effective way to combine models without extra inference latency.
However, existing literature treats model soups mostly as empirical magic or through an approximate Bayesian lens. Crucially, linear averaging struggles when the constituent models diverge significantly or inhabit distinct basins of a non-convex loss landscape. This paper tackles the fundamental question: What does it actually mean to average neural networks, and can we do better than naive linear interpolation without needing any training data?
Methods
The authors observe that minimizing the stochastic quadratic objective: $$f(x) = \frac{1}{2} (\|x - \xi\|^2 - \|\xi\|^2)$$ where $\xi$ is drawn from the distribution of trained model weights $\mathcal{D}$, corresponds exactly to standard linear model averaging when optimized via non-adaptive gradient descent for one epoch with a harmonic step schedule ($\eta_i = 1/i$).
Building on this insight, the paper introduces Amortized Model Ensembling (AME):
- Pseudogradients: Treats distance vectors between models (or between the current ensemble state and an ingredient model, $w - x_i$) as directional gradient signals pointing toward regions that encode training distribution statistics.
- Adaptive Meta-Optimization: Instead of basic gradient descent, AME deploys optimizers like Adam, AdamW, Adagrad, or Adadelta to update the fused model weights across multiple "ensembling epochs."
- Batching, Shuffling, and Pivoting: The algorithm introduces techniques from standard neural net training—such as mini-batching ingredient models, shuffling their order across epochs, and adaptive model pivoting—all operating purely in weight space without touching training or testing data.
Datasets
The authors evaluate AME on:
- GLD-23K: A 203-class subset of the Google Landmarks dataset (v2) adapted to a centralized setting to test instance-level recognition under covariate shift and Gaussian noise corruptions.
- CIFAR-10 (Class-Exclusion Benchmarks): 30 Vision Transformer (ViT-S) models trained under extreme data splits where models were restricted to only 1 to 9 of the 10 classes, generating settings that were 10%, 50%, 60%, 70%, 80%, and 90% out-of-domain (OOD) for any single network.
- CIFAR-100: Evaluated via a creative setup reinterpreting input images as weights of a virtual first layer to test "neural averaging" directly on image data.
- Synthetic 2D Distributions: Heavy-tailed Cauchy and Gaussian distributions to study convergence behavior versus maximum likelihood estimation (MLE).
Key Insights and Ideas
- Model soups are just 1-epoch GD: Recognizing linear averaging as basic gradient descent opens up decades of optimization theory. Turning on adaptivity, running multiple epochs, and adding momentum directly translate into smarter model aggregation.
- Optimizers act as robust statistical estimators: For heavy-tailed distributions (like the Cauchy distribution), sample means fail to converge, causing model soup to destabilize. Adaptive optimizers like Adam perform coordinate-wise step clipping and momentum tracking, functioning as robust online estimators that converge near the true parameter center.
- Implicit training without data: Even though AME never sees a single training sample, the ensembled model consistently scores higher accuracy on the ingredients' original training data than on held-out test data (e.g., 99.99% train vs. 98.88% test). The optimization process in parameter space extracts memorized statistical signals embedded within the weights themselves.
Key Results
Experiments evaluated Vision Transformers (ViT-S) across varying degrees of domain isolation:
- Harsh Out-of-Distribution Merging (CIFAR-10):
- 90% OOD (models trained on only 1 class): The best single model scored 10.00% (random guess on unseen classes). Uniform model soup reached 21.76%, while AdamW-AME achieved 23.22%.
- 70% OOD (models trained on 3 classes): Best single model achieved 29.89%; model soup reached 84.77%; AdamW-AME attained 88.28%.
- 50% OOD (models trained on 5 classes): Best single model scored 49.65%; model soup reached 96.64%; AdamW-AME climbed to 97.09%.
- 10% OOD: Best single model scored 87.99%; model soup reached 98.81%; AdamW-AME hit 98.88%.
- Multi-Epoch & Batching Benefits: On GLD-23K, running 5 to 15 meta-optimization epochs with batching and shuffling significantly boosted accuracy and calibrated model loss compared to single-step linear averaging, while maintaining robustness against adversarial Gaussian noise.
Limitations and Future Work
- Empirical Phase Transitions: The authors observe that test accuracy across AME hyperparameter sweeps branches into discrete performance phases (some calibrated, some unstable), an intriguing phenomenon currently lacking complete theoretical explanation.
- Architectural Scope: Primary deep learning experiments are conducted on Vision Transformers; further validation on large language models (LLMs) or heterogeneous architectures remains open.
- Federated Learning Applications: While the paper sketches theoretical extensions linking AME to federated aggregation (formulating a generalized framework called FedSoup), empirical validation of FedSoup in real-world distributed network environments is left for future work.
Summary updated