Git Re-Basin: Merging Models modulo Permutation Symmetries

Samuel K. Ainsworth, Jonathan Hayase, Siddhartha Srinivasa
9/11/2022
616 citations
cs.LGcs.AI
lora-peft-merging

Official code: samuela/git-re-basin (518 stars, Python, MIT, JAX, last commit 2023-03-07).

Abstract

The success of deep learning is due in large part to our ability to solve certain massive non-convex optimization problems with relative ease. Though non-convex optimization is NP-hard, simple algorithms -- often variants of stochastic gradient descent -- exhibit surprising effectiveness in fitting large neural networks in practice.

Show full abstract

We argue that neural network loss landscapes often contain (nearly) a single basin after accounting for all possible permutation symmetries of hidden units a la Entezari et al. 2021. We introduce three algorithms to permute the units of one model to bring them into alignment with a reference model in order to merge the two models in weight space. This transformation produces a functionally equivalent set of weights that lie in an approximately convex basin near the reference model. Experimentally, we demonstrate the single basin phenomenon across a variety of model architectures and datasets, including the first (to our knowledge) demonstration of zero-barrier linear mode connectivity between independently trained ResNet models on CIFAR-10. Additionally, we identify intriguing phenomena relating model width and training time to mode connectivity. Finally, we discuss shortcomings of the linear mode connectivity hypothesis, including a counterexample to the single basin theory.

View on arXivView PDF

Code Implementations(1)

JAXMIT

Code release for "Git Re-Basin: Merging Models modulo Permutation Symmetries"

51844Python, NixSep 13, 20223 years agoMIT
deep-learningdeeplearningjaxmachine-learningneural-networks

Similar Papers

Cite this paper

@article{ainsworth2022rebasin,
  title  = {Git Re-Basin: Merging Models modulo Permutation Symmetries},
  author = {Samuel K. Ainsworth and Jonathan Hayase and Siddhartha Srinivasa},
  year   = {2022},
  eprint = {2209.04836},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2209.04836}
}

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

Discussion