Model Merging via Multi-Teacher Knowledge Distillation

Seyed Arshan Dalili, Mehrdad Mahdavi
12/24/2025
cs.LGcs.AI

Official code: arshandalili/SAMerging (1 star, MIT, last commit 2026-03-30).

Abstract

Model merging has emerged as a lightweight alternative to joint multi-task learning (MTL), yet the generalization properties of merged models remain largely unexplored. Establishing such theoretical guarantees is non-trivial, as the merging process typically forbids access to the original training data and involves combining fine-tuned models trained on fundamentally heterogeneous data distributions. Without a principled understanding of these dynamics, current methods often rely on heuristics to approximate the optimal combination of parameters. This dependence is most critical in coefficient scaling, the weighting factors that modulate the magnitude of each fine-tuned model's contribution to the shared parameter. However, without a principled objective to guide their selection, these methods lead to brittle performance and are highly sensitive to scaling initialization. We address this gap by (i) establishing a novel flatness-aware PAC-Bayes generalization bound specifically for the model merging setting. This analysis introduces a "cross-task heterogeneity" term that formally captures the mismatch between diverse fine-tuned model priors and the target multi-task distributions. Guided by this theoretical insight, (ii) we frame model merging as multi-teacher knowledge distillation on scarce, unlabeled data. We formally demonstrate that minimizing the student-teacher Kullback-Leibler divergence directly tightens the upper bound on the merged model's excess risk. Guided by the flatness-aware bound derived, (iii) we operationalize this objective via SAMerging, a method that employs Sharpness-Aware Minimization (SAM) to find flat minima. Empirically, SAMerging establishes a new state of the art across vision and NLP benchmarks, achieving remarkable performance. The code is available at https://github.com/arshandalili/SAMerging.

View on arXivView PDF

Code Implementations(1)

MIT
10Shell, PythonSep 20, 20256 months agoMIT

Similar Papers

Cite this paper

@article{dalili2025model,
  title  = {Model Merging via Multi-Teacher Knowledge Distillation},
  author = {Seyed Arshan Dalili and Mehrdad Mahdavi},
  year   = {2025},
  eprint = {2512.21288},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.21288v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2512.21288.svg)](https://codeofpaper.com/paper/2512.21288)

Discussion