Merging by Matching Models in Task Parameter Subspaces

Derek Tam, Mohit Bansal, Colin Raffel
12/7/2023
cs.LGcs.CL

Official code: r-three/mats (33 stars, last commit 2024-07-08).

Abstract

Model merging aims to cheaply combine individual task-specific models into a single multitask model. In this work, we view past merging methods as leveraging different notions of a ''task parameter subspace'' in which models are matched before being merged. We connect the task parameter subspace of a given model to its loss landscape and formalize how this approach to model merging can be seen as solving a linear system of equations. While past work has generally been limited to linear systems that have a closed-form solution, we consider using the conjugate gradient method to find a solution. We show that using the conjugate gradient method can outperform closed-form solutions, enables merging via linear systems that are otherwise intractable to solve, and flexibly allows choosing from a wide variety of initializations and estimates for the ''task parameter subspace''. We ultimately demonstrate that our merging framework called ''Matching Models in their Task Parameter Subspace'' (MaTS) achieves state-of-the-art results in multitask and intermediate-task model merging. We release all of the code and checkpoints used in our work at https://github.com/r-three/mats.

View on arXivView PDF

Code Implementations(1)

r-three/matsOfficial100%
331Shell, PythonNov 21, 20232 years ago

Similar Papers

Cite this paper

@article{tam2023merging,
  title  = {Merging by Matching Models in Task Parameter Subspaces},
  author = {Derek Tam and Mohit Bansal and Colin Raffel},
  year   = {2023},
  eprint = {2312.04339},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2312.04339v2}
}

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

Discussion