Scaling Linear Mode Connectivity and Merging to Billion-Parameter Pretrained Transformers

Tianyi Li, Zhiqiang ShenNeurIPS 2026

TL;DR

If you naively average the weights of two independently trained neural networks, you usually get gibberish—an obstacle known as a "loss barrier." By carefully mapping out the hidden geometric symmetries of Transformers and letting both models meet in the middle rather than forcing one to conform to the other, the authors show that even billion-parameter vision and language models can be smoothly merged along a simple straight line in weight space.

What Problem Does This Paper Address?

Every pretrained large language or vision model represents a massive investment of compute and data. Naturally, we’d love to combine independently trained models simply by averaging their weights—no expensive retraining or bulky ensembles required. This relies on Linear Mode Connectivity (LMC): the idea that a straight-line path (linear interpolation) between two sets of weights stays inside a low-loss valley.

In practice, naive weight averaging hits a massive "loss barrier" where performance completely collapses. A big culprit is parameter symmetry: two networks might compute the exact same function, yet organize their internal neurons, attention heads, or residual streams in completely different orders and coordinate systems.

While researchers have found ways to untangle simple neuron permutations in small MLPs, scaling this to massive, pretrained Transformers has hit a wall. Transformers have far richer continuous symmetries (thanks to attention circuits, residual streams, and RoPE positional encodings). Furthermore, existing alignment methods are usually asymmetric—keeping Model A frozen while contorting Model B to match it—which creates a rigid optimization landscape that struggles past tens of millions of parameters.

Methods

To connect billion-parameter Transformers, the authors introduce Dual Learned Matching (LMC-DM), combining a comprehensive symmetry dictionary with bidirectional optimization:

  • Mapping the Full Transformer Symmetry Group: First, they convert LayerNorm/RMSNorm layers into parameter-free operators by absorbing scaling and bias terms into adjacent linear layers. This unlocks a rich set of exact, functionality-preserving transformations: global rotations and scaling of the residual stream, attention-head permutations, invertible transformations inside QK and OV attention circuits (including a specialized block-diagonal rotation that respects RoPE), and FFN permutations/GLU rescaling.
  • Stable Continuous Parameterizations: After getting a rough initial alignment via standard data-free Weight Matching (which fixes discrete permutations), the continuous symmetries are refined via gradient descent on the actual task loss of interpolated models. Crucially, the authors parameterize orthogonal matrices using the Cayley transform and invertible matrices using a polar decomposition (Cayley + Cholesky), avoiding the numerical instabilities of unconstrained projections or matrix exponentials.
  • Dual Learned Matching: Instead of forcing Model B into Model A's coordinate system, both checkpoints are given learnable symmetry transformations ($\pi_A(\Theta_A)$ and $\pi_B(\Theta_B)$) and jointly optimized so they can meet in a shared low-loss basin.
Figure 2: Schematic loss-landscape view of single and dual learned matching. Direct interpolation crosses a high-loss barrier. Single learned matching reduces but does not eliminate this barrier by optimizing one checkpoint toward a fixed reference. Dual learned matching jointly optimizes both checkpoints, yielding a lower barrier in a shared low-loss basin.

Datasets

The authors evaluate existing, publicly available, independently trained checkpoints (ViT, Pythia, and OLMo families) rather than introducing new benchmarks:

  • ImageNet-1K: Used to optimize continuous symmetries and evaluate top-1 accuracy and loss barriers for Vision Transformers (ViT-Small, Base, Large).
  • WikiText: Used to optimize symmetries and evaluate loss barriers and perplexity for language models (Pythia and OLMo).

