Source-linked AI summary
Agreement-on-the-Line: Predicting the Performance of Neural Networks under Distribution Shift
Christina Baek, Yiding Jiang, Aditi Raghunathan, Zico Kolter
TL;DR
Estimating OOD performance without labeled OOD validation data remains difficult, and the reliability of existing methods is often unclear. This paper uses prediction agreement to test for agreement-on-the-line and estimate OOD accuracy from unlabeled data, outperforming competing methods.
Problem
Estimating performance on new distributions is difficult without labeled OOD validation data, and it is often unclear when existing methods work or when their predictions are unreliable.
Source: §1 · pp. 1–2, §3.1 · p. 4Method
The method uses ID and OOD prediction agreement between classifiers to test for agreement-on-the-line, then estimates OOD accuracy from unlabeled OOD data.
Source: §1 · p. 2, §4 · pp. 7–8Results
The method outperforms competing methods, with mean absolute OOD test error ≤2% where agreement-on-the-line holds and continued comparative gains where it does not.
Source: §1 · p. 3Takeaways & Limitations
Agreement-on-the-line provides an unlabeled-data sanity check for whether ID accuracy is a reasonable OOD model-selection criterion, while matching fit slopes and biases appears specific to neural-network classifiers.
Source: §1 · pp. 2–3, §6 · p. 10The setup assumes no labeled OOD validation set, which is often impractical to obtain and prevents direct estimation of OOD accuracy.
Source: §3.1 · p. 4
Abstract
from arXiv · showhide
Recently, Miller et al. showed that a model's in-distribution (ID) accuracy has a strong linear correlation with its out-of-distribution (OOD) accuracy on several OOD benchmarks -- a phenomenon they dubbed ''accuracy-on-the-line''. While a useful tool for model selection (i.e., the model most likely to perform the best OOD is the one with highest ID accuracy), this fact does not help estimate the actual OOD performance of models without access to a labeled OOD validation set. In this paper, we show a similar but surprising phenomenon also holds for the agreement between pairs of neural network classifiers: whenever accuracy-on-the-line holds, we observe that the OOD agreement between the predictions of any two pairs of neural networks (with potentially different architectures) also observes a strong linear correlation with their ID agreement. Furthermore, we observe that the slope and bias of OOD vs ID agreement closely matches that of OOD vs ID accuracy. This phenomenon, which we call agreement-on-the-line, has important practical applications: without any labeled data, we can predict the OOD accuracy of classifiers}, since OOD agreement can be estimated with just unlabeled data. Our prediction algorithm outperforms previous methods both in shifts where agreement-on-the-line holds and, surprisingly, when accuracy is not on the line. This phenomenon also provides new insights into deep neural networks: unlike accuracy-on-the-line, agreement-on-the-line appears to only hold for neural network classifiers.
1 Introduction
Estimating performance under distribution shift matters because labeled OOD data are often costly, while accuracy-on-the-line cannot be checked without them. The paper introduces agreement-on-the-line as an unlabeled-data proxy for the accuracy pattern and uses it to estimate OOD performance.
1 Introduction
- Unlabeled OOD data are easier to obtain than labeled OOD data, but existing prediction methods vary in success and lack a general way to detect unreliable predictions.The paper notes that no method can always work without assumptions.Source: §1 · pp. 1–2
- Agreement-on-the-line tracks accuracy-on-the-line: both hold or fail together, and their fitted slopes and biases are approximately equal.The phenomenon is reported across multiple datasets and neural-network architectures; the matching slopes and biases appear specific to neural-network classifiers.Source: §1 · pp. 2–3
- Because pairwise prediction agreement requires no labels, its linearity can check whether accuracy-on-the-line holds and support OOD accuracy estimation without labeled OOD data.The fitted agreement slope and bias can be estimated without labeled OOD data.Source: §1 · pp. 2–3
- Where agreement-on-the-line holds, the method predicts OOD test error with mean absolute estimation error ≤2%; where it does not, it performs less well but still outperforms competing methods in predicting OOD performance.Source: §1 · p. 3
2 Related Works
Related work includes accuracy-on-the-line observations, agreement-based estimates of ID generalization, and several approaches to predicting OOD performance from unlabeled data. The paper positions its contribution as a way to characterize when prediction can work, focused on neural networks.
2 Related Works
- Prior accuracy-on-the-line work reports linear ID–OOD performance correlations, while theoretical analyses use Gaussian data or assumptions about errors by higher- and lower-accuracy models.Other studies report nonlinear or negative correlations, which this work leaves for future study.Source: §2 · p. 3
- Agreement-based ID generalization methods use disagreement to track error, but one cited approach requires calibrated ensembles and this paper's method targets OOD generalization without requiring calibration or a shared architecture.The passage also cites earlier proposals to predict ID generalization via disagreement.Source: §2 · p. 3
- Prior OOD prediction methods place assumptions on shifts or classifiers, or measure shift empirically using confidence, predictor agreement, or model-reference distances.The cited shift-assumption approaches use label marginals, conditionally independent views, or importance weighting; classifier-assumption approaches use logical constraints or independent errors.Source: §2 · pp. 3–4
- The paper frames its contribution as finding a checkable structure that can reliably predict neural-network OOD accuracy, addressing the limited understanding of when existing methods work.The authors state that no method is expected to work across all shifts without additional assumptions.Source: §2 · p. 4
3 The agreement-on-the-line phenomenon
The paper studies when ID–OOD accuracy and agreement track each other, using agreement between model predictions as an unlabeled-data signal. Across the evaluated shifts, agreement’s linear pattern tracks accuracy’s when the accuracy relationship is strong, and matching slopes and biases are specific to neural networks.
3.1 Notation and setup
- ID–OOD accuracy and agreement are estimated differently: accuracy uses labeled ID validation data, while agreement can be estimated on unlabeled ID and shifted samples.For each model pair, agreement is the proportion of examples on which their predictions match.Source: §3.1 · pp. 4–5
3.2 Experimental setup
- The study evaluates more than 20 common OOD benchmarks and hundreds of independently trained neural networks, with eight dataset shifts reported in the main paper.The models span convolutional networks and Vision Transformers; accuracy and agreement receive the same probit transform.Source: §3.2 · p. 5
3.3 Observations
- Across eight datasets, ID–OOD accuracy and agreement both show strong linear correlations with matching slopes and biases on CIFAR-10.1, CIFAR-10.2, ImageNetV2, CIFAR-10C Fog and Snow, and fMoW-WILDS.On Camelyon17-WILDS and iWildCam-WILDS, where accuracy is not linearly correlated, agreement is also not linearly correlated.Source: §3.3 · p. 5
3.4 What makes agreement-on-the-line interesting?
- Agreement-on-the-line extends across different architectures and checkpoints, but only neural networks show agreement slopes and biases matching the accuracy trend.The paper reports that even pairs of poorly performing models display the matching-trend phenomenon.Source: §3.4 · p. 6, Figure 2 · p. 6
4 A method for estimating OOD accuracy
The method uses ID accuracy and unlabeled OOD agreement to estimate OOD accuracy, or to check whether ID accuracy is a sound basis for model selection. ALine-D solves for model-specific estimates using relationships among pairs of models.
4 A method for estimating OOD accuracy
- The method checks whether ID and OOD agreement are linearly correlated; when they are, agreement-on-the-line implies ID accuracy is suitable for model selection.When that condition holds, selecting the model with the highest ID accuracy is the proposed criterion.Source: §4 · p. 7
- ALine-S estimates OOD accuracy by applying the agreement-line slope and bias to a model’s ID accuracy on the probit scale.The slope and bias are fitted by linear regression on probit-transformed ID and OOD agreements.Source: §4 · p. 7
- ALine-D improves on the plug-in approach by directly using the model’s OOD agreement estimates to construct the system of equations.The pairwise relationship expresses average OOD accuracy using terms estimated from ID validation data and unlabeled OOD data.Source: §4 · pp. 7–8
- ALine-D combines ID accuracies and pairwise ID/OOD agreements to solve for models’ probit-transformed OOD accuracy estimates.It estimates the agreement-line slope by regression, then solves a linear system using sample-estimated quantities; at least three models are required for a unique solution.Source: §4 · p. 8
5 Experiments
Across the evaluated shifts, ALine-D generally outperforms competing OOD accuracy predictors, and it also outperforms ProjNorm in a correlation comparison. Checkpoint agreements from a single training run can likewise support OOD accuracy estimates across epochs.
5 Experiments
- Experiments evaluate ALine-S and ALine-D on six shifts with strong ID/OOD correlation and two shifts without it, against four unlabeled estimation baselines.The baselines are ATC, DOC-Feat, Average Confidence, and naive Agreement; ProjNorm is compared separately because it does not directly estimate OOD accuracy.Source: §5 · p. 8
5.1 Main results: comparison to other methods.
- ATC performs marginally better on ImageNet to ImageNetV2 and CIFAR-10 to CIFAR-10C-Snow, but generally misses models with low OOD accuracy.Figure 3 compares predicted with OOD accuracy and reports ALine-D’s linear fit as closer to the diagonal.Source: §5.1 · p. 8, Figure 3 · p. 9
- ALine-D outperforms other methods on shifts both with and without accuracy-on-the-line.When accuracy-on-the-line does not hold, prediction remains difficult for all methods; ALine-D nevertheless surpasses previous methods.Source: Table 2 · p. 9, §5.1 · p. 9
5.3 Estimating performance along a training trajectory
- ALine-D tracks OOD accuracy across training epochs, with MAE of 2.19% for CIFAR10.1 and 3.61% for ImageNetv2.The experiments use checkpoints from a single ResNet18 training run on CIFAR-10 and a single ResNet50 run on ImageNet; estimates are slightly worse than with independently trained models.Source: Figure 4 · p. 10, §5.3 · p. 10
5.2 Correlation analysis
- ALine-D achieves stronger correlation than ProjNorm across CIFAR-10C corruptions and severity levels for a ResNet18 model.The comparison uses the 29 pretrained models from Miller et al.’s CIFAR-10 testbed; Table 3 compares coefficients of determination and rank correlations.Source: Table 3 · p. 9, §5.2 · p. 10
6 Conclusion
The paper reports agreement-on-the-line across a range of neural networks and OOD benchmarks, while emphasizing that it is not universal. It also proposes predicting OOD accuracy from unlabeled data and identifies the phenomenon's apparent specificity to neural networks.
6 Conclusion
- The authors report agreement-on-the-line across their experiments but explicitly do not claim it is universal.They describe it across an extensive range of neural networks and OOD benchmarks.Source: §6 · p. 10
- The proposed prediction method uses unlabeled new-domain data and outperforms existing state-of-the-art approaches.The approach can be sanity-checked by testing whether agreement-on-the-line holds.Source: §6 · p. 10
- Agreement-on-the-line's matching slope and bias across agreement and accuracy appears specific to neural networks.The authors suggest this may be connected to this class of models, leaving the question for future study.Source: §6 · p. 10
A Baseline Methods
This material describes baseline comparisons, a Gaussian-noise analysis, and expanded correlation experiments across shifts and model groups. The supplied passages identify the experiment scope but give few detailed results beyond the Gaussian-noise comparison.
A Baseline Methods
- The comparison names ALine-S/D, ATC, DOC-Feat, AC, and Agreement as methods evaluated with unlabeled OOD data.The supplied method descriptions are partial.Source: A Baseline Methods · p. 17, Average Threshold Confidence (ATC) · p. 17, DOC-Feat · p. 17
B.1 Matching gaussian noise
- Agreement-on-the-line is stronger for CIFAR-10 covariance-matched Gaussian noise than for isotropic Gaussian noise.The analysis replicates a theoretical experiment and compares ID–OOD agreement under the two noise conditions.Source: §B.1 · p. 18, Figure 5 · p. 18
C Correlation results on more datasets
- The expanded correlation analysis plots ID–OOD accuracy for each model and ID–OOD agreement for randomly paired models, reporting R2 values in figure legends.The described extensions include CIFAR-10C corruptions, CINIC-10, STL-10, RxRx1-WILDS, and Amazon-SQuAD.Source: C Correlation results on more datasets · p. 19
C.1 Over randomly initialized models
- The appendix labels CIFAR-10C corruption results separately for randomly initialized models and ImageNet-pretrained models.The listed corruptions include defocus blur, elastic transform, Gaussian blur and noise, JPEG compression, impulse noise, and speckle noise.Source: §C.1 · p. 20
C.2 Over models pretrained on ImageNet
- The ImageNet-pretrained CIFAR-10C results also list defocus blur, elastic transform, Gaussian blur and noise, JPEG compression, impulse noise, and speckle noise.The supplied excerpts identify these corruption panels but do not report their outcomes.Source: §C.2 · p. 22
C.3 NLP Datasets
For question answering, the appendix examines ID–OOD F1 and F1-agreement on the SQuAD-to-Amazon shift. It also compares agreement trends across non-neural model families and shifts.
C.3 NLP Datasets
- The question-answering analysis compares ID–OOD F1 with agreement computed by treating one model as the labels or ground truth.F1-agreement is described as the average F1 score across the two model directions.Source: §C.3 · pp. 23–24
- F1-agreement has R2 = 0.94, and ALine-D achieves a mean estimation error of 0.028 on the Amazon question-answering dataset.The model collection contains 99 models.Source: §C.3 · p. 24
C.4 Only Neural Networks
- Among model families, neural-network agreement trends have slopes closest to the ID–OOD accuracy trend; random-feature models also show similar slopes on selected shifts such as CIFAR-10.2.The comparison covers CIFAR-10.2 and fMoW-WILDS as well as the CIFAR10-Fog example discussed in the main body.Source: §C.4 · p. 25, Figure 9 · p. 25
D Model Architectures
The architecture appendix lists model types and counts for several testbeds. The supplied table captions give overall counts and, for some testbeds, pretrained-model counts.
D Model Architectures
- The CIFAR-10 testbed contains 467 models, including 29 pretrained on ImageNet.Source: Table 4 · p. 26
- The ImageNet testbed contains 49 models from timm and Torchvision.Source: Table 5 · p. 26
- The FMoW testbed contains 161 models, including 37 ImageNet-pretrained models and 2 CLIP-pretrained models.Source: Table 6 · p. 26
- The iWildCam-WILDS testbed contains 157 models, including 81 pretrained models.Source: Table 7 · p. 27
- The RxRx1-WILDS testbed contains 36 models, including 16 pretrained on ImageNet.Source: Table 9 · p. 27
- The Camelyon17-WILDS testbed contains 269 models, including 100 pretrained on ImageNet.Source: Table 8 · p. 27
E.1 Details for Experiment 5.2: Correlation analysis
The correlation analysis compares ALine-D with ProjNorm, while a separate training-trajectory experiment estimates CIFAR-10.1 accuracy from saved ResNet18 checkpoints. Experiments used GeForce GTX 1080 and 2080 graphics cards.
E.1 Details for Experiment 5.2: Correlation analysis
- The correlation analysis compares ALine-D and ProjNorm using the correlation between estimated and true OOD accuracy, measured by R2 and rank correlation ρ.The base ResNet18 was trained for 20 epochs; a reference ResNet18 was trained on its pseudolabels for 500 iterations, and 29 pretrained CIFAR-10 models formed the rest of the model set.Source: §E.1 · p. 28
E.2 Details for Experiment 5.3: Performance along a training trajectory
- Every five epochs, the authors saved ResNet18 weights and used ALine-D to estimate each checkpoint’s CIFAR-10.1 accuracy.The model was trained from scratch on CIFAR-10 for 150 epochs.Source: §E.2 · p. 28
E.3 Hardware
- Experiments used GeForce GTX 1080 and 2080 graphics cards.Source: §E.3 · p. 28
F The relationship between agreement and accuracy
Agreement between model pairs tracks ID-to-OOD agreement across pairs of varying performance, including cases where agreement is not equal to accuracy. The analysis also finds that ALine-D can perform well with small model sets, though increasing their size does not always reduce error.
F The relationship between agreement and accuracy
- Agreement-on-the-line extends beyond GDE’s scope to different architectures and checkpoints, even though most pairs do not satisfy GDE.The figure plots ID versus OOD test gaps for 468 CIFAR-10 model pairs and notes that not all pairs have gaps close to zero.Source: F The relationship between agreement… · p. 29, Figure 10 · p. 29
- Across model pairs of varying performance, adjusted agreement lies near the diagonal, indicating a strong ID-to-OOD agreement relationship.Figure 12 plots each pair’s ID versus OOD agreement, with dot color representing average ID test accuracy.Source: F The relationship between agreement… · p. 30, Figure 12 · p. 30
G.1 How many models are necessary for ALine-D to make accurate predictions?
- For CIFAR-10.1, estimation error drops quickly; for ImageNetV2, MAE starts at 2.5%, while CIFAR-10C Fog stays below 1.8% without improving as model sets grow.ALine-D requires at least three models; the reported results indicate it can work well with fewer than 15 when agreement-on-the-line holds, and more models do not always reduce error.Source: §G.1 · p. 31, Figure 13 · p. 31
G.2 Does a model set of varied architecture perform better than models of the same architecture?
The architecture-diversity comparison gives dataset-dependent results: diverse model sets perform better on CIFAR-10.1 and CIFAR-10C Fog, while a single-architecture set performs better on fMoW.
G.2 Does a model set of varied architecture perform better than models of the same architecture?
- ALine-D performs better with diverse architectures on CIFAR-10.1 and CIFAR-10C Fog, but with one architecture on fMoW.The comparison averages results over 10 seeds, using 20-model sets for CIFAR and 10-model sets for fMoW.Source: §G.2 · p. 32, Figure 14 · p. 32
Related papers
This paper cites
- Very Deep Convolutional Networks for Large-Scale Image Recognition2014
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale2020
- Going Deeper with Convolutions2014
- Densely Connected Convolutional Networks2016
- Rethinking the Inception Architecture for Computer Vision2015
- Squeeze-and-Excitation Networks2017