Wolf2Pack: The AutoFusion Framework for Dynamic Parameter Fusion

Bowen Tian, Songning Lai, Yutao Yue · DOI

Abstract

The AutoFusion framework addresses the challenge of merging specialized neural networks into a single multi-task model without requiring shared pre-trained weights or labeled data. By leveraging a differentiable Sinkhorn operator to learn parameter permutations, AutoFusion overcomes the "permutation invariance" problem that typically leads to parameter interference in traditional weight averaging. Experimental results on computer vision benchmarks show that AutoFusion significantly outperforms existing methods like ZipIt and Git Re-Basin in retaining the capabilities of parent models.

Introduction

In the current deep learning landscape, models are often highly specialized for specific tasks—such as digit recognition or clothing classification. However, these models remain fragmented. Creating a multi-task model usually requires expensive retraining from scratch on combined datasets.

A major obstacle to simple model fusion is that neural networks are permutation invariant: two models trained on the same task may have identical performance but vastly different parameter arrangements because neurons are ordered differently. Simply averaging their weights leads to "parameter interference," resulting in a model that fails both tasks. While methods like Git Re-Basin attempt to align neurons using greedy algorithms, they often struggle when models are trained on entirely distinct tasks.

The AutoFusion Framework

AutoFusion treats model fusion as an end-to-end optimization problem. Unlike manual or greedy alignment rules, it learns the optimal permutation for all layers simultaneously in a data-driven manner.

The AutoFusion end-to-end framework, illustrating the use of Sinkhorn operators and dual-loss optimization to merge specialized models.

The framework consists of three core components:

  1. Differentiable Permutations via Sinkhorn Operator: To make permutations "trainable" via gradient descent, AutoFusion employs the Sinkhorn operator. This provides a continuous, differentiable approximation of a discrete permutation matrix, allowing the system to learn the best reordering of neurons to match one model to another.
  2. Dual-Loss Optimization: The framework optimizes two objectives simultaneously:
  3. Alignment Loss ($\mathcal{L}_{align}$): Encourages the parameters of the two models to be as similar as possible at each layer.
  4. Retention Loss ($\mathcal{L}_{retain}$): This ensures the fused model preserves specialized knowledge. The framework passes unlabeled data through the parent models to generate pseudo-labels, then ensures the fused model can predict these accurately.
  5. End-to-End Learning: By identifying "faithful" outputs from the original models, AutoFusion guides the permutation training across all layers at once, rather than relying on layer-by-layer heuristics.

Experimental Evaluation

The authors evaluated AutoFusion across several computer vision benchmarks, including split-MNIST, split-CIFAR-10, and cross-distribution tasks (merging models trained on MNIST, Fashion-MNIST, and KMNIST).

Conceptual comparison of traditional fusion versus AutoFusion. Traditional methods result in misaligned "parameter interference," while AutoFusion aligns features to successfully solve multi-task objectives.

Key Results

AutoFusion demonstrates a clear lead over established baselines like Weight Interpolation and ZipIt:

  • MNIST MLP: AutoFusion achieved a Joint Accuracy of 85.85%, compared to ZipIt’s 51.25% and Git Re-Basin’s 50.08%.
  • CNN Performance: On VGG-style architectures, AutoFusion reached 65.23% joint accuracy, a 13.23% improvement over the previous state-of-the-art.
  • Triple Fusion: In the most challenging test—merging three models trained on MNIST, Fashion-MNIST, and KMNIST—AutoFusion achieved an average accuracy of 75.97%, roughly 65% higher than simple weight interpolation.

Discussion and Insights

A key insight of the paper is that for multi-tasking, models must align similar features while retaining diverse ones. AutoFusion achieves this by prioritizing alignment in shallower layers, where features are more universal, and using pseudo-labels to protect task-specific knowledge in deeper layers. Activation maps (CAMs) confirm that the fused model successfully "activates" on key features for both tasks, whereas the original specialized models were blind to the other's domain.

Conclusion and Future Work

AutoFusion provides a robust, unsupervised path toward model merging that avoids the pitfalls of manual parameter alignment. While currently validated on MLPs and VGG architectures, future work will explore its scalability to massive models like Transformers and ResNets. Additionally, while the method is unsupervised regarding labels, it still requires a small sample of input data, leaving "data-free" fusion as an ongoing research goal.

Summary updated

BibTeX
@misc{tian2024wolf,
  author = {Bowen Tian and Songning Lai and Yutao Yue},
  title = {{Wolf2Pack: The AutoFusion Framework for Dynamic Parameter Fusion}},
  year = {2024},
  eprint = {2410.05746},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.05746},
}
Figure