Source-linked AI summary

Towards Out-Of-Distribution Generalization: A Survey

Jiashuo Liu, Zheyan Shen, Yue He, Xingxuan Zhang, Renzhe Xu, Han Yu, Peng Cui

arXiv:2108.13624v2cs.LG

TL;DR

Distribution shifts violate the i.i.d. assumptions underlying conventional supervised learning and can degrade deployed model performance. This paper systematically surveys OOD generalization, formalizes the problem, organizes methods by learning-pipeline position, and reviews their theoretical connections, benchmarks, implications, and future directions.

  • Problem

    OOD generalization addresses learning when test distributions differ from training distributions, a setting in which conventional average-error minimization can perform poorly under shifts.

  • Method

    The survey integrates formal problem definition, methodological review, theoretical connections, benchmark datasets, implications, and future research directions, categorizing methods into three pipeline-based groups.

  • Results

    The survey organizes OOD generalization methods into unsupervised representation learning, supervised model learning, and optimization, and connects representative methods theoretically.

  • Takeaways & Limitations

    The paper provides a comprehensive synthesis of OOD generalization research spanning definitions, methods, evaluation datasets, implications, and future challenges.

  • Takeaways & Limitations

    Causal invariant prediction methods can require sufficiently heterogeneous environments, while broad uncertainty sets in DRO can produce low-confidence decisions.

Abstract

from arXiv · show

Traditional machine learning paradigms are based on the assumption that both training and test data follow the same statistical pattern, which is mathematically referred to as Independent and Identically Distributed ($i.i.d.$). However, in real-world applications, this $i.i.d.$ assumption often fails to hold due to unforeseen distributional shifts, leading to considerable degradation in model performance upon deployment. This observed discrepancy indicates the significance of investigating the Out-of-Distribution (OOD) generalization problem. OOD generalization is an emerging topic of machine learning research that focuses on complex scenarios wherein the distributions of the test data differ from those of the training data. This paper represents the first comprehensive, systematic review of OOD generalization, encompassing a spectrum of aspects from problem definition, methodological development, and evaluation procedures, to the implications and future directions of the field. Our discussion begins with a precise, formal characterization of the OOD generalization problem. Following that, we categorize existing methodologies into three segments: unsupervised representation learning, supervised model learning, and optimization, according to their positions within the overarching learning process. We provide an in-depth discussion on representative methodologies for each category, further elucidating the theoretical links between them. Subsequently, we outline the prevailing benchmark datasets employed in OOD generalization studies. To conclude, we overview the existing body of work in this domain and suggest potential avenues for future research on OOD generalization. A summary of the OOD generalization methodologies surveyed in this paper can be accessed at http://out-of-distribution-generalization.com.

1 Introduction

OOD generalization addresses the gap between strong controlled-condition performance and degraded deployment performance under distribution shifts. The survey formalizes this problem, reviews methodological branches, and organizes evaluation resources and future directions.

  • Distribution shifts can make machine learning errors especially consequential in high-stakes applications such as healthcare and autonomous driving.
  • Classical supervised learning assumes i.i.d. training and test data, but OOD settings violate this assumption and expose weaknesses in standard learning theory.
  • Average training-error minimization can exploit correlations that fail to persist under unfamiliar test distributions, degrading model performance after shifts.
  • OOD research requires formalizing distributional shifts and designing robust algorithms, with causal, invariant, stable, representation, model-learning, and optimization approaches addressing these issues.
  • The survey presents a systematic review spanning formal definitions, methodologies, evaluation, implications, and future directions.
  • Methods are classified into three categories by their position in the learning pipeline, with theoretical connections and benchmark datasets also surveyed.

2 Problem Definition and Categorization of Methods

