Title: ID and OOD Performance Are Sometimes Inversely Correlated on Real-world Datasets
Venue: NeurIPS 2023
Accepted: yes
Keywords: Generalisation; machine learning
Abstract: Several studies have compared the in-distribution (ID) and out-of-distribution (OOD) performance of models in computer vision and NLP. They report a frequent positive correlation and some surprisingly never even observe an inverse correlation indicative of a necessary trade-off. The possibility of inverse patterns is important to determine whether ID performance can serve as a proxy for OOD generalization capabilities.

This paper shows that inverse correlations between ID and OOD performance do happen with multiple real-world datasets, not only in artificial worst-case settings. We explain theoretically how these cases arise and how past studies missed them because of improper methodologies that examined a biased selection of models.

Our observations lead to recommendations that contradict those found in much of the current literature.
- High OOD performance sometimes requires trading off ID performance.
- Focusing on ID performance alone may not lead to optimal OOD performance. It may produce diminishing (eventually negative) returns in OOD performance.
- In these cases, studies on OOD generalization that use ID performance for model selection (a common recommended practice) will necessarily miss the best-performing models, making these studies blind to a whole range of phenomena.

ID and OOD Performance Are Sometimes Inversely Correlated on Real-world Datasets

Abstract

Context. Several studies have compared the in-distribution (ID) and out-ofdistribution (OOD) performance of models in computer vision and NLP. They report a frequent positive correlation, but surprisingly, almost never an inverse correlation that would be indicative of a necessary trade-off. Such inverse patterns are possible theoretically, and their occurrence in practice is important to determine whether ID performance can serve as a proxy for OOD generalization.

Findings. This paper shows that inverse correlations between ID and OOD performance do happen with multiple real-world datasets, not only in artificial worst-case settings. We explain theoretically how these cases arise and how past studies missed them because of improper methodologies that examined a biased selection of models.

Implications. Our observations lead to recommendations that contradict those found in much of the current literature.

High OOD performance sometimes requires trading off ID performance.

Focusing on ID performance alone may not lead to optimal OOD performance. It may produce diminishing (eventually negative) returns in OOD performance.

In these cases, studies on OOD generalization that use ID performance for model selection (a common recommended practice) will necessarily miss the bestperforming models, making these studies blind to a whole range of phenomena.

1 Introduction

Past observations. This paper complements existing studies that empirically compare in-distribution (ID) and out-of-distribution 1 (OOD) performance of deep learning models [2, 6, 25, 22, 24, 42, 50]. It has long been known that models applied to OOD data suffer a drop in performance, e.g. in classification accuracy. The above studies show that, despite this gap, ID and OOD performance are often positively correlated 2 across models on benchmarks in computer vision [25] and NLP [24].

Past explanations. Frequent positive correlations are surprising because inverse correlations are similarly possible theoretically. Indeed, ID and OOD data contain different associations between labels and features. One could imagine e.g. that an image background is associated with class C 1 ID and class C 2 OOD. The more a model relies on the presence of this background, the better its

Figure 1: Several past studies suggest that positive correlations between ID / OOD performance are ubiquitous. This paper shows empirically and theoretically why inverse correlations are also possible and can be accidentally overlooked. The possibility of ID / OOD trade-offs goes counter the common practice of model selection based on ID performance, which is recommended in many benchmarks for OOD generalization.

Toy representations (one point = one model) Positive correlation Inverse correlation

ID Accuracy

ID Accuracy

ID performance but the worse its OOD performance, resulting in an inverse correlation. The fact that inverse correlations were almost never observed in practice was explained with the fact that real-world benchmarks only contain mild distribution shifts [22]. However, we will show in Section 4 that the reason may also be in flawed experimental design.

A recent study [50] shows various correlation patterns across datasets, but never inverse ones:

' We did not observe any trade-off between accuracy and robustness, where more accurate models would overfit to spurious features that do not generalize. ' [50]

This does not match our past general experience, so we set out to expose in this paper actual cases of inverse correlations, using popular datasets used for OOD research. Our results show inverse correlations across models trained with varying numbers of epochs and random seeds. These patterns are even more striking when models are trained with a regularizer that identifies a diverse set of solutions to the ERM objective [46].

Explaining inverse correlations. We name the underlying cause a ' misspecification ', an extension of the ' underspecification ' used previously to explain why models with similar ID performance can vary in OOD performance [5, 16, 47]. In cases of misspecification, the standard ERM objective (empirical risk minimization) aligns with a maximization of the ID performance but is in conflict with the OOD performance. ID and OOD metrics then vary inversely to one another. In Appendix C, we present a minimal theoretical example to illustrate how inverse correlations originate from the presence of both robust and spurious features in the data. In Section 7, we show that different patterns of ID / OOD performance occur with different magnitudes of distribution shifts.

Summary of contributions.

An empirical examination of ID vs. OOD performance on several real-world datasets showing inverse correlation patterns that conflict with past evidence (Section 3).

An explanation and an empirical verification of why past studies missed such patterns (Section 4).

A theoretical analysis showing how inverse correlation patterns can occur (Appendix C).

A revision of conclusions and recommendations made in past studies (Section 8).

2 Previously-observed patterns of ID / OOD performance

Multiple studies conclude that ID and OOD performance vary jointly across models on many realworld datasets [6, 25, 42]. Miller et al. [25] report an almost-systematic linear correlation 3 between probit-scaled ID and OOD accuracies. Mania and Sra [22] explain this trend with the fact that many benchmarks contain only mild shifts. 4 Andreassen et al. [2] find that pretrained models perform 'above the linear trend' in early stages of fine-tuning. The OOD accuracy then rises more quickly than the ID accuracy early on, though the final accuracies agree with a linear trend across models.

Most recently, the large-scale study of Wenzel et al. [50] is more nuanced: they observe a linear trend only on some datasets. Their setup consists in fine-tuning an ImageNet-pretrained model on a chosen dataset and evaluating it on ID and OOD splits w.r.t. this dataset. They repeat the procedure with a variety of datasets, architectures, and other implementation choices such as data augmentations. The scatter plots of ID / OOD accuracy in [50] show four typical patterns (Figure 2).

0.00

0.25

0.50

0.75

1.00

ID accuracy

0.0

0.2

0.4

0.6

0.8

OOD accuracy

INCREASING LINE

(DomainNet clipart-vs-sketch)

0.00

0.25

0.50

0.75

1.00

ID accuracy

VERTICAL LINE

(PACS sketch-vs-photo)

0.00

0.25

0.50

0.75

1.00

ID accuracy

HORIZONTAL LINE

(DomainNet infograph-vs-quickdraw)

0.00

0.25

0.50

0.75

1.00

ID accuracy

NO CLEAR TREND

(TerraIncognita Loc46-vs-Loc38)

Increasing line (positive correlation): mild distribution shift. ID and OOD accuracies are positively correlated. Focusing on classical (ID) generalization brings concurrent OOD improvements.

Vertical line: underspecification [5, 16, 47]. Different models obtain a similar high ID performance but different OOD performance. The objective of high ID performance does not sufficiently constrains the learning. Typically, multiple features in the data (a.k.a. biased or spurious features) can be used to obtain high ID performance, but not all of them are equally reliable on OOD data. To improve OOD performance, additional task-specific information is necessary, e.g. additional supervision or inductive biases (custom architectures, regularizers, etc.).

Horizontal line, low OOD accuracy: severe distribution shift. No model performs well OOD. A severe shift prevents any transfer between training and OOD test data. The task needs to be significantly more constrained e.g. with task-specific inductive biases.

No clear trend: underspecification. Models show a variety of ID and OOD accuracies. The difference with (2) is the wider variety along the ID axis, e.g. because a difficult learning task yields solutions of lower ID accuracy from local minima of the ERM objective.

The authors note the absence of decreasing patterns, which are however possible in theory.

