Model Fusion via Retrofitting

Phoomraphee Luenam, Andreas Spanopoulos, Amit Sant, Sotiris Anagnostidis, Thomas Hofmann, Sidak Pal Singh

TL;DR

This paper introduces "Model Fusion via Retrofitting," a novel neuron-centric approach to combine independently trained neural networks without retraining. It addresses limitations of prior methods by framing fusion as a representation-matching problem, incorporating neuron importance scores to prioritize salient features, and achieving state-of-the-art zero-shot performance, especially in challenging non-IID and sharded data scenarios.

What Problem Does This Paper Address?

Training large neural networks is computationally expensive and data-intensive. Model fusion offers a way to leverage multiple pre-trained models without retraining, but faces challenges due to differences in how models represent data (e.g., permutation invariance, random initialization, and varied training data). Existing methods often struggle with non-IID (non-identically and independently distributed) data, are limited to specific architectures, or require extensive fine-tuning. This paper aims to develop a more robust and generalizable model fusion technique that performs well even when base models are trained on highly diverse or disjoint datasets, and can achieve good results without further training.

Methods

The core innovation is a "neuron-centric" family of fusion algorithms that treats model fusion as a representation-matching problem. Instead of directly averaging weights, the approach aligns intermediate neuron representations.

Key techniques include:

  • Neuron Grouping and Target Representation: Intermediate neurons from parent models are grouped into "target representations." The fused model is then trained to approximate these targets.
  • Neuron Importance Scores: The method incorporates neuron attribution scores (like Conductance or DeepLIFT) to bias the alignment towards more salient features. This helps preserve important information and improves performance, especially in noisy or heterogeneous settings.
  • Two-Stage Algorithm: The fusion process involves two main steps:
  • Grouping/Clustering: Identifying groups of neurons across parent models that represent similar information. This can be done using Hungarian matching (for equal-sized models) or K-means (for general cases).
  • Retrofitting/Approximation: Training the fused model's weights to approximate the importance-weighted centroids of these groups. This is framed as a weighted least squares problem for linear layers or solved via SGD for non-linear layers.
  • Architecture Agnosticism: The method is designed to work with any architecture that can be modularized into a Directed Acyclic Graph (DAG) of levels, and is empirically validated on VGGs, ResNets, and ViTs.

Datasets

The paper uses standard benchmark datasets for evaluation:

  • CIFAR-10
  • CIFAR-100
  • Tiny-ImageNet
  • BloodMNIST

The experiments involve various data partitioning strategies, including:

  • Non-IID Splits: Simulating imbalanced class distributions across models using Dirichlet distributions.
  • Sharded Splits: Creating extreme non-IID scenarios where each model sees a disjoint set of classes.
  • Full Dataset: Standard training scenario where models are trained on the entire dataset.

Key Insights and Ideas

  • Neuron Importance is Crucial for Robust Fusion: Simply averaging neurons or activations is insufficient, especially in non-IID settings. Prioritizing salient features using neuron importance scores significantly improves fusion performance and robustness.
  • Representation Matching is More Effective than Weight Averaging: Framing fusion as aligning intermediate representations, rather than directly averaging weights, allows for better handling of representational divergence.
  • Zero-Shot Fusion is Achievable and Powerful: The proposed method achieves strong zero-shot performance, meaning it can produce a viable fused model without any further training on the fusion dataset. This is a significant advantage over methods that require extensive fine-tuning.
  • Architecture Agnosticism is a Major Step Forward: The ability to fuse models of different architectures (VGG, ViT, ResNet) and modularize them into levels makes the approach broadly applicable.
  • Clustering and Retrofitting Decouple Complexity: Separating the problem into clustering neurons and then retrofitting weights makes the optimization more stable and interpretable.

Key Results

  • State-of-the-Art Zero-Shot Performance: The proposed methods (HF-Gradient and KF-Gradient) consistently outperform existing fusion baselines (OTFusion, Git Re-Basin) in zero-shot settings, particularly on non-IID and sharded data.
  • Significant Gains in Non-IID Scenarios: In extreme sharded splits, the proposed methods achieve accuracies significantly higher than near-random performance seen by OTFusion. For example, on ViT networks with 2-way splits on CIFAR-100, HF-Gradient achieved 54.5% accuracy compared to OTFusion's 2.2%.
  • Competitive Performance with Fine-Tuning: Even without fine-tuning, the proposed methods often match or exceed the performance of baselines that do require fine-tuning. When fine-tuned, they further improve and often close the gap with ensemble performance.
  • Robustness to Different Widths: KF-Linear and KF-Gradient variants can fuse models with different layer widths, outperforming OTFusion in such scenarios.
  • Effective Compression: The framework can be used for model compression by fusing a larger teacher model into a smaller student model, achieving meaningful knowledge transfer even with limited fusion data.

Limitations and Future Work

  • Hyperparameter Sensitivity: Gradient-based variants require careful tuning, although the authors identified a general configuration that works well. Automating this selection is an open direction.
  • Runtime Overhead: The proposed methods are slower than lightweight baselines like OTFusion, though this is offset by eliminating the need for extensive fine-tuning.
  • Future Work:
    • Evaluating the approach on large language models (LLMs).
  • Automating hyperparameter selection and level partitioning.
  • Exploring alternative grouping methods beyond K-means.
  • Developing data-free fusion variants.

Summary updated

BibTeX
@inproceedings{luenam2026model,
  author = {Phoomraphee Luenam and Andreas Spanopoulos and Amit Sant and Sotiris Anagnostidis and Thomas Hofmann and Sidak Pal Singh},
  title = {{Model Fusion via Retrofitting}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=SXOqLX0T6X},
}
Figure