The paper defines OOD generalization as supervised learning under unknown test distributions that differ from training distributions. It categorizes methods by learning-pipeline position and distinguishes OOD generalization from related research settings.

  • 2.1 Problem Definition: Traditional supervised learning assumes Ptr(X, Y) = Pte(X, Y), enabling empirical risk minimization to target average training loss under shared distributions.
  • 2.1 Problem Definition: OOD generalization concerns deployment settings where Pte(X, Y) ≠ Ptr(X, Y), with shifts arising from temporal, spatial, or sample-selection changes.
  • 2.1 Problem Definition: The survey primarily organizes distribution shifts as covariate shifts in PX or concept shifts in PY |X.
  • 2.2 Categorization of Methods: The learning pipeline separates feature representation, feature-to-label mapping, and optimization objective components.
  • 2.2 Categorization of Methods: The survey groups methods into unsupervised representation learning, supervised model learning, and optimization according to their pipeline positions.
  • 2.3 Discussion on Related Topics: Domain adaptation assumes access to the testing distribution, whereas domain generalization uses heterogeneous training domains to learn models for unseen shifted data.
  • 2.3 Discussion on Related Topics: Federated learning shares OOD generalization’s training-data heterogeneity, while OOD methods use heterogeneity to infer invariant models and federated data span clients.
  • 2.3 Discussion on Related Topics: OOD detection identifies unfamiliar samples, and open set classification recognizes unknown categories; OOD generalization instead evaluates performance under shifts with a shared label space.

3 Unsupervised Representation Learning

Unsupervised representation learning methods seek features that support OOD generalization through domain-agnostic learning, disentanglement, causal structure, or additional information. The survey covers UDG, VAE-based disentanglement, causal representation learning, and evidence that disentanglement’s downstream benefits remain unsettled.

  • 3 Unsupervised Representation Learning: Unsupervised representation learning methods learn domain-agnostic or structured features intended to facilitate OOD generalization.The survey groups these methods into unsupervised domain generalization and disentangled representation learning.
  • 3.1 Unsupervised Domain Generalization: UDG learns generalizable models from unlabeled data and examines how pre-training affects OOD generalization.DARLING reportedly outperforms ImageNet pre-training using significantly less unlabeled data.
  • 3.2 Disentangled Representation Learning: Disentangled representation learning separates distinct informative factors of variation, prioritizing interpretability and sparsity.VAE-based approaches commonly learn disentanglement unsupervised within a single environment.
  • 3.2 Disentangled Representation Learning: β-VAE tunes a bottleneck-capacity and independence trade-off, while FactorVAE adds Total Correlation to encourage independent latent representations.FactorVAE uses an additional discriminator for density-ratio estimation because Total Correlation cannot be computed directly.
  • 3.2 Disentangled Representation Learning: Causal representation methods incorporate causal structures into latent representations, including CausalVAE’s linear SCM and DEAR’s nonlinear SCM prior.CausalVAE can use auxiliary labels of latent causal variables, while DEAR assumes a known causal graph and supervised latent-factor information.
  • 3.2 Disentangled Representation Learning: The downstream advantage of disentangled representations for OOD generalization remains an open research question, and unsupervised disentanglement assumptions have been challenged.The survey notes that further research is needed to establish when disentanglement improves downstream performance.

4 Supervised Model Learning for OOD Generalization

Supervised model-learning methods use labels to design architectures and learning strategies for OOD generalization. The survey organizes this broad literature according to the additional information required.

  • 4 Supervised Model Learning for OOD Generalization: Supervised model-learning methods incorporate labels into end-to-end architectures and learning strategies to improve OOD generalization.The survey further categorizes these methods by their additional information requirements.

4.1 Require Environment Labels

