Lune

ICLR2024Top-tier venue

Transformer Fusion with Optimal Transport

Moritz Imfeld, Jacopo Graldi, Marco Giordano, Thomas Hofmann, Sotiris Anagnostidis, Sidak Pal Singh

Abstract

Fusion is a technique for merging multiple independently-trained neural networks in order to combine their capabilities. Past attempts have been restricted to the case of fully-connected, convolutional, and residual networks. This paper presents a systematic approach for fusing two or more transformer-based networks exploiting Optimal Transport to (soft-)align the various architectural components. We flesh out an abstraction for layer alignment, that can generalize to arbitrary architectures - in principle - and we apply this to the key ingredients of Transformers such as multi-head self-attention, layer-normalization, and residual connections, and we discuss how to handle them via various ablation studies. Furthermore, our method allows the fusion of models of different sizes (heterogeneous fusion), providing a new and efficient way to compress Transformers. The proposed approach is evaluated on both image classification tasks via Vision Transformer and natural language modeling tasks using BERT. Our approach consistently outperforms vanilla fusion, and, after a surprisingly short finetuning, also outperforms the individual converged parent models. In our analysis, we uncover intriguing insights about the significant role of soft alignment in the case of Transformers. Our results showcase the potential of fusing multiple Transformers, thus compounding their expertise, in the budding paradigm of model fusion and recombination. Code is available at https://github.com/graldij/transformer-fusion.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

10 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Beyond the Permutation Symmetry of Transformers: The Role of Rotation for Model Fusion cites Federated Learning with Matched Averaging
  • Beyond the Permutation Symmetry of Transformers: The Role of Rotation for Model Fusion cites Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time
  • Beyond the Permutation Symmetry of Transformers: The Role of Rotation for Model Fusion cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Beyond the Permutation Symmetry of Transformers: The Role of Rotation for Model Fusion cites Merging Models with Fisher-Weighted Averaging
  • Transporting Task Vectors across Different Architectures without Training cites Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time
  • Transporting Task Vectors across Different Architectures without Training cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Scaling Vision Transformers cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time cites Scaling Vision Transformers
  • Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time cites Merging Models with Fisher-Weighted Averaging
  • Merging Models with Fisher-Weighted Averaging cites Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time
  • Preference-Aligned LoRA Merging: Preserving Subspace Coverage and Addressing Directional Anisotropy cites Beyond the Permutation Symmetry of Transformers: The Role of Rotation for Model Fusion
  • Preference-Aligned LoRA Merging: Preserving Subspace Coverage and Addressing Directional Anisotropy cites Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time
  • Preference-Aligned LoRA Merging: Preserving Subspace Coverage and Addressing Directional Anisotropy cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Preference-Aligned LoRA Merging: Preserving Subspace Coverage and Addressing Directional Anisotropy cites Merging Models with Fisher-Weighted Averaging
  • Model Fusion through Bayesian Optimization in Language Model Fine-Tuning cites Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time
  • Model Fusion through Bayesian Optimization in Language Model Fine-Tuning cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Merging Models with Fisher-Weighted Averaging cites Federated Learning with Matched Averaging
  • Merging Models with Fisher-Weighted Averaging cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Symphony-MoE: Harmonizing Disparate Pre-trained Models into a Coherent Mixture-of-Experts cites Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. Model Fusion through Bayesian Optimization in Language Model Fine-TuningChaeyun Jang, Hyungi Lee, Jungtaek Kim, Juho LeeNeurIPS 2024 · 8 citations
  2. Transporting Task Vectors across Different Architectures without TrainingFilippo Rinaldi, Aniello Panariello, Giacomo Salici, Angelo Porrello et al.ICML 2026 · 3 citations
  3. Preference-Aligned LoRA Merging: Preserving Subspace Coverage and Addressing Directional AnisotropyWooseong Jeong, Wonyoung Lee, Kuk-Jin YoonCVPR 2026 · 1 citation
  4. Symphony-MoE: Harmonizing Disparate Pre-trained Models into a Coherent Mixture-of-ExpertsQi Wang, Hanyang Peng, Yue YuAAAI 2026 · 1 citation
  5. Beyond the Permutation Symmetry of Transformers: The Role of Rotation for Model FusionBinchi Zhang, Zaiyi Zheng, Zhengzhang Chen, Jundong LiICML 2025

Builds on13

  1. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  2. Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference timeMitchell Wortsman, Gabriel Ilharco, Samir Yitzhak Gadre, Rebecca Roelofs et al.ICML 2022 · 1,464 citations
  3. Federated Learning with Matched AveragingHongyi Wang, Mikhail Yurochkin, Yuekai Sun, Dimitris S. Papailiopoulos et al.ICLR 2020 · 1,368 citations
  4. Scaling Vision TransformersXiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, Lucas BeyerCVPR 2022 · 767 citations
  5. Merging Models with Fisher-Weighted AveragingMichael Matena, Colin RaffelNeurIPS 2022 · 741 citations

Related papers

  1. Model Fusion via Optimal TransportSidak Pal Singh, Martin JaggiNeurIPS 2020 · 330 citations
  2. Representational Alignment Across Model Layers and Brain Regions with Multi-Level Optimal TransportShaan Shah, Meenakshi KhoslaICLR 2026 · 4 citations
  3. LS-Merge: Merging Language Models in Latent SpaceBedionita Soro, Aoxuan Silvia Zhang, Bruno Andreis, Jaehyeong Jo et al.ICLR 2026
  4. Multimodal Token Fusion for Vision TransformersYikai Wang, Xinghao Chen, Lele Cao, Wenbing Huang et al.CVPR 2022 · 214 citations
  5. TaskFusion: An Efficient Transfer Learning Architecture with Dual Delta Sparsity for Multi-Task Natural Language ProcessingZichen Fan, Qirui Zhang, Pierre Abillama, Sara Shoouri et al.ISCA 2023 · 15 citations
Dusk over the sea between two cliffs drawn in fine vertical lines