Decreasing line (inverse correlation): misspecification. The highest accuracy ID and OOD are achieved by different models. Optima of the ERM objective, which are expected to be optima in ID performance, do not correspond to optima in OOD performance. This implies a trade-off: higher OOD performance is possible at the cost of lower ID performance.

When does an inverse correlation occur between ID and OOD performance?

Intuitively, it can occur when a pattern in the data is predictive in one distribution and misleading in the other. For example, object classes C 1 and C 2 are respectively associated with image backgrounds B 1 and B 2 in ID data, and respectively B 2 in B 1 (swapped) in OOD data. Relying on the background can improve performance on either distribution but not both simultaneously. While such severe shifts might be rare, the next section presents an actual example.

3 New observations: inversely-correlated ID / OOD performance

This section is an in-depth examination using the WILDS-Camelyon17 dataset [15]. We include experiments on other datasets in Section 5.1 and Appendix B. Here, we use Camelyon17 in a manner similar to Wenzel et al. [50]. These authors evaluated different architectures and assumed that their different inductive biases can produce models that cover a range of ID / OOD accuracies. In contrast and for simplicity, we rely instead on different random seeds since [5] showed that this is sufficient to

70

75

80

85

90

95

100

Accuracy (%, val-id)

55

60

65

70

75

80

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

65

70

75

80

85

90

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

55

60

65

70

75

80

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

45

50

55

60

65

70

Accuracy (%, test-ood)

cover a variety of ID / OOD accuracies on this dataset. We also want to minimize the experimenter's bias. Therefore, to further increase variety without the manual arbitrary selection of architectures of [50], we also train models with the general-purpose, diversity-inducing method of [46].

Background: learning diverse solutions.

Arange of methods have been proposed to train multiple networks to similar ID performance while differing in other properties such as OOD generalization. These 'diversification' methods are relevant in cases of underspecification [5] when the standard ERM objective does not constrain the solution space to a unique one. Recent methods train multiple models (in parallel or sequentially) while encouraging diversity in feature space [11, 57], prediction space [28, 16], or gradient space [36, 35, 46, 47]. We use method of [46] that encourages gradient diversity .

Training image

Feature extractor (frozen DenseNet)

Set of diverse models (linear classifiers)

Pairwise

similarity of

input gradients

The method trains many copies of the same model in parallel - in our case, a linear classifier on top of a frozen DenseNet backbone (see Figure 4). The models are optimized by standard SGD to minimize the sum of a standard classification loss (cross-entropy) with a diversity loss that encourages diversity across models. Using λ a weight hyperparameter, the complete loss is L = L classification + λ L diversity. The second term encourages each copy to rely on different features by minimizing the mutual alignment of input gradients:

These pairwise dot products quantify the mutual alignment of the gradients. Intuitively, minimizing (1) makes each model locally sensitive along different directions in its input space.

Assuming that g produces a vector of logits (as many as there are classes), ∇ h g ( · ) refers to the gradient of the largest logit w.r.t. the classifier's input h . We use n =24 copies and a weight λ =10 that were selected for giving a wide range of ID accuracies. See [46] for details about the method.

Experimental details. We use 10 DenseNet-121 models pretrained by the authors of the dataset with different seeds [15]. For each, we re-train the last linear layer from a random initialization for 1 to 10 epochs, keeping other layers frozen. These are referred to as ERM models . We perform this re-training with 10 different seeds which gives 10 3 ERM models (10 pretraining seeds × 10 retraining seeds × 10 numbers of epochs). In addition, we repeat this re-training of the last layer with the diversity-inducing method of [46] (details in the box below). These are referred to as diverse models . Each run of the methods produces 24 different models, giving a total of 10 3 . 24 such models.

Results with ERM models. In Figure 3 we plot the ID vs. OOD accuracy of ERM models as red dots ( ). Each panel corresponds to a different pretraining seed. The variation across panels (note the different Y-axis limits) shows that OOD performance varies across pre-training seeds even though the ID accuracy is similar, as noted by [15]. Our new observations are visible within each panel. The dots (models) in any panel differ in their re-training seed and/or number of epochs. The seeds induce little variation, but the number of epochs produce patterns of decreasing trend (negative correlation). Despite the narrow ID variation (X axis), careful inspection confirms that the pattern appears in nearly all cases (see Appendix A for zoomed-in plots).

Results with diverse models. We plot models trained with the diversity method [46] as gray dots ( ). These models cover a wider range of accuracies and form patterns that extend those of ERM models. The decreasing trend is now obvious. This trend is clearly juxtaposed with a rising trend of positive ID/OOD correlation. This suggests a point of highest OOD performance after which the model overfits to ID data. Appendix A shows similar results with other pretraining seeds. The patterns are

not always clearly discernible because large regions of the performance landscape are not covered, despite the diversity-inducing method. We further discuss this issue next.

4 Past studies missed negative correlations due to biased sampling of models

We identified several factors explaining the discrepancy between our observations and past studies.

ERM models alone do not always form clear patterns (red dots in Figure 3). In our observations, the models trained with a diversity-inducing method (gray dots ) were key in making the suspected patterns more obvious, because they cover a wider range of accuracies.

The ID / OOD trade-off varies during training, as noted by [2]. This variation across training epochs is responsible for much of the newly observed patterns. However, models of different architectures or pretraining seeds are not always comparable with one another because of shifts in their overall performance (see e.g. different Y-axis limits across panels in Figure 3). Therefore the performance across epochs should be analyzed individually per model.

The 'inverse correlation' patterns are not equally visible with all pretraining seeds . In some cases, a careful examination of zoomed-in plots is necessary, see Appendix A. This is a reminder that stochastic factors in deep learning can have large effects and that empirical studies should randomize them as much as possible.

To demonstrate these points, we plot our data (same as in Figure 3) while keeping only the ERM models trained for 10 epochs and including all pretraining seeds on the same panel. Figure 5 shows that these small changes reproduce the vertical line observed by Wenzel et al. [50], which completely misses the inverse correlations patterns visible in Figure 3.

50

55

60

65

70

75

80

85

90

95

100

Accuracy (%, val-id)

50

55

60

65

70

75

80

85

90

95

100

Accuracy (%, test-ood)

Under

-

sampled

regime

Ageneral explanation is that past studies undersample regions of the ID / OOD performance space . They usually consider a variety of architectures in an attempt to sample this space. However, different architectures do not necessarily behave very differently from one another (see the box below). We lack methods to reliably identify models of high OOD performance, but the diversity-inducing method that we use yields models spanning a wide range of the performance spectrum.

Why isn't it sufficient to evaluate a variety of architectures?

Different architectures do not necessarily induce radically different behaviour [39]. Even CNNs and vision transformers have similar failure modes [29]. Distinct architectures can share similar inductive biases due e.g. to SGD, the simplicity bias [39, 40], or neural anisotropies [27].

5 Occurrences in other datasets

In addition to Camelyon17, we performed experiments on five additional datasets used in OOD research and found inverse correlations on four out of five. We present two of them below and the others in Appendix B.

In these experiments, we train standard architectures with well-known methods: standard ERM, simple class balancing [12], mixup [60], selective mixup [56], and post hoc adjustment for label shift [19] (we did not use the diversification method from Section 3). We repeat every experiment with 10 seeds and plot the ID / OOD accuracy from every epoch in the following figures.

5.1 WildTime-arXiv

Data. The WildTime-arXiv [55] dataset contains text abstracts from arXiv preprints. The task is to predict each paper's category among 172 classes. The ID and OOD splits are made of data from different time periods.

Methods. We fine-tune a standard BERT-tiny model with a new linear head, using any of these well-known methods: standard ERM, simple class balancing [12], mixup [60], selective mixup [56], and post hoc adjustment for label shift [19] (we did not use the diversification method from Section 3). We repeat every experiment with 10 seeds and record the ID and OOD accuracy at every training epoch. We then plot each of these points in Figure 6 and highlight the epoch of highest ID or OOD accuracy per run (method/seed combination).

Results. As discussed in Section 5.1, there is a clear trade-off both within methods (i.e. across seeds and epochs) and across methods.

