Disentangling Linear Mode-Connectivity

Gul Sena Altintas, Gregor Bachmann, Lorenzo Noci, Thomas Hofmann

TL;DR

This paper systematically investigates why neural networks exhibit (or fail to exhibit) Linear Mode Connectivity (LMC)—the phenomenon where two models trained from the same initialization are connected by a path of low loss. By isolating architectural components, optimization choices, and dataset complexity, the authors identify a "minimal model" for LMC and demonstrate that weight-sharing and adaptive optimizers like ADAM are primary culprits in breaking connectivity.

What Problem Does This Paper Address?

In the study of neural network loss landscapes, researchers have found that different optima are often connected by regions of low loss. A specific, stronger version of this is Linear Mode Connectivity (LMC): if you take two models ($A$ and $B$) trained from the same starting point but with different random data orderings, the straight line in parameter space between them should also consist of high-performing models.

While LMC is well-documented, we don't fully understand why it happens or what causes it to disappear. For example, why do simple fully-connected networks show LMC while convolutional networks (CNNs) often don't? Is it the convolution itself, the pooling, the optimizer, or the dataset? This paper aims to "disentangle" these confounding factors to find the root causes of LMC disruption.

Methods

The authors adopt a "bottom-up" approach, starting with the simplest possible settings and gradually adding complexity.

  1. The Minimal Model: They identify a 1-hidden layer MLP with ReLU activation trained via SGD as the simplest non-trivial model that robustly exhibits LMC.
  2. Linear Interpolation & Error Barriers: To measure LMC, they calculate the "error barrier"—the maximum increase in error along the linear path between two models.
  3. Normalized Barrier: The authors introduce a new metric (Equation 2 in the paper) that normalizes the error barrier by the models' average test accuracy. This allows for fair comparisons across datasets of varying difficulty (e.g., comparing MNIST to TinyImageNet).
  4. Controlled Interventions: They systematically modify the minimal model by:
  5. Changing the activation function (varying the slope of Leaky ReLU).
  6. Introducing architectural constraints like locality (locally connected layers) and weight-sharing (convolutions).
  7. Switching optimizers (SGD vs. ADAM) and testing the impact of learning rate warmup.

Datasets

The study evaluates models across a spectrum of task complexities:

  • MNIST: Simple handwritten digits.
  • CIFAR-10 & CIFAR-100: Natural images with 10 and 100 classes, respectively.
  • TinyImageNet: A more complex subset of ImageNet with higher resolution and more classes.

Key Insights and Ideas

  • Weight-Sharing is the Disruptor: The authors found that while locality (restricting neurons to look at local patches) preserves LMC, weight-sharing (using the same kernel across the whole image, as in CNNs) significantly breaks it. This suggests that the rigid parameter constraints of convolutions are more detrimental to connectivity than the spatial restriction itself.
  • ADAM vs. SGD: Adaptive optimizers like ADAM tend to amplify error barriers much more than SGD, even in linear networks. However, LMC can often be recovered in ADAM-trained models by adding a learning rate warmup phase, suggesting that connectivity is determined very early in the training process.
  • The Depth-Nonlinearity Trap: As shown in Figure 1, LMC is robust for shallow networks regardless of the activation function's slope. However, as depth increases, the combination of non-linearity (moving from linear to ReLU) and high learning rates causes the error barrier to explode.
Figure 1: Barrier height as a function of Leaky ReLU slope. As the slope approaches 0 (ReLU), deeper networks (8-layer) show much higher barriers compared to shallow ones.
  • Dataset Complexity Matters: Even for the same architecture, increasing the complexity of the dataset (e.g., moving from MNIST to TinyImageNet) makes LMC harder to achieve, leading to higher task barriers.

Key Results

  • Linear Networks: Even without non-linearities, an 8-layer linear network trained with ADAM can have a massive test error barrier of ~73.78%, whereas the same network with SGD stays perfectly connected (barrier of 0.06%).
  • Architecture Comparison: In Figure 2, the authors show that Locally Connected Networks (LCN) remain connected, while CNNs and Vision Transformers (ViTs) experience a significant decay in connectivity.
Figure 2: Error barriers when varying the hidden layer. Note that previous SGD learning rates were too high for the ViT, hence we introduce the Low-Lr of 0.001 where ViTs are also connected
  • Warmup Efficacy: For the minimal MLP model, switching from ADAM without warmup (barrier 2.86%) to ADAM with warmup reduced the test barrier to 0.23%, nearly matching SGD's performance.

Limitations and Future Work

The authors acknowledge that while they have mapped the phenomenology of LMC—identifying what breaks it—a rigorous theoretical explanation for why weight-sharing or ADAM's adaptivity has this effect is still missing.

Additionally, while they touched on Vision Transformers (ViTs), they simplified the architecture significantly (removing skip connections and layer norms). They suggest that future work should investigate the exact architectural correspondence of more complex models to further refine these insights. The paper serves as a roadmap for theorists to build models of loss landscapes that account for these specific empirical triggers.

Summary updated

BibTeX
@misc{altintas2023disentangling,
  author = {Gul Sena Altintas and Gregor Bachmann and Lorenzo Noci and Thomas Hofmann},
  title = {{Disentangling Linear Mode-Connectivity}},
  year = {2023},
  eprint = {2312.09832},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.09832},
}
Figure