Environment-labeled methods use causal structure, cross-environment invariance, or environment-aware training to improve OOD generalization. The surveyed approaches include ICP, IV and anchor methods, IRM, and maximal invariant prediction, but rely on assumptions whose validity and available heterogeneity vary.

  • Environment-labeled methods: Environment-labeled methods include causal learning, invariant learning, and training strategies that explicitly model differences between environments.Examples include causal-variable prediction, environment-invariant representations, and separate or environment-aware model training.
  • Causal Learning: Causal learning assumes that the relationship between a target and its direct causes remains stable across environments or data-selection biases.This assumption motivates exploiting causal variables for OOD prediction.
  • Causal Learning: Invariant Causal Prediction tests subsets of covariates for cross-environment conditional invariance and intersects the subsets whose invariance hypotheses are not rejected.Under structural-equation and Gaussian-residual assumptions, ICP with a Chow test can discover subsets of true causal variables with controllable probability 1-α.
  • Causal Learning: ICP’s effectiveness depends strongly on heterogeneous environments or perturbations, and can be lost when perturbed subpopulations are insufficient or only one environment is available.The survey also notes that naively estimating environments from data may produce less powerful results.
  • Causal Learning: IV methods address hidden confounders under restrictions on the instrument, while anchor regression relaxes these restrictions by allowing direct effects on the hidden confounder and outcome.Anchor regression also targets moderately perturbed data, for which exact invariance may be overly conservative.
  • Invariant Learning: IRM seeks representations whose conditional target expectations are invariant across training environments, but its guarantees and performance depend on shift patterns and modeling assumptions.The survey reports that IRM can fail to recover optimal invariant predictors, show no clear advantage over ERM under covariate shifts, and extend to latent causal variables in linear settings.

4.2 No Environment Labels

Without explicit environment labels, OOD methods exploit stable relationships, latent heterogeneity, or optimization dynamics to improve generalization across unseen environments. The surveyed approaches include stable learning, heterogeneity-aware learning, and flatness-aware learning, with extensions to deep, graph, language, and detection settings.

  • Stable learning: Stable learning seeks uniformly good predictive performance across all possible environments using data from a single observed environment.
  • Stable learning: Global sample weights reduce confounding bias by balancing each feature treated as a potential treatment against the remaining variables.
  • Stable learning: Stable learning addresses binary-treatment limitations by learning weights that make continuous or categorical treatments independent of confounders.
  • Stable learning: StableNet extends linear stable-learning frameworks to deep models, using Random Fourier Features for nonlinear feature decorrelation and jointly optimizing weights, representations, and predictions.
  • Heterogeneity-aware learning: Heterogeneity-aware methods uncover latent environments and use them to learn invariant predictors when explicit environmental labels are unavailable.
  • Flatness-aware learning: SWAD identifies flat-minimum solutions and has demonstrated strong OOD generalization across five domain-generalization benchmarks.

5 Optimization for OOD Generalization

Optimization-based OOD methods formulate generalization as minimizing worst-case risk over plausible environment or distribution sets. DRO provides theoretical guarantees under set containment, while practical robustness depends on choosing uncertainty sets that are neither too narrow nor excessively broad.

  • Robust optimization methods address OOD generalization through model-agnostic and data-structure-agnostic objectives, primarily using distributionally robust optimization.
  • OOD optimization formulates the objective as worst-case prediction error across all possible environments whose distributions may differ from the training distribution.
  • Distributionally robust optimization: DRO optimizes worst-case error over uncertainty sets constrained by moments, support, f-divergence, or Wasserstein distance.
  • f-Divergence constraints: Under f-divergence constraints, DRO can generalize when the testing distribution lies within the set around the training distribution.
  • Wasserstein distance constraints: Wasserstein-based uncertainty sets are more flexible than f-divergence sets because Wasserstein distance does not require equal distribution supports.
  • Wasserstein distance constraints: Wasserstein DRO can be difficult to optimize, motivating methods with alternative transportation costs, martingale constraints, geometric structure, or low computational cost.
  • Robustness guarantees: DRO OOD guarantees follow when the potential test distribution belongs to the uncertainty set, with finite-sample generalization bounds established for f-divergence and Wasserstein DRO.
  • Practical limitations: Overly broad uncertainty sets can produce low-confidence decisions and may make DRO optimal for the training distribution rather than robust in practice.

6 Theoretical Connections