44

49

54

ID accuracy (%)

39

44

49

OOD accuracy (%)

ERM Baseline

Resampling

(uniform classes)

Mixup and

Adjusting for

label shift

Epochs of best ID

accuracy

Epochs of best OOD

accuracy

5.2 Waterbirds

Data. The waterbirds dataset [37] is a synthetic dataset widely used for evaluating OOD generalization. The task is to classify images of birds into 2 classes. The image backgrounds are also of two types, and the correlation between birds and background is reversed across the training and test splits. The standard metric is the worst-group accuracy, where each group is any of the 4 combinations of bird/background.

Methods. We follow the same procedure as described above. We experiment two classes of architectures: ResNet-50 models pretrained on ImageNet and fine-tuned on waterbirds, and linear classifiers trained of features from the same frozen (non-fine-tuned) ResNet-50.

Results. We observe in Figure 7 patterns of inverse correlations in both cases.

87

92

97

ID accuracy (%)

52

64

76

88

OOD (worst-group) accuracy (%)

ERM Baseline

Resampling

(uniform groups)

Selective mixup

(intra-domain/-label LISA)

Epochs of best ID

accuracy

Epochs of best OOD

accuracy

77

83

89

95

ID accuracy (%)

67

73

79

85

OOD Worst-group accuracy (%)

Epochs of

best ID

accuracy

Epochs of

best OOD

accuracy

5.3 Occurrences in the existing literature

A literature review reveals other cases across a range of topics, many of which were not particularly highlighted by their authors and required close examination.

A close examination of [9, Table 2] reveals a clear inverse pattern on three benchmarks for natural language inference (NLI). This task is known for biases and shortcuts in the training data, and the OOD test sets in these benchmarks correspond to severe distribution shifts. Our

proposed explanation (right end of the spectum in Figure 8) therefore aligns with these observations. Experiments on question answering from the same authors use data with milder distribution shifts. Correspondingly, they show instead a positive correlation.

Kaplun et al. [14, Figure 7] find that the CIFAR dataset contains a subset (CIFAR-10-Neg) on which the performance of visual classifiers is inversely correlated with their ID performance.

Xie et al. [53, Section 5.3] discuss cases of inverse correlation on the CelebA dataset with their In-N-Out method - albeit within an overall positive trend.

McCoy et al. [23] show that BERT models trained with different seeds vary widely in performance on the HANS benchmark for NLI while their ID performance on MNLI is similar.

Naganuma et al. [26] performed an extensive evaluation on OOD benchmarks after the initial release of this paper. They consider a wider range of hyperparameters than existing works, and as expected from our claims, they observe a broader range of ID / OOD relations than the 'linear trend'.

Liang et al. [18] focused on datasets with subpopulation shifts and analyzed the relation between performance across subgroups. They also find a linear trend to be an inaccurate description. They observe non-linear relations with a transition point between models showing a negative correlation and others showing a positive one.

In their paper on Model recycling , Ramé et al. [31] include plots of ID / OOD performance (Appendix A) that are nothing like linear correlations. Instead, bell-shaped curves unambiguously indicate a necessary trade-off between ID and OOD performance.

Work on adversarial examples has examined the trade-off between standard and adversariallyrobust accuracy [30, 54, 59]. This agrees with our explanations (Figure 8) since adversarial inputs correspond to extreme distribution shifts.

The literature on transfer learning has previously shown occasional cases of negative transfer, a related phenomenon where improving performance in one domain hurts in others [20, 49].

6 Theoretical analysis

The theoretical possibility of an inverse ID/OOD correlation is quite obvious. In Appendix C), we show below theoretically how to construct a toy example where ID and OOD are negatively correlated. We then explain how ID and OOD metrics can diverge as training progresses, or as one trains a model on data containing more and more spurious features.

However, the theoretical analysis is not central to our argument. The more important open question is whether these cases happen merely in pathological situations, or also in real-world data. Prior work strongly argued for the former, but we show that the latter is actually correct. The key contribution of this paper is therefore in the observations on actual data, rather than in a theoretical argument.

7 Ordering ID / OOD patterns according to shift magnitude

The above analysis shows that inverse correlation patterns are essentially due to the presence of spurious features, i.e. features whose predictive relation with the target in ID data becomes misleading OOD. Occurrences of spurious features increase with the magnitude of the distribution shift. Therefore, the possible patterns in ID / OOD performance presented in Section 2 can be ordered according to the magnitude of the distribution shift they are likely to occur with (see Figure 8).

With the smallest distribution shifts (leftmost case in Figure 8), for example training on ImageNet and testing on its replication ImageNet v2 [32], ID validation performance closely correlates with OOD test performance. This OOD setting is the easiest because one can focus on improving classical generalization and reap concurrent improvements OOD.

With a larger distribution shift, more features are likely to be spurious, which is likely to break the ID/ OOD correlation. The task of improving OOD performance is likely to be under- or misspecified, i.e. there is not enough information to determine which features a model should rely on.

Valid approaches include modifying the training objective, injecting task-specific information (e.g. building-in invariance to rotations as in [43]), well-chosen data augmentations, or inhomogeneous training data such as multiple training environments [17] or counterfactuals [44, 1].

Positive transfer

Underspecification

Misspecification

No transfer

Distribution shift

Mild

glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[axisshort]glyph[arrowaxisright]

(Too?) Severe

Typical pattern

Positive correlation

Vertical line/no clear trend

Negative correlation

Low horizontal line

(toy representation)

ID Accuracy

ID Accuracy

ID Accuracy

ID Accuracy

Valid approaches

Simply focus

Task-relevant inductive biases e.g. arch., regularizers.

Open

for improving OOD

on improving

Data augmentation with task-relevant transformatiofns.

question

performance

ID performance

Non-i.i.d. training data e.g. multiple training domains.

Example

ImageNet

→

PACS sketch

→

WILDS

DomainNet

datasets

ImageNet v2

photograph

Camelyon17

infograph

→

quickdraw

[32]

[17]

[15]

[15]

With extreme distribution shifts, most predictive features are overwhelmingly spurious and it is very difficult to learn any one relevant in OOD data (rightmost case in Figure 8).

The proposed ordering of patterns is rather informal and could be further developed following the two axes of diversity shifts and correlation shifts proposed by [58] (see also [52]). More recently, [48] showed that the suitability of various methods for OOD generalization depends on particularities of the underlying causal structure of the task - which must therefore be known to select a suitable method. Identifying which ID / OOD patterns occur with particular causal structures might serve as a tool to understand the type of OOD situation one is facing and identify a suitable method.

8 Revisiting advice from past studies

We have established that observations in past studies were incomplete. We now bring nuance to some recommendations and conclusions made in these studies.

· Focusing on a single metric.

' We see the following potential prescriptive outcomes (...) correlation between OOD and ID performance can simplify model development since we can focus on a single metric . ' [25]

We demonstrated that inverse correlations do occur, hence there exist scenarios where ID performance is misleading. Relying on a single metric for model development is ill-advised [45] especially if it cannot capture necessary trade-offs. We recommend tracking multiple metrics e.g. performance on multiple distributions or interpretable predictions on representative test points.

· Improving ID performance for OOD robustness.

' If practitioners want to make the model more robust on OOD data, the main focus should be to improve the ID classification error . (...) We speculate that the risk of overfitting large pretrained models to the downstream test set is minimal, and it seems to be not a good strategy to, e.g., reduce the capacity of the model in the hope of better OOD generalization. ' [50]

This recommendation assumes the persistence of a positive correlation. On the opposite, we saw that a positive correlation can precede a regime of inverse correlation (Figure 3, left panels). If the goal is to improve OOD, focusing on ID performance is a blind alley since this goal requires to increase ID performance at times and reduce it at others.

· Future achievable OOD performance.

As obvious as it is, it feels necessary to point out that empirical studies only chart regimes achievable with existing methods. Observations have limited predictive power, hence more care seems warranted when deriving prescriptive recommendations from empirical evidence.

