REPAIR: REnormalizing Permuted Activations for Interpolation Repair

Keller Jordan, Hanie Sedghi, Olga Saukh, Rahim Entezari, Behnam Neyshabur

Introduction

Linear interpolation between the weights of two neural networks often results in a "middle" model that performs poorly. This phenomenon, termed variance collapse, creates a significant performance barrier. This paper introduces REPAIR, a post-hoc method that rescales activations to restore their original statistics, reducing this barrier by up to 90%.

The Problem: Variance Collapse

A long-standing conjecture in deep learning suggests that the loss landscape might be "flat" between permuted versions of different solutions found by Stochastic Gradient Descent (SGD). Theoretically, one should be able to interpolate between Model A and a permuted Model B without a drop in performance.

In practice, however, deep networks encounter a massive performance barrier. The authors identify variance collapse as the primary cause. As signals propagate through an interpolated network, the variance of activations progressively shrinks. By the final layers, neurons lack the diversity needed to distinguish between inputs.

Variance collapse across layers in different architectures before and after REPAIR.

The root of this collapse lies in the correlation between aligned neurons. Even when "aligned," neurons in different models typically share a correlation of only about 0.4. Averaging variables with such low correlation significantly reduces the variance of the result, an effect that compounds with depth.

Methodology: Interpolation Repair

The proposed solution, REPAIR (REnormalizing Permuted Activations for Interpolation Repair), forces the activations of the interpolated network to match the expected statistics of a "perfect" interpolation.

REPAIR is applied after neuron alignment and offers two implementation paths:

  1. Closed-form approximate: A fast version using a rescaling factor $\beta$ derived from the endpoint networks' statistics.
  2. Forward-pass exact: A robust version that uses a Batch Normalization-like structure. It calibrates internal scaling by passing a small amount of data (~5,000 examples) through the network, setting target statistics as the weighted average of the endpoints.

Experimental Evaluation

The authors evaluated REPAIR across diverse datasets and architectures:

  • Datasets: MNIST, FashionMNIST, SVHN, CIFAR-10, CIFAR-100, and ImageNet.
  • Architectures: MLPs, VGG11, and ResNets (18, 20, 50).

Key Insights

  • Normalization as a Shield: Networks using Layer Normalization (common in Transformers) are inherently more resistant to variance collapse because they renormalize activations during every forward pass.
  • Weight-Space Ensembling: REPAIR enables effective model merging. On CIFAR-100, a REPAIR-interpolated model can outperform its individual parent models, acting as a constructive ensemble.

Key Results

The quantitative impact of REPAIR is substantial:

  • ResNet18 (CIFAR-10): The interpolation barrier was reduced by 90%, dropping the error increase from 16% to 1.5%.
  • ResNet50 (ImageNet): While a standard interpolated model has near-zero accuracy, REPAIR restores it significantly, reducing the barrier by 74% and achieving a midpoint accuracy of 56.5%.
Accuracy recovery for ResNet50 on ImageNet using REPAIR.
  • VGG Networks: REPAIR keeps the interpolation barrier nearly constant regardless of network depth, whereas it typically grows sharply.

Conclusion and Future Work

REPAIR represents a major advancement in model merging by addressing the statistical damage caused by weight averaging. While it drastically reduces performance barriers, it does not eliminate them entirely on complex tasks like ImageNet. The authors suggest that while REPAIR fixes activation statistics, it cannot reconcile fundamentally different features learned by the parent models. Future work combining improved alignment with REPAIR may eventually achieve zero-barrier connectivity for large-scale models.

Summary updated

BibTeX
@inproceedings{jordan2023repair,
  author = {Keller Jordan and Hanie Sedghi and Olga Saukh and Rahim Entezari and Behnam Neyshabur},
  title = {{REPAIR: REnormalizing Permuted Activations for Interpolation Repair}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=gU5sJ6ZggcX},
}
Figure