Probable Domain Generalization via Quantile Risk Minimization

Cian Eastwood, Alexander Robey, Shashank Singh, Julius von Kügelgen, Hamed Hassani, George J. Pappas, Bernhard Schölkopf

TL;DR

Standard domain generalization (DG) methods often optimize for average performance, which lacks robustness, or the absolute worst case, which is overly conservative. This paper introduces Quantile Risk Minimization (QRM), a probabilistic framework that learns predictors guaranteed to perform well with a user-defined high probability $\alpha$, effectively bridging the gap between fragile average-case and pessimistic worst-case models.

What Problem Does This Paper Address?

Machine learning models frequently "fail calamitously" when they encounter out-of-distribution (OOD) data. Domain Generalization (DG) tries to fix this by using data from multiple training "domains" (e.g., different hospital sites or camera trap locations) to learn a model that works on unseen test domains.

Traditionally, DG is framed in two ways:

  1. Average-case (ERM): Optimizes for the mean performance across domains. This often fails because the model relies on spurious correlations that don't hold in the tail of the distribution.
  2. Worst-case (DRO): Optimizes for the single worst possible domain. This is often too conservative, leading to poor performance everywhere else, and is theoretically impossible to solve without strict assumptions on how domains can vary.

The authors argue that DG is actually a probabilistic problem. We should use the distribution shifts seen during training to estimate the probability of shifts at test time.

Methods

The authors propose Quantile Risk Minimization (QRM). Instead of the mean or the max, QRM minimizes the $\alpha$-quantile of the predictor's risk distribution. If you set $\alpha=0.9$, you are essentially saying, "I want the best possible performance that holds for 90% of potential domains."

To make this work in practice, they introduce the Empirical QRM (EQRM) algorithm:

  • Risk Distribution Estimation: Since we only have a finite number of training domains, EQRM uses Kernel Density Estimation (KDE) to smooth the empirical risks.
  • Risk Extrapolation: A key feature of KDE-smoothing is that it creates a "right tail" in the risk distribution (see Figure 2 below). This allows the algorithm to account for risks higher than those actually observed during training, which is critical for finding truly invariant, causal features.
  • Causal Link: The authors provide a theoretical proof that as $\alpha \to 1$, EQRM recovers the causal predictor—the model that relies only on stable, invariant relationships.
Figure 2: Risk CDFs.

Datasets

The authors evaluated EQRM across a diverse set of benchmarks:

  • Synthetic Linear Regression: A toy task designed to test the recovery of causal vs. effect features.
  • ColoredMNIST (CMNIST): A classic DG benchmark where color is a highly predictive but spurious correlation.
  • WILDS: Large-scale, real-world datasets including iWildCam (animal classification across camera traps) and OGB-MolPCBA (molecular property prediction).
  • DomainBed: A suite of standard DG datasets including VLCS, PACS, OfficeHome, TerraIncognita, and DomainNet.

Key Insights and Ideas

  • $\alpha$ as a "Conservativeness" Dial: QRM provides an interpretable hyperparameter. $\alpha=0.5$ (median) is close to average-case, while $\alpha \to 1$ approaches worst-case robustness.
  • The Power of Smoothing: The transition from a discrete set of training risks to a continuous KDE-smoothed distribution is what "unlocks" the ability to generalize. It forces the optimizer to consider the possibility of worse domains than the ones it has seen.
  • Holistic Evaluation: The paper argues that we shouldn't just look at mean accuracy. They propose a quantile-focused evaluation protocol, looking at the entire "risk-robustness curve" (the CDF of risks across test domains).
Figure 3: EQRM on a toy linear regression dataset (A–D) and on ColoredMNIST (E–F). A: Test risk at different quantiles or degrees of “OODness”. For each quantile (x-axis), the corresponding α has the lowest risk (y-axis). B: Estimated risk distributions (corresponding CDFs in Appendix G.1.1). C: Regression coefficients approach those of the causal predictor (βcause =1, βeffect =0) as α→1. D: Q-Q plot comparing the “true” risk quantiles (estimated with m=1000) against estimated ones (m<1000), for α=0.9. E: Performance of different α’s over increasingly OOD test domains, with dots showing training-domain accuracies. F: KDE-estimated accuracy-CDFs depicting accuracy-robustness curves. Larger α’s make lower accuracies less likely.

Key Results

  • Superior Tail Performance: On the iWildCam dataset, EQRM significantly reduced risks in the 90th and 99th percentiles compared to standard ERM and IRM.
  • Massive Worst-Case Improvement: On OGB-MolPCBA, EQRM reduced the worst-case test-domain risk by more than a factor of two compared to ERM.
  • Causal Recovery: In synthetic tests, the model successfully ignored "effect" features and focused on "causal" features as $\alpha$ increased, confirming the theoretical link between quantile minimization and causality.
  • Competitive Baselines: EQRM matched or outperformed state-of-the-art methods (like IRM and VREx) on ColoredMNIST, especially when combined with ERM pre-training.

Limitations and Future Work

  • Domain Sample Size: For $\alpha$ to accurately represent the probability of generalization, the training domains must be i.i.d. samples from the underlying meta-distribution. In practice, we often have few domains, which makes the interpretation of $\alpha$ less precise.
  • I.I.D. Assumption: The current framework assumes domains are independent. Real-world shifts often have dependencies (like time or geography). The authors suggest that future work could relax this by leveraging knowledge of domain dependencies.
  • Computational Cost: KDE-based optimization can be more sensitive to learning rates and may require more careful tuning than standard ERM.

Summary updated

BibTeX
@inproceedings{eastwood2022probable,
  author = {Cian Eastwood and Alexander Robey and Shashank Singh and Julius von Kügelgen and Hamed Hassani and George J. Pappas and Bernhard Schölkopf},
  title = {{Probable Domain Generalization via Quantile Risk Minimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=4gkNscaiHC},
}
Figure