The best possible performance e.g. on Camelyon17 is obviously not limited to the Pareto front of our experiments. The state of the art on this dataset [33, 51] injects additional task knowledge to bypass the under/misspecification of ERM, and exceeds both our highest ID and OOD performance.

The important message remains that a given hypothesis class (DenseNet architecture in our case) admits parametrizations on which ID and OOD metrics do not necessarily correlate.

· Possible invalidation of existing studies.

The possibility of inverse correlations may invalidate studies that implicitly assume a positive one. For example, Angarano et al. [3] evaluate the OOD robustness of computer vision backbones. They find modern architectures surpass domain generalization methods. However, they discard any model with submaximal ID performance by performing ' training domain validation ' as in [10]. Any model with high OOD performance but suboptimal ID is ignored. They also train every model for a fixed, large number of epochs. And this may additionally prevent from finding models with high OOD performance since robustness is often progressively lost during fine-tuning [2].

By design, this study [3] is incapable of finding OOD benefits of architectures or methods that require trading off some ID performance. Most importantly, once the assumption of a positive correlation is enacted by throwing away models with submaximal ID performance, there is no more opportunity to demonstrate its validity.

An even more recent example of this fallacy is found in [21]. The authors construct a new OOD benchmark, train and tune baselines for maximum ID performance, then observe:

' We find no [positive nor inverse] correlation between in- and out-of-distribution environment performance. All methods consistently achieve 98-99% ID test performance. ' [21]

But the authors did not give the chance to make any other observation. As in Figure 5, the ID criterion means that we only get to observe a thin vertical slice of the ID vs. OOD plot. 5

9 Discussion

This paper highlighted that inverse correlations between ID / OOD performance are possible, not only theoretically but also with real-world data. It is difficult to estimate how frequent this situation is. Although we examined a single counterexample,we also showed that past studies may have systematically overlooked such cases. This suffices to show that one cannot know a priori where a task falls on the spectrum of Figure 8. It is clearly ill-advised to blindly assume a positive correlation.

Can we avoid inverse correlations with more training data? Scaling alone without data curation seems unlikely to prevent inverse correlations. [8] examined a more general question and determined that the impressive robustness of the large vision-and-language model CLIP is determined by the distribution of its training data rather than its quantity. Similarly, inverse correlations stem from biases in the training distribution (e.g. a class C 1 appearing more frequently with image background B 1 than any other). And biases in a distribution do not vanish with more i.i.d. samples. Indeed, more data can cover more of the support of the distribution, but this coverage will remain uneven, i.e. biased. The problem can become one of 'subpopulation shift' [38] rather than distribution shift, but it remains similarly challenging.

Training full networks with a diversity-inducing method. We showed inverse correlations with standard ERM models and with linear classifiers trained with a diversity-inducing method [46]. To the best of our knowledge, this diversity method has not been applied to deep models because of its computational expense. It would be interesting to confirm our observations on networks trained entirely with diversity-inducing methods.

Qualitative differences along the Pareto frontier. Besides quantitative performance, interpretability methods could examine whether various ID / OOD trade-off models rely on different features and generalization strategies as done in NLP in [13].

Model selection for OOD generalization has recently seen promising advances. [7] get around selection based on either ID or OOD validation data with a tunable trade-off in their Quantile Risk Minimization method. And [48] examined existing approaches to OOD generalization from their suitability to various distribution shifts and causal structures.

References

Ehsan Abbasnejad, Damien Teney, Amin Parvaneh, Javen Shi, and Anton van den Hengel. Counterfactual vision and language learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) , June 2020.

Anders Andreassen, Yasaman Bahri, Behnam Neyshabur, and Rebecca Roelofs. The evolution of out-of-distribution robustness throughout fine-tuning. arXiv preprint arXiv:2106.15831 , 2021.

Simone Angarano, Mauro Martini, Francesco Salvetti, Vittorio Mazzia, and Marcello Chiaberge. Back-to-bones: Rediscovering the role of backbones in domain generalization. arXiv preprint arXiv:2209.01121 , 2022.

Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893 , 2019.

Alexander D'Amour, Katherine Heller, Dan Moldovan, Ben Adlam, Babak Alipanahi, Alex Beutel, Christina Chen, Jonathan Deaton, Jacob Eisenstein, Matthew D Hoffman, et al. Underspecification presents challenges for credibility in modern machine learning. arXiv preprint arXiv:2011.03395 , 2020.

Josip Djolonga, Jessica Yung, Michael Tschannen, Rob Romijnders, Lucas Beyer, Alexander Kolesnikov, Joan Puigcerver, Matthias Minderer, Alexander D'Amour, Dan Moldovan, et al. On robustness and transferability of convolutional neural networks. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn. , 2021.

Cian Eastwood, Alexander Robey, Shashank Singh, Julius von Kügelgen, Hamed Hassani, George J Pappas, and Bernhard Schölkopf. Probable domain generalization via quantile risk minimization. arXiv preprint arXiv:2207.09944 , 2022.

Alex Fang, Gabriel Ilharco, Mitchell Wortsman, Yuhao Wan, Vaishaal Shankar, Achal Dave, and Ludwig Schmidt. Data determines distributional robustness in contrastive language image pre-training (CLIP). arXiv preprint arXiv:2205.01397 , 2022.

Tejas Gokhale, Swaroop Mishra, Man Luo, Bhavdeep Singh Sachdeva, and Chitta Baral. Generalized but not robust? comparing the effects of data modification methods on out-ofdomain generalization and adversarial robustness. arXiv preprint arXiv:2203.07653 , 2022.

Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. In Proc. Int. Conf. Learn. Representations , 2021.

Ari Heljakka, Martin Trapp, Juho Kannala, and Arno Solin. Representational multiplicity should be exposed, not eliminated. arXiv preprint arXiv:2206.08890 , 2022.

Badr Youbi Idrissi, Martin Arjovsky, Mohammad Pezeshki, and David Lopez-Paz. Simple data balancing achieves competitive worst-group-accuracy. In Conference on Causal Learning and Reasoning , 2022.

Jeevesh Juneja, Rachit Bansal, Kyunghyun Cho, João Sedoc, and Naomi Saphra. Linear connectivity reveals generalization strategies. arXiv preprint arXiv:2205.12411 , 2022.

Gal Kaplun, Nikhil Ghosh, Saurabh Garg, Boaz Barak, and Preetum Nakkiran. Deconstructing distributions: A pointwise framework of learning. arXiv preprint arXiv:2202.09931 , 2022.

Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, et al. WILDS: A benchmark of in-the-wild distribution shifts. In Proc. Int. Conf. Mach. Learn. , 2021.

Yoonho Lee, Huaxiu Yao, and Chelsea Finn. Diversify and disambiguate: Learning from underspecified data. arXiv preprint arXiv:2202.03418 , 2022.

Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn. , pages 5542-5550, 2017.

Weixin Liang, Yining Mao, Yongchan Kwon, Xinyu Yang, and James Zou. On the nonlinear correlation of ml performance across data subpopulations. In ICML 2022: Workshop on Spurious Correlations, Invariance and Stability , 2022.

Zachary Lipton, Yu-Xiang Wang, and Alexander Smola. Detecting and correcting for label shift with black box predictors. In Proc. Int. Conf. Mach. Learn. , 2018.

Shengchao Liu, Yingyu Liang, and Anthony Gitter. Loss-balanced task weighting to reduce negative transfer in multi-task learning. In Proc. Conf. AAAI , 2019.

Aengus Lynch, Gbètondji JS Dovonon, Jean Kaddour, and Ricardo Silva. Spawrious: A benchmark for fine control of spurious correlation biases. arXiv preprint arXiv:2303.05470 , 2023.

Horia Mania and Suvrit Sra. Why do classifier accuracies show linear trends under distribution shift? arXiv preprint arXiv:2012.15483 , 2020.

