Optimizing Mode Connectivity via Neuron Alignment

N. Joseph Tatro, Pin-Yu Chen, Payel Das, Igor Melnyk, Prasanna Sattigeri, Rongjie Lai

This paper, presented at NeurIPS 2020, explores the "geography" of neural network loss landscapes. It tackles a fascinating phenomenon called mode connectivity—the idea that the local minima found by training neural networks aren't isolated islands, but are actually connected by paths of low loss.

TL;DR

The authors demonstrate that the paths connecting different neural network minima are often blocked by "accuracy barriers" simply because the neurons in the two models are out of order. By using a technique called neuron alignment to permute the weights of one model to match the other, they can find much smoother, higher-accuracy paths, even between models trained to be resistant to adversarial attacks.

What Problem Does This Paper Address?

When you train two neural networks with the same architecture but different random initializations, they end up at different points in the "loss landscape" (the mathematical surface representing the model's error). Researchers have found that you can usually find a curved path between these two points where the error stays low. This is "mode connectivity."

However, neural networks have a massive amount of permutation symmetry. If you swap the positions of two neurons in a hidden layer and adjust the incoming and outgoing weights accordingly, the model’s output remains identical.

Current algorithms for finding paths between models ignore this. They try to connect "Model A" to "Model B" as they are, without realizing that "Model B" might be a scrambled version of "Model A." This "scrambling" creates artificial barriers—high-loss peaks—along the path that don't actually reflect the intrinsic relationship between the two models.

Methods

The authors propose a framework to find the optimal permutation before (or while) finding the connecting path.

  1. Neuron Alignment (The Heuristic): Before searching for a path, they align the neurons of the two models. They do this by passing data through both networks and calculating the cross-correlation of activations at each layer. They then use the Hungarian Algorithm (a classic optimization tool) to find the bipartite matching that maximizes this correlation.
  2. Proximal Alternating Minimization (PAM): For a more rigorous approach, they treat the problem as a joint optimization. They alternate between updating the path parameters (the curve) and updating the weight permutations. To make this stable, they use proximal penalty terms that prevent the parameters from jumping too far in a single step.
  3. Bezier Curves: Like previous work, they parameterize the path between models as a quadratic Bezier curve, where the "control point" is learned to minimize the average loss along the path.

Datasets

The authors evaluated their method across three standard image classification benchmarks:

  • CIFAR-10: 60,000 small color images in 10 classes.
  • CIFAR-100: Similar to CIFAR-10 but with 100 finer-grained classes.
  • Tiny ImageNet: A subset of the massive ImageNet dataset, containing 100,000 images across 200 classes.

They tested these on three architectures: TinyTen (a narrow 10-layer CNN), ResNet32, and GoogLeNet.

Key Insights and Ideas

  • Symmetry is a Barrier: The "loss barriers" often observed between models aren't necessarily fundamental properties of the models themselves, but rather artifacts of how we've indexed the neurons.
  • Activations are the Key: Matching neurons based on their behavior (how they fire in response to data) is a highly effective proxy for finding the mathematically optimal permutation of weights.
  • Bridging the Robustness Gap: One of the most striking findings involves adversarial robustness. Previously, researchers found a "robust loss barrier" between two models trained to resist attacks. This paper shows that this barrier largely disappears once the models are properly aligned.
  • Efficiency: Neuron alignment is "cheap." It only requires a few forward passes of data and a quick execution of the Hungarian algorithm, yet it significantly speeds up the subsequent path-finding process.

Key Results

  • Higher Accuracy Paths: Aligned curves consistently showed higher minimum accuracy along the path compared to unaligned curves. For example, on TinyTen/CIFAR-100, the unaligned path's accuracy dropped to 53.2%, while the aligned path maintained 57.7% (nearly equal to the endpoint models).
  • Faster Convergence: Using the aligned initialization allowed the path-finding algorithm to converge in significantly fewer epochs—sometimes 100 epochs fewer for TinyTen.
  • Local Optimality: The authors used the rigorous PAM method to show that their simple correlation-based heuristic actually finds permutations that are very close to the local optimum.
  • Robustness Discovery: On the path between two robust models, alignment allowed the authors to find new models that were actually more accurate and more robust than the original two endpoints.

Limitations and Future Work

  • Architecture Specifics: While the paper discusses ResNets and GoogLeNet, the alignment of skip connections and complex branching requires careful manual handling to ensure the network structure is preserved.
  • Theoretical Bounds: The theoretical analysis (Theorem 3.1) relies on Lipschitz continuity and specific activation properties (like ReLU). Extending these proofs to more exotic architectures or loss functions remains an open area.
  • Scaling to Massive Models: While GoogLeNet is reasonably large, the computational overhead of calculating full cross-correlation matrices for billion-parameter models (like modern LLMs) might require more efficient approximation methods.

Summary updated

BibTeX
@inproceedings{tatro2020optimizing,
  author = {N. Joseph Tatro and Pin-Yu Chen and Payel Das and Igor Melnyk and Prasanna Sattigeri and Rongjie Lai},
  title = {{Optimizing Mode Connectivity via Neuron Alignment}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=lFZE3PWrFYU},
}
Figure