Key Insights and Ideas

  • It takes two to tango in weight space: Giving both models the freedom to rotate and rescale their internal coordinates toward a shared middle ground consistently yields lower loss barriers and faster convergence than one-sided alignment.
  • Fewer degrees of freedom can optimize better: In ablation studies, restricting attention transformations or using Cayley-based parameterizations outperformed unconstrained invertible matrices. Numerical stability and well-behaved gradients matter more here than raw expressivity.
  • Attention circuits carry heavy weight: Removing QK and OV internal circuit symmetries causes the ViT-Base loss barrier to jump from 0.82 to 1.48 (dropping midpoint accuracy by nearly 10 percentage points), proving that simple neuron/head permutations aren't enough for Transformers.
  • Pretrained giants aren't isolated islands: Even independently trained billion-parameter models appear to live in symmetry-related representations that can be linearly connected once coordinate mismatches are resolved.

Key Results

LMC-DM substantially outperforms both naive Weight Matching and prior one-sided Learned Matching across vision and language scales:

Figure 1: Loss barriers and scaling behavior. Left: Interpolation loss barriers for ViT-S under naive weight interpolation, learned matching, and LMC-DM (Ours). Middle: Interpolation loss curves for Pythia models across different parameter scales. Right: Scaling behavior of LMC-DM–merged Pythia models compared to endpoint models as model size increases.
  • Near-Zero Barriers in Medium LLMs: On Pythia-160M, naive interpolation hits a WikiText loss barrier of 6.28, and prior Learned Matching reaches 0.39. LMC-DM drops this to 0.18—essentially barrier-free connectivity.
  • Billion-Parameter Scaling: On Pythia-1B, LMC-DM reduces the loss barrier from 4.60 (raw) and 0.42 (Learned Matching) down to 0.23, and maintains low barriers all the way up to Pythia-6.9B.
  • Strong Vision Merging: Across ViT-Small, Base, and Large, LMC-DM cuts loss barriers roughly in half compared to prior Learned Matching (e.g., from 1.23 down to 0.66 on ViT-Large). Notably, ViT-Large maintains over 69% ImageNet-1K top-1 accuracy across the entire linear interpolation path.

Limitations and Future Work

  • Scale isn't the only factor: While Pythia models stay smoothly connected up to 6.9B parameters, OLMo-7B exhibits a significantly higher loss barrier under the exact same method. This hints that training data, initialization schemes, and optimization dynamics strongly dictate whether two models actually land in connectable basins.
  • Identical architectures required: The current framework aligns checkpoints that share the exact same architecture; discrete permutations are also kept frozen after initial weight matching to save compute at scale.
  • Future directions: The authors point toward extending symmetry-aware dual matching to broader architectures (like Mixture-of-Experts or differing model shapes), applying it to practical multi-model merging and ensembling, and deeper theoretical study of how training dynamics shape weight-space geometry. (Further limitations are deferred by the authors to the appendices, which are not included in the main text.)

Summary updated

Abstract

Linear mode connectivity (LMC) provides a promising foundation for understanding and merging independently trained neural networks, but existing methods typically optimize the interpolation path from only one model endpoint, limiting their scalability and effectiveness for large pretrained transformers. We propose a novel and scalable framework for enabling LMC-based model merging for {\em billion-parameter pretrained Transformers}. Our method applies properly parameterized functionality-preserving weight transformations to align functionally equivalent solutions, and introduces a dual learning procedure in which both models jointly learn their corresponding transformations toward a shared linear interpolation path. This bidirectional optimization substantially reduces interpolation barriers and enables more reliable merging across large-scale architectures. Empirically, we show that our approach achieves near-zero loss barriers on WikiText for language models with medium-sized parameters, representing, to our knowledge, the first demonstration of near-barrier-free linear connectivity at this scale. In the vision domain, ViT-L maintains above 69\% ImageNet top-1 accuracy throughout the interpolation path, while modern billion-parameter LLMs exhibit substantially reduced loss barriers. These results suggest that properly resolving parameter symmetries enables large pretrained transformers to be connected and merged through simple linear paths with substantially improved interpolation performance.
BibTeX
@inproceedings{li2026scaling,
  author = {Tianyi Li and Zhiqiang Shen},
  title = {{Scaling Linear Mode Connectivity and Merging to Billion-Parameter Pretrained Transformers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=AT2vWyunMD},
}
Figure