Merging Models with Fisher-Weighted Averaging

Michael Matena, Colin Raffel
11/18/2021
790 citations
cs.LG
lora-peft-merging

Official code: mmatena/model_merging (83 stars, Python, last commit 2022-03-17).

Abstract

Averaging the parameters of models that have the same architecture and initialization can provide a means of combining their respective capabilities. In this paper, we take the perspective that this "merging" operation can be seen as choosing parameters that approximately maximize the joint likelihood of the posteriors of the models' parameters.

Show full abstract

Computing a simple average of the models' parameters therefore corresponds to making an isotropic Gaussian approximation to their posteriors. We develop an alternative merging procedure based on the Laplace approximation where we approximate each model's posterior as a Gaussian distribution whose precision matrix corresponds to its Fisher information. We first show that our "Fisher merging" technique provides a performance boost in settings where simple parameter averaging is currently used -- specifically, robust fine-tuning and model ensembling. Then, we compare merging to standard gradient-based transfer learning and demonstrate that merging enables a fundamentally different method for transferring capabilities across models. Specifically, we show that Fisher merging is competitive with gradient-based transfer learning approaches (while being significantly cheaper) in intermediate-task training and domain-adaptive pre-training. We also show that our merging procedure makes it possible to combine models in previously unexplored ways. We release our code to facilitate future research into methods for merging models.

View on arXivView PDF

Code Implementations(1)

838PythonJun 19, 20214 years ago

Similar Papers

Cite this paper

@article{matena2021merging,
  title  = {Merging Models with Fisher-Weighted Averaging},
  author = {Michael Matena and Colin Raffel},
  year   = {2021},
  eprint = {2111.09832},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2111.09832}
}

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/2111.09832.svg)](https://codeofpaper.com/paper/2111.09832)

Discussion