Unraveling the Key Components of OOD Generalization via Diversification

Harold Benoit, Liangze Jiang, Andrei Atanov, Oguzhan Fatih Kar, Mattia Rigotti, Amir Zamir

Abstract

Supervised learning datasets may contain multiple cues that explain the training set equally well, i.e., learning any of them would lead to the correct predictions on the training data. However, many of them can be spurious, i.e., lose their predictive power under a distribution shift and consequently fail to generalize to out-of-distribution (OOD) data. Recently developed "diversification" methods approach this problem by finding multiple diverse hypotheses that rely on different features. This paper aims to study this class of methods and identify the key components contributing to their OOD generalization abilities. We show that (1) diversification methods are highly sensitive to the distribution of the unlabeled data used for diversification and can underperform significantly when away from a method-specific sweet spot. (2) Diversification alone is insufficient for OOD generalization. The choice of the used learning algorithm, e.g., the model's architecture and pretraining, is crucial. In standard experiments, using the second-best choice leads to an up to 20% absolute drop in accuracy. (3) The optimal choice of learning algorithm depends on the unlabeled data and vice versa. (4) Finally, we show that, in practice, the above pitfalls cannot be alleviated by increasing the number of diverse hypotheses. These findings provide a clearer understanding of the critical design factors influencing the OOD generalization abilities of diversification methods.

Introduction

Machine learning models often achieve high accuracy on training data by latching onto spurious correlations—features that are predictive in the training set but do not represent the true causal relationship. For instance, a model might identify a "husky" based on a snowy background rather than the animal's features. When such models are deployed in environments where these correlations break (e.g., a husky on grass), they fail to generalize.

To combat this, "diversification" methods have emerged. These methods, such as DivDis and D-BAT, aim to discover a set of diverse hypotheses that all explain the training data but utilize different features. The hope is that by exploring the space of possible explanations, at least one hypothesis will capture the invariant, non-spurious features necessary for OOD generalization.

The Diversification Framework

The paper examines two primary diversification strategies:

  1. DivDis: Learns multiple hypotheses simultaneously by maximizing the mutual information between their predictions on unlabeled data.
  2. D-BAT: Learns hypotheses sequentially, where each new hypothesis is trained to minimize agreement with previously learned ones on unlabeled data.

To rigorously evaluate these, the authors introduce DivDis-Seq, a sequential variant of DivDis, and test them across various "spurious ratios" ($r_{D_u}$)—the degree of correlation between spurious features and labels in the unlabeled dataset.

Sensitivity to Unlabeled Data Distribution

A core finding of this research is that diversification methods are not robust to variations in the unlabeled data distribution. Each method has a specific "sweet spot" where it performs optimally.

Visualization of learned hypotheses across different spurious ratios ($r_{D_u}$) in unlabeled data.

As shown in Figure 5, the learned hypotheses ($h_2^{DB}$ and $h_2^{DD}$) shift significantly as the spurious ratio $r_{D_u}$ changes. D-BAT tends to perform best when the unlabeled data is "inversely correlated" (spurious features point to the wrong label), while DivDis prefers "balanced" unlabeled data. Moving away from these method-specific sweet spots can cause an absolute accuracy drop of up to 30%.

The Myth of More Hypotheses

One might assume that the sensitivity to data distribution could be mitigated by simply increasing the number of hypotheses ($K$). If we find enough diverse models, surely one will be correct?

Test accuracy on balanced data vs. spurious ratio on unlabeled data for different diversification methods and number of hypotheses.

However, empirical results in Figure 6 debunk this. Increasing $K$ from 2 to 4 does not significantly improve performance or broaden the "sweet spot" for any of the methods. In some instances, such as with DivDis, adding more hypotheses can even degrade performance. This suggests that the fundamental limitations of the diversification loss and the data distribution cannot be overcome by sheer volume of hypotheses.

The Crucial Role of Inductive Bias

Diversification is not a substitute for a well-chosen learning algorithm. The paper demonstrates that the choice of architecture and pretraining (the inductive bias) is just as critical as the diversification strategy itself. In experiments on the Waterbirds and Office-Home datasets, using a "second-best" architecture choice resulted in an absolute accuracy drop of up to 20%.

Interestingly, standard performance metrics like ImageNet accuracy are poor predictors of success in diversification. Models that excel on ImageNet, such as ViT-MAE, often underperform in these tasks, suggesting that the inductive biases required for OOD generalization are distinct from those that drive standard benchmark performance. Furthermore, there is a deep co-dependency: the "best" architecture for a task depends on the specific distribution of the unlabeled data available. This implies that practitioners cannot treat diversification as a "plug-and-play" component; it requires careful, manual alignment between the data distribution and the model's inherent biases.

Conclusion

Diversification methods offer a promising path toward OOD generalization, but they are not a panacea. Their success is tightly coupled with the distribution of unlabeled data and the inductive biases of the underlying learning algorithm. Future research should focus on "disambiguation"—the challenge of selecting the correct hypothesis from a diverse set without relying on labeled OOD data—and on developing methods that are more robust to variations in unlabeled data distributions.

Summary updated

BibTeX
@inproceedings{benoit2024unraveling,
  author = {Harold Benoit and Liangze Jiang and Andrei Atanov and Oguzhan Fatih Kar and Mattia Rigotti and Amir Zamir},
  title = {{Unraveling the Key Components of OOD Generalization via Diversification}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=Lvf7GnaLru},
}
Figure