R Thomas McCoy, Junghyun Min, and Tal Linzen. Berts of a feather do not generalize together: Large variability in generalization across models with similar test set performance. arXiv preprint arXiv:1911.02969 , 2019.

John Miller, Karl Krauth, Benjamin Recht, and Ludwig Schmidt. The effect of natural distribution shift on question answering models. In Proc. Int. Conf. Mach. Learn. , 2020.

John P Miller, Rohan Taori, Aditi Raghunathan, Shiori Sagawa, Pang Wei Koh, Vaishaal Shankar, Percy Liang, Yair Carmon, and Ludwig Schmidt. Accuracy on the line: on the strong correlation between out-of-distribution and in-distribution generalization. In Proc. Int. Conf. Mach. Learn. , 2021.

Hiroki Naganuma, Kartik Ahuja, Ioannis Mitliagkas, Shiro Takagi, Tetsuya Motokawa, Rio Yokota, Kohta Ishikawa, and Ikuro Sato. Empirical study on optimizer selection for out-ofdistribution generalization. NeurIPS 2022 Workshop DistShift , 2022.

Guillermo Ortiz-Jimenez, Itamar Franco Salazar-Reque, Apostolos Modas, Seyed-Mohsen Moosavi-Dezfooli, and Pascal Frossard. A neural anisotropic view of underspecification in deep learning. In Proc. Int. Conf. Learn. Representations , 2021.

Matteo Pagliardini, Martin Jaggi, François Fleuret, and Sai Praneeth Karimireddy. Agree to disagree: Diversity through disagreement for better transferability. arXiv preprint arXiv:2202.04414 , 2022.

Francesco Pinto, Philip HS Torr, and Puneet K Dokania. An impartial take to the CNN vs transformer robustness contest. arXiv preprint arXiv:2207.11347 , 2022.

Aditi Raghunathan, Sang Michael Xie, Fanny Yang, John Duchi, and Percy Liang. Understanding and mitigating the tradeoff between robustness and accuracy. arXiv preprint arXiv:2002.10716 , 2020.

Alexandre Ramé, Kartik Ahuja, Jianyu Zhang, Matthieu Cord, Léon Bottou, and David Lopez-Paz. Recycling diverse models for out-of-distribution generalization. arXiv preprint arXiv:2212.10445 , 2022.

Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? In Proc. Int. Conf. Mach. Learn. , 2019.

Alexander Robey, George J Pappas, and Hamed Hassani. Model-based domain generalization. Proc. Advances in Neural Inf. Process. Syst. , 2021.

Elan Rosenfeld, Pradeep Ravikumar, and Andrej Risteski. The risks of invariant risk minimization. arXiv preprint arXiv:2010.05761 , 2020.

Andrew Ross, Weiwei Pan, Leo Celi, and Finale Doshi-Velez. Ensembles of locally independent prediction models. In Proc. Conf. AAAI , 2020.

Andrew Slavin Ross, Weiwei Pan, and Finale Doshi-Velez. Learning qualitatively diverse and interpretable rules for classification. arXiv preprint arXiv:1806.08716 , 2018.

Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. arXiv preprint arXiv:1911.08731 , 2019.

Shibani Santurkar, Dimitris Tsipras, and Aleksander Madry. BREEDS: Benchmarks for subpopulation shift. arXiv preprint arXiv:2008.04859 , 2020.

Luca Scimeca, Seong Joon Oh, Sanghyuk Chun, Michael Poli, and Sangdoo Yun. Which shortcut cues will dnns choose? a study from the parameter-space perspective. In Proc. Int. Conf. Learn. Representations , 2022.

Harshay Shah, Kaustav Tamuly, Aditi Raghunathan, Prateek Jain, and Praneeth Netrapalli. The pitfalls of simplicity bias in neural networks. arXiv preprint arXiv:2006.07710 , 2020.

Hidetoshi Shimodaira. Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of statistical planning and inference , 2000.

Rohan Taori, Achal Dave, Vaishaal Shankar, Nicholas Carlini, Benjamin Recht, and Ludwig Schmidt. Measuring robustness to natural distribution shifts in image classification. Proc. Advances in Neural Inf. Process. Syst. , 2020.

Damien Teney and Martial Hebert. Learning to extract motion from videos in convolutional neural networks. In Asian Conference on Computer Vision , pages 412-428. Springer, 2016.

Damien Teney, Ehsan Abbasnedjad, and Anton van den Hengel. Learning what makes a difference from counterfactual examples and gradient supervision. arXiv preprint arXiv:2004.09034 , 2020.

Damien Teney, Kushal Kafle, Robik Shrestha, Ehsan Abbasnejad, Christopher Kanan, and Anton van den Hengel. On the value of out-of-distribution testing: An example of Goodhart's law. In Proc. Advances in Neural Inf. Process. Syst. , 2020.

Damien Teney, Ehsan Abbasnejad, Simon Lucey, and Anton van den Hengel. Evading the simplicity bias: Training a diverse set of models discovers solutions with superior OOD generalization. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn. , 2022.

Damien Teney, Maxime Peyrard, and Ehsan Abbasnejad. Predicting is not understanding: Recognizing and addressing underspecification in machine learning. arXiv preprint arXiv:2207.02598 , 2022.

Zihao Wang and Victor Veitch. A unified causal view of domain invariant representation learning. arXiv preprint arXiv:2208.06987 , 2022.

Zirui Wang, Zihang Dai, Barnabás Póczos, and Jaime Carbonell. Characterizing and avoiding negative transfer. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn. , 2019.

Florian Wenzel, Andrea Dittadi, Peter Vincent Gehler, Carl-Johann Simon-Gabriel, Max Horn, Dominik Zietlow, David Kernert, Chris Russell, Thomas Brox, Bernt Schiele, et al. Assaying out-of-distribution generalization in transfer learning. arXiv preprint arXiv:2207.09239 , 2022.

WILDS Leaderboard. https://wilds.stanford.edu/leaderboard/ .

Olivia Wiles, Sven Gowal, Florian Stimberg, Sylvestre Alvise-Rebuffi, Ira Ktena, Taylan Cemgil, et al. A fine-grained analysis on distribution shift. arXiv preprint arXiv:2110.11328 , 2021.

Sang Michael Xie, Ananya Kumar, Robbie Jones, Fereshte Khani, Tengyu Ma, and Percy Liang. In-n-out: Pre-training and self-training using auxiliary information for out-of-distribution robustness. arXiv preprint arXiv:2012.04550 , 2020.

Yao-Yuan Yang, Cyrus Rashtchian, Hongyang Zhang, Russ R Salakhutdinov, and Kamalika Chaudhuri. A closer look at accuracy vs. robustness. Proc. Advances in Neural Inf. Process. Syst. , 2020.

Huaxiu Yao, Caroline Choi, Bochuan Cao, Yoonho Lee, Pang Wei W Koh, and Chelsea Finn. Wild-time: A benchmark of in-the-wild distribution shift over time. Proc. Advances in Neural Inf. Process. Syst. , 2022.

Huaxiu Yao, Yu Wang, Sai Li, Linjun Zhang, Weixin Liang, James Zou, and Chelsea Finn. Improving out-of-distribution robustness via selective augmentation. In Proc. Int. Conf. Mach. Learn. , 2022.

Shingo Yashima, Teppei Suzuki, Kohta Ishikawa, Ikuro Sato, and Rei Kawakami. Feature space particle inference for neural network ensembles. arXiv preprint arXiv:2206.00944 , 2022.

Nanyang Ye, Kaican Li, Haoyue Bai, Runpeng Yu, Lanqing Hong, Fengwei Zhou, Zhenguo Li, and Jun Zhu. Ood-bench: Quantifying and understanding two dimensions of out-of-distribution generalization. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn. , 2022.

Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric Xing, Laurent El Ghaoui, and Michael Jordan. Theoretically principled trade-off between robustness and accuracy. In Proc. Int. Conf. Mach. Learn. , 2019.

Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412 , 2017.

