Abstract
Model merging offers a path toward efficient AI by fusing multiple neural networks into a single compact model. However, traditional methods rely on uniform weight averaging, which often fails to preserve specialized features learned by individual models. We present NP Merge (Non-uniform Parameter-wise Model Merging), a framework that learns unique interpolation coefficients for every parameter via gradient-based optimization. NP Merge significantly outperforms traditional merging and fine-tuning methods, particularly in data-scarce and non-IID environments, effectively closing the gap between merged models and ensembles.
Introduction
In the quest for efficient AI, model merging has emerged as a promising alternative to expensive ensembles. The goal is to fuse multiple models into a single network without the computational overhead of running them in parallel. A significant hurdle in this process is Linear Mode Connectivity (LMC): models trained on different data or with different initializations often reside in disparate regions of the parameter space.
While alignment techniques like neuron permutation can mitigate this, the final fusion step typically involves simple uniform averaging: $W_{merged} = 0.5 W_A + 0.5 W_B$. This approach assumes equal importance for every parameter across models. In practice, one model may have developed superior feature detectors for specific tasks. Uniform averaging tends to wash out these specialized strengths, leading to suboptimal performance.
Methodology: The NP Merge Framework
NP Merge addresses the limitations of uniform averaging by introducing a parameter-wise interpolation tensor, $\alpha_i$.
- Alignment: Models are first aligned using established methods such as Permute or Weight Matching to ensure that corresponding neurons represent similar features.
- Non-Uniform Merging: The merged weights are calculated as an element-wise product: $W_i = \alpha_i \odot W_A + (1 - \alpha_i) \odot W_B$.
- Gradient-Based Optimization: Instead of manual selection, the $\alpha$ values are learned via backpropagation using a small optimization dataset. Crucially, the original weights ($W_A, W_B$) remain frozen; only the interpolation coefficients are updated.
- Sigmoid Constraint: To ensure $\alpha_i \in [0, 1]$, the system optimizes a pre-sigmoid value. This introduces an implicit bias toward the average, requiring strong data evidence to shift a parameter significantly toward one parent model.
- Scalability: The framework scales to multiple models through successive pairwise merges, maintaining stability even with 8 or more models.
Experimental Setup
The researchers evaluated NP Merge on several computer vision benchmarks including CIFAR-10 (VGG11), CIFAR-100 (ResNet20), and ImageNet-200. They specifically focused on "hard" non-IID scenarios where models were trained on disjoint class sets or via Dirichlet distributions to simulate real-world data heterogeneity.
Key Results
NP Merge demonstrates a substantial performance leap over existing baselines. On the CIFAR-100 benchmark with ResNet20, NP Merge achieved 62.88% accuracy. This nearly doubles the performance of standard alignment methods like CCA Merge (~31.79%) and significantly exceeds standard fine-tuning (~39.37%).
The method also effectively "tunnels" through the loss barriers that typically plague standard merging, finding a non-linear path in parameter space that preserves the strengths of both parent models.
Multi-Model Robustness
As the complexity of the merge increases with more models, NP Merge maintains stable performance. In experiments merging up to 8 models, NP Merge remained robust, whereas baseline methods saw significant accuracy degradation as alignment complexity scaled.
Discussion and Insights
The success of NP Merge highlights that granularity is key in model fusion. The optimal merged model is not a single point on a line between two parents, but a high-dimensional configuration where different sub-networks lean toward different ancestors.
Furthermore, NP Merge acts as a powerful regularizer. By restricting the search space to the convex combination of two pre-trained models, it prevents the overfitting and "catastrophic forgetting" often seen in direct weight fine-tuning. This stability is particularly evident in the "small data" regime, where NP Merge outperforms fine-tuning with as few as 5 examples per class.
Limitations and Future Work
While effective, NP Merge introduces computational overhead during the merging process, requiring the storage of an $\alpha$ tensor equal in size to the model weights and several epochs of gradient descent. Future research will explore the relationship between learned $\alpha$ values and Fisher Information to develop more efficient, potentially data-free non-uniform merging techniques.
Summary updated