Demystifying Disagreement-on-the-Line in High Dimensions

Donghwan Lee, Behrad Moniri, Xinmeng Huang, Edgar Dobriban, Hamed Hassani · DOI

TL;DR

This paper provides the first rigorous theoretical foundation for the "disagreement-on-the-line" phenomenon, proving that the linear relationship between in-distribution and out-of-distribution model performance is a mathematical necessity in high-dimensional random features regression. The authors show that while this "line" is exact in overparameterized, ridgeless settings, it becomes an approximation when regularization is added, and they identify exactly which types of model randomness make the phenomenon appear.

What Problem Does This Paper Address?

Machine learning models are notoriously fragile when faced with distribution shift—when the data they see at test time (the "target" domain) differs from the data they were trained on (the "source" domain). Estimating how much a model's performance will drop OOD is difficult because, by definition, we usually don't have labels for the new data.

Recently, researchers discovered an empirical "cheat code" called disagreement-on-the-line (DotL). They noticed that if you take two models trained with different random seeds, the amount they disagree on unlabeled OOD data is linearly related to their error on that same data. Even more surprisingly, this OOD disagreement is linearly related to the in-distribution (ID) disagreement. This suggests we can predict OOD error using only unlabeled data.

However, DotL was largely an empirical observation. We didn't know why it happened, when it might fail, or if it was a universal property of all models. This paper seeks to move DotL from an empirical "hunch" to a theoretically grounded principle.

Methods

The authors analyze DotL through the lens of Random Features Regression, a popular theoretical proxy for neural networks. They study the model in the high-dimensional limit, where the number of training samples ($n$), the input dimension ($d$), and the number of features ($N$) all grow to infinity at proportional rates.

Key methodological components include:

  • Defining Disagreement: The authors formalize three types of disagreement based on what the two models share: Independent (different data/weights), Shared-Sample (same data, different weights), and Shared-Weight (different data, same weights).
  • Gaussian Equivalence Conjecture: They leverage the idea that high-dimensional random features behave like Gaussian processes, allowing for precise analytical calculations.
  • Linear Pencils & Free Probability: To solve the complex matrix traces involved in calculating disagreement, they use advanced tools from random matrix theory (specifically operator-valued free probability) to derive closed-form asymptotic expressions.

Datasets

To validate their theory, the authors performed experiments on several standard benchmarks for distribution shift:

  • CIFAR-10-C: The classic image dataset with 15 types of algorithmically generated corruptions (e.g., blur, snow, fog) at various severities.
  • Tiny ImageNet-C: A downsized version of ImageNet with similar corruptions.
  • Camelyon17: A real-world medical imaging dataset where the distribution shift occurs across different hospitals (wild-type shift).

Key Insights and Ideas

  • Overparameterization is the "Line" Maker: The exact linear relationship (DotL) is guaranteed in the overparameterized regime ($N > d$) when using ridgeless least squares. In this regime, the model is "wide" enough that the self-consistent equations governing its behavior become independent of the specific level of overparameterization.
  • Not All Randomness is Equal: DotL holds for Independent and Shared-Sample disagreement, but it fails for Shared-Weight disagreement. This means the phenomenon is driven by the randomness in the model's weights, not just the randomness in the training data.
  • The Intercept Correction: Contrary to some prior empirical claims that the "risk line" and "disagreement line" are identical, the authors prove they share the same slope but can have different intercepts.
  • Regularization Softens the Line: Adding ridge regularization ($\gamma > 0$) technically breaks the exact linear relationship, but the authors prove that an approximate linear relation still holds, with the "error" from the line being bounded by the strength of the regularization.

Key Results

  • Theorem 3.1 & 4.1: The authors provide the first exact asymptotic formulas for disagreement and prove the existence of the linear trend in the ridgeless, overparameterized limit.
  • Slope Consistency: They show that the slope of the disagreement line is determined by the non-linearity of the activation function and the covariance structure of the data.
  • Empirical Match: Despite the theory assuming Gaussian inputs and linear data generation, the experimental results on CIFAR-10-C and Camelyon17 (Figure 4) show a striking alignment with the theoretical predictions, suggesting a "universality" where the theory holds even when its strict assumptions are violated.

Limitations and Future Work

  • Linear Generative Model: The theoretical proofs assume a linear relationship between features and labels. While the experiments suggest this generalizes to non-linear deep learning tasks, a formal proof for non-linear data generation remains open.
  • Regression vs. Classification: The paper focuses on squared loss (regression), whereas the original DotL observations were made in classification tasks using 0-1 loss. Extending these high-dimensional proofs to the classification setting is a natural next step.
  • Universality Proofs: While the authors observe that their findings hold on non-Gaussian data, a rigorous mathematical characterization of why this universality occurs in the context of disagreement is still needed.

Summary updated

BibTeX
@inproceedings{lee2023demystifying,
  author = {Donghwan Lee and Behrad Moniri and Xinmeng Huang and Edgar Dobriban and Hamed Hassani},
  title = {{Demystifying Disagreement-on-the-Line in High Dimensions}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=VAa3ncgG1I},
}
Figure