The survey connects causal learning, distributionally robust optimization, and stable learning through shared goals of resisting distributional shifts and identifying reliable predictors.

  • DRO and Causality: DRO minimizes worst-case error over a predefined distribution set to protect models against potential distributional shifts.
  • DRO and Causality: Causal inference can be reformulated as distributionally robust optimization over do-interventional and shift-interventional distribution sets.Under suitable distribution-set choices, DRO becomes equivalent to causal inference in structural equation models.
  • DRO and Causality: Do-interventions replace selected structural variables with intervention values, inducing a corresponding interventional distribution set.
  • Stable Learning and Causality: Stable learning identifies a minimal stable variable set that is theoretically minimal and optimal for covariate-shift generalization under common loss functions.
  • Stable Learning and Causality: The minimal stable variable set is a subset of the Markov boundary, so stable learning can help discover the boundary despite difficult conditional-independence tests.

7 Evaluation for OOD Generalization

OOD evaluation requires datasets with explicit distribution shifts, spanning controllable synthetic settings and varied real-world benchmarks across modalities. Empirical studies reveal that performance and shift patterns must be assessed carefully rather than assumed from in-distribution behavior.

  • Evaluation Principles: OOD benchmarks must involve distribution shifts to evaluate algorithms’ generalization ability beyond standard in-distribution settings.
  • Synthetic Data: Synthetic datasets provide explainable, controllable shifts, but recent OOD methods can perform poorly even on simple low-dimensional linear problems.
  • Synthetic Data: Synthetic mechanisms separate stable S and unstable V covariates, perturbing P(Y |V ) while keeping P(Y |S) invariant across distributions.
  • Synthetic Data: Confounding, anti-causal mechanisms, and selection bias vary unstable relationships or sampling probabilities to simulate distinct distribution shifts.
  • Real-World Data: Real-world benchmarks cover image, tabular, molecular, language, and code data, including temporal, demographic, spatial, and scaffold shifts.
  • Empirical Findings: Empirical studies report weak real-world image-domain-generalization effects, strong correlations between in-distribution and OOD performance, and 22 specified tabular shift patterns.One benchmark evaluates 20 algorithms across 12 real-world datasets.

8 Implications for fairness and explainability

The survey links OOD generalization to fairness and explainability through environment-specific objectives and causal relationships. These connections frame subgroup robustness and interpretability as related consequences of modeling distributionally stable structure.

  • Fairness: Fairness subgroups defined by sensitive attributes correspond to OOD environments, requiring objectives specified across subgroups or environments.
  • Fairness: Some fair-robust methods treat fairness and robustness as separate objectives, unlike approaches that identify them as the same objective.
  • Fairness: Fairness and robustness methods can use a separable environment variable and DRO-like optimization to achieve robustness to training-distribution perturbations.
  • Explainability: Explanation methods include post hoc feature-importance analyses and model-based simpler hypotheses such as linear regression, LASSO, additive models, and trees.
  • Explainability: The survey states that causal relationships between features and outcomes can support both OOD generalization and explainability, making explainability a side product of causal OOD methods.

9 Conclusion and Future Directions

The survey concludes that OOD generalization is important for machine-learning deployment and organizes its methods, theory, evaluation resources, and future challenges. Open problems include learnability, environment availability, evaluation design, and adaptation to pretrained and large language models.

  • Conclusion: The survey systematically reviews OOD definitions, method branches, theoretical connections, datasets, and potential future challenges.
  • Future Directions: Learnability under distributional shifts remains difficult to define because arbitrary and unknown test distributions cannot be guaranteed to support generalization.
  • Future Directions: Many OOD methods require multiple labeled training environments, but real datasets often merge sources without retaining source labels.This restricts deployment and motivates methods using one environment with latent heterogeneity.
  • Future Directions: OOD evaluation remains challenging because test distributions are different and unknown, affecting both experimental design and model selection.
  • Future Directions: Pretrained and large language models inevitably face distribution shifts between pretraining data and downstream tasks.
Loading 2108.13624v2…