Distribution Shift Is Key to Learning Invariant Prediction
Hong Zheng, Fei Teng
TL;DR
This paper investigates why ERM can outperform specialized out-of-distribution methods when training data exhibit distribution shift across domains. By combining analytical bounds with a Gaussian-deductive example, it shows that the degree of shift, quantified via KL divergence, can drive learned models toward invariant predictors, especially under causality-related data assumptions. Theoretical results (Theorems 1–2) bound cross-environment misalignment under KL-bounded and Massart-noisy conditions, and corollaries indicate that sufficiently large shift enables ERM to approximate invariant prediction. Empirically, synthetic and CMNIST experiments demonstrate that more domains and greater distribution shift yield predictions closer to ground-truth or oracle invariant models, with counterfactual analyses revealing reduced reliance on non-causal features; these findings highlight distribution shift as a key determinant of robust cross-domain generalization.
Abstract
An interesting phenomenon arises: Empirical Risk Minimization (ERM) sometimes outperforms methods specifically designed for out-of-distribution tasks. This motivates an investigation into the reasons behind such behavior beyond algorithmic design. In this study, we find that one such reason lies in the distribution shift across training domains. A large degree of distribution shift can lead to better performance even under ERM. Specifically, we derive several theoretical and empirical findings demonstrating that distribution shift plays a crucial role in model learning and benefits learning invariant prediction. Firstly, the proposed upper bounds indicate that the degree of distribution shift directly affects the prediction ability of the learned models. If it is large, the models' ability can increase, approximating invariant prediction models that make stable predictions under arbitrary known or unseen domains; and vice versa. We also prove that, under certain data conditions, ERM solutions can achieve performance comparable to that of invariant prediction models. Secondly, the empirical validation results demonstrated that the predictions of learned models approximate those of Oracle or Optimal models, provided that the degree of distribution shift in the training data increases.