Xiao Zhou, Yong Lin, Weizhong Zhang, and Tong Zhang. Sparse invariant risk minimization. In Proc. Int. Conf. Mach. Learn. , 2022.

Appendix

A Additional results on Camelyon17

70

75

80

85

90

95

100

Accuracy (%, val-id)

55

60

65

70

75

80

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

65

70

75

80

85

90

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

55

60

65

70

75

80

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

55

60

65

70

75

80

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

55

60

65

70

75

80

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

45

50

55

60

65

70

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

55

60

65

70

75

80

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

55

60

65

70

75

80

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

60

65

70

75

80

85

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

45

50

55

60

65

70

Accuracy (%, test-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

70

75

80

85

90

95

100

Accuracy (%, val-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

70

75

80

85

90

95

100

Accuracy (%, val-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

70

75

80

85

90

95

100

Accuracy (%, val-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

70

75

80

85

90

95

100

Accuracy (%, val-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

70

75

80

85

90

95

100

Accuracy (%, val-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

70

75

80

85

90

95

100

Accuracy (%, val-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

70

75

80

85

90

95

100

Accuracy (%, val-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

70

75

80

85

90

95

100

Accuracy (%, val-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

70

75

80

85

90

95

100

Accuracy (%, val-ood)

70

75

80

85

90

95

100

Accuracy (%, val-id)

70

75

80

85

90

95

100

Accuracy (%, val-ood)

96

97

98

Accuracy (%, val-id)

80

81

82

Accuracy (%, val-ood)

96

97

98

Accuracy (%, val-id)

83

84

85

Accuracy (%, val-ood)

94

95

96

Accuracy (%, val-id)

81

82

83

Accuracy (%, val-ood)

96

97

98

Accuracy (%, val-id)

87

88

89

Accuracy (%, val-ood)

96

97

98

Accuracy (%, val-id)

79

80

81

Accuracy (%, val-ood)

96

97

98

Accuracy (%, val-id)

84

85

86

Accuracy (%, val-ood)

95

96

97

Accuracy (%, val-id)

83

84

85

Accuracy (%, val-ood)

96

97

98

Accuracy (%, val-id)

83

84

85

Accuracy (%, val-ood)

96

97

98

Accuracy (%, val-id)

83

84

85

Accuracy (%, val-ood)

96

97

98

Accuracy (%, val-id)

82

83

84

Accuracy (%, val-ood)

B Results on other datasets

B.1 CivilComments

Data. The CivilComments dataset [15] is another widely-used dataset in OOD research. It contains text comments from internet forums to be classified as toxic or not. Each example is labeled with a topical attribute (e.g. Christian, male, LGBT, etc.) that is spuriously associated with ground truth labels in the training data. The target metric is again worst-group accuracy, where a group is any label/attribute combination.

Methods. We follow the same procedure as described above. We experiment two classes of architectures: pretrained BERT-tiny fine-tuned on CivilComments, and linear classifiers trained of features from the same frozen BERT-tiny models (a.k.a. linear probing).

Results. We observe in Figures 12-13 different patterns with the two classes of architectures. With linear probing, the ID vs. OOD trade-off is minimal, and the model of highest ID performance within a run as well as across methods is very similar to the model of highest OOD performance. With fine-tuning however, the trade-off is more pronounced. The ID and OOD performance usually peak then diminish at different epochs during the fine-tuning. This agrees with previous reports [2] of OOD robustness being progressively lost during fine-tuning.

72

75

78

ID (average-group) accuracy (%)

52

62

72

OOD (worst-group)

accuracy (%)

Epochs of best

ID (average-group)

accuracy

Epochs of best

OOD (worst-group)

accuracy

72

77

ID (average-group) accuracy (%)

46

51

56

61

66

71

OOD (worst-group)

accuracy (%)

Epochs of best

ID (average-group)

accuracy

Epochs of best

OOD (worst-group)

accuracy

B.2 WildTime-MIMIC-Readmission

Data. The WildTime-MIMIC-Readmission [55] dataset contains hospital records (sequences of codes representing diagnoses and treatments) to be classified into two classes, corresponding to the readmission of the patient within a short time. ID and OOD splits contain records from different time periods.

Methods. We follow the same procedure as described above. We train a standard bag-of-embeddings architecture, which associate each diagnosis/treatment with a learned embedding, then summed and fed to a linear classifier. We train this model with standard ERM, and with a resampling to balance the classes in the training data [12], which is a standard approach for imbalanced datasets. We also

train models with a 'mild balancing', where classes are sampled according to a distribution half-way between the original one of the training data, and a uniform (50%-50%) one.

Results. In Figure 14 we observe that ID and OOD performance are mostly positively correlated across methods. The best models are obtained with uniform balancing of classes, in which case model selection based on OOD performance could give a small advantage, but it is marginal compared to the improvement over the ERM baseline, which can be clearly detected on both the ID and OOD performance.

51

64

ID AUROC (%)

51

55

59

OOD AUROC (%)

ERM Baseline

Resampling

(mild balancing of classes)

Resampling

(perfectly uniform classes)

Epochs best ID

Epochs best OOD

B.3 WildTime-Yearbook

Data. The WildTime-Yearbook [55] dataset contains yearbook portraits. Each image is to be classified as male or female, and the ID and OOD splits contain images from different time periods.

Methods. We follow the same procedure as described above. We train the simple CNN architecture described in [55]. We report in Figure 15 both the 'average-group' accuracy (over the entire OOD test set) and the 'worst-group' accuracy (where a group is any 5-year period within the OOD test period.

Results. The patterns are slightly different in the two cases but similar conclusions can be drawn from both. There is a mostly-positive correlation, but at the highest accuracies (upper-right quadrant), some small trade-off exists. This suggests that fine-grained differences exist that are useful for either ID or OOD generalization, but not both. Although differences are small, this 'pointy end' of the spectrum is where the state-of-the-art models compete, hence the relevance of this observation.

97

98

99

100

ID accuracy (%)

74

78

82

86

OOD Average-group accuracy (%)

Epochs of

best ID

accuracy

Epochs of

best OOD

accuracy

97

98

99

100

ID accuracy (%)

60

64

68

72

OOD Worst-group accuracy (%)

Epochs of

best ID

accuracy

Epochs of

best OOD

accuracy

C Theoretical analysis

We present a minimal case of a trade-off between ID and OOD performance to aid understanding its cause and show it can occur even in a simple linear setting. Let y ∈ R be the target variable predicted by the model and x the features used as input. Without loss of generality, we consider a regression setting for mathematical convenience, though the results are valid for classification as well. The purpose of this analysis is to investigate theoretically how variations in certain input features correspond to changes in risk (i.e. expected loss) on OOD data. We consider the input features to be a concatenation of invariant and spurious elements: x =[ x inv ; x spu ] with x inv ∈ R d inv and x spu ∈ R d spu . Following [4, 34, 61], we consider the simple data-generating process defined by the following structural equations: y e := γ ⊤ x e inv + ϵ inv , and x e spu := y e 1 s + α e ◦ ϵ spu where e ∈ { e ID , e OOD } is an environment index referring to ID or OOD data, 1 s is a vector of ones and ◦ denotes the element-wise product. The random variables ϵ inv and ϵ spu represent symmetric independent random noise with zero-mean, sub-Gaussian tail probabilities such that Var( ϵ inv ) > 0 , Var( ϵ spu ,i ) > 0 , ∀ i ∈ [1 , d spu ] . The vector γ ∈ R d inv determines the linear relation between the target variable and the invariant features, which is identical across environments. In contrast, the vector α e acts on the spurious features and is environment-specific. Invariant features are similarly predictive on ID and OOD data while spurious ones are not.

Let us now study the relationship between ID and OOD performance of a predictive model that relies on a subset Φ of the features x (not that the subset could be spurious or invariant). This subset is represented with a binary mask Φ ∈{ 0 , 1 } d inv + d spu . Suppose we have selected ˆ d inv invariant features and ˆ d spu spurious features, with ( ˆ d inv + ˆ d spu ) = ˆ d = || Φ ˆ d || 1 the number of selected features.We denote the selected features by Φ ˆ d with [ x inv , 1 , ..., x inv , ˆ d inv , x spu , 1 , ..., x spu , ˆ d spu ] . To investigate the changes in model performance, we consider a simple linear regression model. This enables us to theoretically measure the sensitivity of predictions when additional spurious features are added without complications from non-linearities. We denote with E ID and E OOD the in- and outof-domain expectation, and with β the optimal parameters of the linear regression for a certain domain, i.e. β ˆ d = E [Φ ˆ d ( x ) ⊤ Φ ˆ d ( x )] E [Φ ˆ d ( x ) ⊤ y ] . The MSE loss of the fitted linear regressor is then E [ y -Φ ˆ d ( x ) ⊤ β ˆ d ] 2 . Given the feature mask Φ ˆ d , we denote with L ID (Φ ˆ d ) and L OOD (Φ ˆ d ) the risk of the model on the in and out-of-domain distribution, respectively. Theorem 1 below (see complete form including assumptions and proof in Appendix D) examines how the ID and OOD risks of the model vary as additional spurious features are included into Φ ˆ d to obtain Φ ˆ d +1 .

Theorem 1. Under Assumption 1 and sufficient changes in α , including an additional spurious feature leads to:

Theorem 1 shows that adding a spurious feature to those used by the model can affect its ID and OOD losses in opposite directions, implying a trade-off between ID and OOD accuracy. In other words, this minimal case shows that a simple model without/with an extra (spurious) feature can exhibit an inverse correlation between its ID and OOD performance.

D Proof of Theorem 1

Theorem 1. Including an additional spurious feature leads to the following change in the risks:

with Q 1 , Q 2 , Q 3 defined as:

Further, if the new feature is sufficiently unstable in the test domain, i.e. if (( α ID ˆ d +1 ) 2 -( α OOD ˆ d +1 ) 2 ) 2 is sufficiently large such that:

then we have Q 3 > | Q 1 + Q 2 | and therefore L OOD (Φ ˆ d +1 ) -L OOD (Φ ˆ d ) > 0 .

Let x ˆ d := Φ ˆ d ( m x )[ x inv , 1 , ..., x inv , ˆ d inv , x spu , 1 , ..., x spu , ˆ d spu ] be the ˆ d features already selected, x ˆ d +1 := Φ ˆ d +1 ( m x ) the features after adding a new spurious feature x spu , ˆ d spu +1 to x ˆ d , [ λ ˆ d 1 , λ ˆ d 2 , ..., λ ˆ d ˆ d ] the eigenvalues of E [ x ⊤ ˆ d x ˆ d ] and [ v ˆ d 1 , v ˆ d 2 , ..., v ˆ d ˆ d ] the corresponding eigenvectors.

Assumption 1. The projection of E [ x ⊺ ˆ d v ˆ d i ] on each basis corresponding to feature is non zero, i.e. ∣ ∣ E e [ x ⊺ ˆ d v ˆ d i ] ∣ ∣ > 0 , ∀ e ∈{ e ID , e OOD } , i ∈ [ d ] .

This ensures that coefficients of a feature can not be always 0 , otherwise we can simply remove it.

Proof. Let β ID and β OOD denote the solution of linear regression in the ID and OOD domains, i.e.,

Now let us compare the OOD loss after we include x spu , ˆ d spu +1 . In practice, we can only obtain β ID and then apply it on both the ID and OOD domains, which elicits the following errors:

It is well known that the residual of the linear fitting y by x ˆ d on the ID domain is

Similarly, we have

Since x spu , ˆ d spu+1 does not lies in the space spaned by x ˆ d , so the space spanned by x ˆ d +1 is strictly larger than x ˆ d .

Together with Assumption 1, we have

and also

By the proof in Appendix B.6.3 (above Eq. 29) in [61], we have

By Eq. (20) in [61], we have

So we have:

From Eq. 10 and 12, we have the desired result.

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis work performs an empirical study on the correlation between ID and OOD performances of models in vision and NLP. While some previous work claimed that there is usually a positive correlation between ID and OOD, this work argues that there are real datasets on which ID and OOD are negatively correlated, so ID should not be used as a proxy for OOD. The study was originally mainly done on Camelyon17, and this work also includes other datasets in Section 5, as well as similar observations in other papers. Section 6 provides a toy example where there is a trade-off between ID and OOD. Section 7 shows that the positive correlation occurs mostly in cases where the shift is mild, and with a larger shift the correlation could turn into a negative one. Section 8 points out several fallacies in previous work, including suggesting using the ID performance as a single metric, incorrect evaluation methodologies, etc.\n\nSTRENGTHS:\n- As someone very familiar with this area, I am well aware of the \"accuracy-on-the-line\" folklore that ID and OOD are positively correlated, and it has been reported in a lot of previous work. So to me, this submission is a breath of fresh air. A lot of work on OOD draws conclusions based on pure empirical observations. This is understandable because the OOD problem is an ill-posed problem by nature. However, the caveat is that lots of follow-up work takes these conclusions for granted, proposes new methods based on them, and claims to achieve \"state of the art\" while their evaluation is usually flawed. Such an unscientific methodology has haunted the OOD community for quite a long time, and I believe that this work conveys a strong message that this needs to be changed.\n- This work is very clean and well written. The main argument of this work is by no means novel. In fact, in Section 5.1 the authors list previous papers that made similar arguments. Nevertheless, to my knowledge, this work is the first to convey this important message in such a clean way, and I believe that it can influence the perception and methodology of many researchers in the community.\n\nWEAKNESSES:\n- Section 6 is not very useful, and in my opinion, could be replaced with more experiments. It is very easy to construct a toy example where ID and OOD are negatively correlated. For example, if ID is a binary classification task, and OOD simply flips the labels, then of course they are negatively correlated. The reason why this \"accuracy-on-the-line\" has been there for so long is not because it is theoretically correct, but because it has been observed in many reports by different people. Everyone sufficiently familiar with OOD knows that there is no theoretical correlation between ID and OOD. I think this paper should be posed as a large-scale empirical study that shows that the correlation between ID and OOD on real datasets can be anything, so Section 6 is unnecessary.\n- Section 5 is too short and the experimental results are not well presented. I suggest the authors remove Section 6 and put more experimental results in Section 5.\n\nQUESTIONS:\n- In Section 7, it is demonstrated that when the distribution shift is mild, the correlation between ID and OOD is usually positive. Are there any real datasets where the shift is mild but there is still a negative correlation between ID and OOD? In many real applications, it is safe to assume that the shift from train to test is mild. And if under this assumption ID and OOD is usually positively correlated, then one could argue that ID could still be used as a proxy for these applications. Note that I am not asking whether it is *possible* for there to be a negative correlation - It is easy to construct such a toy example. I am asking whether the correlation is always observed to be positive on real datasets with mild shift.\n\n**Post rebuttal note:** I have read the rebuttal and had a discussion with the authors. I prefer to keep my score and vote for accepting this submission.\n\nLIMITATIONS:\nLimitations are discussed in Appendix A.", "TITLE": "Official Review", "RECOMMENDATION": 8, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-06-27"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe manuscript observe a phenomenon that ID and OOD performance can be inversely correlated because spurious correlations under the partially informative invariant feature (PIIF) assumption. The authors analyze the reasons of this missing phenomenon in previous studies, and conduct dataset-wise and shift-wise experiments. The paper provide a theoretical analysis and an OOD experiment guidance.\n\nSTRENGTHS:\n- The introduction of the ID/OOD inverse correlation is reasonable and easy-to-follow.\n- The experiments are comprehensive.\n- Theoretical analysis is equipped to provide insights.\n- (Update) The empirical results coherently reflect previous theoretical findings, which is worth spreading in the OOD community.\n\nWEAKNESSES:\n~~The most obvious weakness of this paper is that the analyses are mostly experiment-centric, which leads to farraginous explanations and insights. This organization makes readers hard to follow the logics and insights of this paper. The authors may strive to highlight the inverse correlation is \"surprising\" instead of trying to explain this phenomenon more natural and intuitive.~~\n\nThe overall idea can be clearer and more insightful if the authors use causality as the backbone. For example, according to section 6, the observed phenomenon is **natural** with the structural causal model analysis under the partially informative invariant feature (PIIF) assumption.\n\nOther weaknesses:\n- Line 193: The structural causal equation definition is not formal. Use \":=\" instead of \"=\".\n- Line 102: Link is not valid.\n\n~~Although I lean to accept, I'm not sure if this version of paper is enough beneficial for the research community.~~\n\nThe authors should revise their paper according to their proposal in the discussion period.\n\nQUESTIONS:\nI suggest extending section 6 and reorganizing the paper based on it.\n\nLIMITATIONS:\nNo limitations, broader impacts, and licenses included.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2023-07-03"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper presents an empirical examination of ID vs. OOD performance on several real-world datasets showing inverse correlation patterns can indeed arise in many datasets and experimental settings. This conflicts with past papers mainly observing a positive dependence structure. The paper further discusses why past studies missed such patterns and theoretically analyzes how inverse correlation patterns can arise.\n\nSTRENGTHS:\n- The paper highlights and important OOD generalization misconception, namely that increased model performance on in-distribution data is enough to achieve good OOD generalization. As the paper points out, it should be self-evident that this should not hold in general. Still, many works suggest that improving ID generalization helps OOD generalization. Model diversity seems to be a key factor that previous studies failed to account for. This is ensured via a training dynamics argument by examining model performance during a training run. I find this treatment convincing.\n- The provided experimental evidence shows that inverse correlations are possible under starker distribution shifts and that previous results on positive correlations were mainly obtained by a restrictive experimental setting. It makes sense that an inverse trend should arise at some point under misspecification.\n- The paper points out specific cases where the positive ID-OOD generalization insight has been observed but also where a negative relationship has been observed. This paper still seems to add value as in contextualizes all of these occurrences while explaining why a positive dependence structure might have appeared.\n- I also like that the paper contains a theoretical section showing that an inverse correlation is expected under a spurious feature. At the same time, I am not sure it adds that much value as it mainly relies on a formalization of the effect of spurious correlations which have been previously theoretically analyzed in the domain generalization literature.\n\nWEAKNESSES:\n- Although the paper does provide meaningful value in analyzing the ID-OOD tradeoff, the paper sometimes mentions this idea as a new insight. I am not sure this is necessarily true. I would make sure not to oversell the \"discovery of inverse ID-OOD tradeoffs\" but not lose focus on explaining how previous papers could have overlooked this possibility (which the paper already does for the most part but not everywhere).\n- I found point 4 in the description of Figure 2 confusing. The difference in the ID axis as compared with panel 2 does not appear to be large. 2 seems to show a more consistent variance while 4 seems to show a growing variance. Would it be appropriate to refer to theses as homoscedastic / heteroscedastic noise models, respectively?\n- Last point in 3.1 (lines 182-183) is missing references; it would be good to back up this claim.\n\n### Post-rebuttal\n\nI have read the author's rebuttal and found that my concerns were adequately addressed. I maintain my positive score.\n\nQUESTIONS:\n- Why was the diversification method not used in the second set of experiments?\n\nLIMITATIONS:\n- Although limitations of the approach are not explicitly discussed, current shortcomings and future work are discussed in section 8 and 9.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-04"}

comments: SUMMARY:
Through extensive experiments, the authors showed that ID and OOD performances can inversely be correlated. The key ingredient is to track the performances throughout the training dynamics, instead of looking only at the end point.

STRENGTHS:
By tracking the training process, instead of the final point, the authors gave a more comprehensive view on the matter. This methodology should be more widely adopted, in my opinion.

WEAKNESSES:
While Theorem 1 demonstrates this diverse performance phenomenon can happen even to simple linear models, how NN does so was not analyzed. I'd like to see the authors analyze a shallow neural net. There could be broader and deeper theoretical insights.

QUESTIONS:
Has the authors conducted an experiment for two or more OOD data performances, for a single set of models trained on an ID data, where the OOD data can arguably be ordered in a way that becomes gradually more OOD to the ID training data? For example, one can train on CIFAR 10, and track its OOD performances on some selected OOD classes from CIFAR 100, and do the same on SVHN as a further away OOD dataset.

I'm interested in the interplay between training dynamics and the more OOD axis.

LIMITATIONS:
N/A
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2023-07-07

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper examines the previously proposed idea that in-distribution (ID) and out-of-distribution (OOD) performance of models are positively correlated. Through various experiments, the authors demonstrate that ID and OOD performance can in fact be inversely correlated. They also discuss how the previous work have missed this observation due to selection bias, and criticize the conclusions made by them. Moreover, a theoretical analysis on the linear case supplements the empirical findings regarding inverse correlation of ID and OOD performance.\n\nSTRENGTHS:\nDisclaimer: The paper is merely experimental as it is evident from its title. Before reading this report, I have not seen such activity in the OOD generalization literature; Note that benchmarks such as DomainBed [1] are fundamentally different as they do not provide suggestions for OOD generalization based on mere experiments. To understand OOD generalization, I believe the theoretical analysis must be the foundation, and ideally the results need to be backed with experiments. However, similar work have been approved in the literature; for example Wenzel et al. [2] which has motivated the empirical study of ID and OOD performance was published in NeurIPS 2022 despite making the false claims that are elaborated in this work. Therefore, I see the relevance and necessity of a rebuttal such as this work to correct the mistakes made by the previous work, and complement the existing literature. Only for this reason, I value the efforts made by the authors, and I recommend accepting the paper.\n\n- The paper addresses important shortcomings of the previous work in methods and evaluation. \n\n- The paper is well-written, and easy to understand for the audience who might be unfamiliar with the literature. The Reviewers’ FAQ in the appendix is very helpful.\n\n- The empirical evaluation is comprehensive.\n\n[1]  I. Gulrajani and D. Lopez-Paz, “In search of lost domain generalization,” 2020, arXiv:2007.01434.\n\n[2] Florian Wenzel, Andrea Dittadi, Peter Vincent Gehler, Carl-Johann Simon-Gabriel, Max Horn, Dominik Zietlow, David Kernert, Chris Russell, Thomas Brox, Bernt Schiele, et al. Assaying out-of-distribution generalization in transfer learning. arXiv preprint arXiv:2207.09239, 2022.\n\nWEAKNESSES:\n- The premise of section 6 is to explain the inverse correlation witnessed by the experiments on the real-world datasets. To this end, the authors chose a linear model, and proved (Theorem 1) that adding a spurious feature decreases the OOD performance while it boosts the ID performance. It is unclear how this result corresponds to learning diverse models (section 3). In other words, how do the models learned in the experiments are related to adding a spurious feature to the feature set of a regression model? Such correspondence is necessary for section 6 to be part of a cohesive report. \n\n- The work is missing experiments on synthetic data to connect its theory and the real-world experiments. It would have been ideal if the authors used the same experimental method to sample from ID/OOD performance of models fitted to the data generated by the linear model described in section 6. Ideally, the plots in Figure 7 must be reproducible with the toy model and synthetic data for different instantiations of the linear model.\n\nQUESTIONS:\n- To confidently recommend acceptance of this paper, I need to see the relevance of the theoretical analysis (section 6) to the experiments. In the previous section, I elaborated my recommendations to make this connection happen, and I am asking the authors to address my concern.\n\n- Is there a solid conclusion/suggestion made by the paper apart from the presence of inverse correlations between ID and OOD performance? Apparently, the paper suggests that contrary to the conclusions made by previous work, ID performance can be irrelevant to OOD performance, however, the authors do not provide an alternative guideline for practitioners to make claims about OOD performance. Such discussion would be very helpful for the audience.\n\nLIMITATIONS:\nMentioned in the previous parts.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-26"}