Abstract
Weight-averaged model-merging has emerged as a powerful approach in deep learning, capable of enhancing model performance without fine-tuning or retraining. However, the underlying mechanisms that explain its effectiveness remain largely unexplored. In this paper, we investigate this technique from three novel perspectives to provide deeper insights into how and why weight-averaged model-merging works: (1) we examine the intrinsic patterns captured by the learning of the model weights, through the visualizations of their patterns on several datasets, showing that these weights often encode structured and interpretable patterns; (2) we investigate model ensemble merging strategies based on averaging on weights versus averaging on features, providing detailed analyses across diverse architectures and datasets; and (3) we explore the impact on model-merging prediction stability in terms of changing the parameter magnitude, revealing insights into the way of weight averaging works as regularization by showing the robustness across different parameter scales. Our findings shed light on the "black box" of weight-averaged model-merging, offering valuable insights and practical recommendations that advance the model-merging process.
Introduction
In the quest for superior model performance, researchers often turn to ensembling—running multiple models and averaging their outputs. While effective, ensembling incurs a significant "inference tax," requiring $N$ times the computation for $N$ models. Model merging, specifically weight averaging, offers a compelling "free lunch": it combines the parameters of multiple models into a single set of weights, providing a performance boost with the inference cost of just one model. While methods like "Model Soups" have demonstrated empirical success, the underlying mechanics have remained opaque. This paper pulls back the curtain on why this process works, revealing that model weights act as interpretable templates and that averaging serves as implicit regularization.
Methodology
The study approaches the interpretability of model merging from three distinct angles:
- Template Matching: Visualizing the weights of linear classifiers and deep layers to identify structural patterns.
- Weight vs. Feature Space Analysis: Mathematically comparing averaging in weight space (merging) versus feature space (ensembling), specifically examining the impact of non-linearities like ReLU.
- Magnitude and Variance Analysis: Investigating how weight averaging affects parameter distribution and scale to explain observed robustness.
Interpretability: Weights as Visual Templates
A key insight of this research is that weights are not merely abstract parameters; they encode structured "templates" of the data classes. By reshaping weight vectors back into image dimensions, the authors demonstrate that a model's weights visually resemble the objects they are trained to recognize.
Merging models in this context can be viewed as a "Mixup" operation in the weight space. However, the presence of non-linear activation functions creates a "linearity gap." In deep networks, weight averaging tends to smooth out signals, acting as a regularizer that aids generalization but can occasionally wash out fine-grained details.
Empirical Results and Architecture Stability
The authors conducted a comprehensive evaluation across diverse domains, including general vision (CIFAR, TinyImageNet) and medical imaging (PathMNIST, ChestXRay14), using both CNNs and Vision Transformers (ViTs).
Key Findings:
- Ensembling is the Ceiling: Feature-space ensembling (Logits Ensemble) consistently provides the highest accuracy but requires significantly more computation.
- Greedy vs. Uniform: "Greedy Soups" (selectively merging models that improve validation accuracy) significantly outperform "Uniform Soups," particularly on challenging datasets where uniform averaging can lead to catastrophic performance drops.
- CNNs vs. ViTs: CNNs prove to be more "mergable" due to their hierarchical local patterns. In contrast, ViTs are highly sensitive to weight perturbations, leading to a wider performance gap between ensembling and merging.
- Robustness to Scaling: Weight averaging naturally bounds parameter magnitudes, making merged models significantly more robust to extreme parameter scaling compared to standard ensembles.
Conclusion
This work demystifies weight-averaged model merging by characterizing it as a form of template blending and implicit regularization. While highly effective for CNNs, the fragility of Vision Transformers remains a primary limitation. Future research should focus on aligning internal representations across models before averaging to prevent the loss of critical features, a step vital for both performance and AI safety.
Summary updated