A Theoretical Analysis on Independence-driven Importance Weighting for Covariate-shift Generalization

Renzhe Xu, Xingxuan Zhang, Zheyan Shen, Tong Zhang, Peng Cui

TL;DR

This paper provides the first theoretical justification for why "independence-driven" importance weighting (IW) algorithms succeed in out-of-distribution (OOD) generalization. By framing these methods as a feature selection process, the authors prove they can identify a minimal stable variable set—the smallest group of features necessary for optimal performance when the test distribution is unknown.

What Problem Does This Paper Address?

Standard machine learning assumes that training and test data come from the same distribution (the i.i.d. assumption). In reality, models often encounter covariate shift, where the distribution of input features changes (e.g., a self-driving car trained in sunny California encountering snow in Michigan), even if the underlying relationship between features and labels remains the same.

Traditional "Importance Weighting" (IW) fixes this by reweighting training samples to match the test distribution. However, this requires knowing the test distribution in advance, which is rarely possible. Recently, "independence-driven" IW methods (part of the "stable learning" field) have shown they can generalize well without knowing the test distribution by simply reweighting training data to make all features statistically independent. While empirically successful, the theoretical "why" behind this success was missing—until now.

Methods

The authors bridge this gap by explaining independence-driven IW as a feature selection process. Their approach involves three key components:

  1. Defining the Goal: They introduce the minimal stable variable set, which is the smallest subset of features $S$ that captures all the predictive information about the target $Y$ contained in the full feature set $X$ (formally, $E[Y|S] = E[Y|X]$).
  2. The Mechanism: They analyze algorithms like DWR (Deep Weighted Regression) and SRDO (Stable Regression with Density Optimization). These methods learn sample weights that decorrelate features in the training set.
  3. The Proof: The authors prove that if you train a weighted least squares model on these "independent" features, the model will naturally assign zero coefficients to any feature outside the minimal stable set. In other words, the weighting process automatically filters out spurious, unstable correlations.

Datasets

The authors validated their theory using synthetic datasets designed to simulate complex spurious correlations:

  • Feature Construction: They generated features $X = (S, V)$, where $S$ are "stable" (causal) features and $V$ are "variant" (spurious) features.
  • Outcome Generation: The target $Y$ was generated using both non-linear ($Y_{MLP}$) and polynomial ($Y_{poly}$) functions of the stable features $S$.
  • Environment Bias: They created different training environments by intentionally biasing the selection of samples to create strong, but false, correlations between the spurious features $V$ and the target $Y$.

Key Insights and Ideas

  • Generalization as Selection: The core "aha moment" is that OOD generalization is fundamentally a feature selection problem. If a model only uses the "stable" features, its performance won't degrade when "spurious" features shift in the test set.
  • Independence Breaks Spuriousness: Spurious correlations usually rely on specific dependencies between features in the training set. By forcing features to be independent through reweighting, these algorithms "break" the spurious links, leaving only the stable relationships for the model to learn.
  • Optimality: The paper proves that the minimal stable variable set is the unique, optimal subset for generalization under common losses like Mean Squared Error and Binary Cross-Entropy.
  • Beyond Markov Boundaries: While related to the concept of a Markov Boundary, the minimal stable set is more efficient for prediction because it excludes variables that only affect the variance of the target, not its mean.

Key Results

The theoretical findings were backed by strong experimental evidence:

  • Superior Feature Selection: Independence-driven methods (SRDO and DWR) consistently outperformed baselines like XGBoost, Random Forests, and LASSO in identifying the correct stable features, especially as spurious correlations became stronger.
Figure 1. Experimental results on synthetic data (MLP non-linear function YMLP and polynomial function Ypoly from top to bottom). Varying the spurious correlation strength rtr, we compare independence-driven IW algorithms (DWR and SRDO shown in solid lines) with several baselines (shown in dashed lines) on both feature selection (Rank average and F1 score) and covariate-shift generalization (RMSE average and standard deviation) metrics. Independence-driven IW algorithms outperform other methods in the synthetic experiments.
  • Optimal Performance: As shown in Figure 2, the lowest error (RMSE) was achieved exactly when the model selected the 5 stable features identified by the theory, confirming that the "minimal stable set" is indeed the optimal choice for generalization.
Figure 2. The covariate-shift generalization metrics (RMSE aver- age and standard deviation) w.r.t. the number of selected features. Fix rtr = 2.5 here and the feature ranking lists are provided by SRDO. The minimal stable variable set (5 features) achieves the optimal performance.

Limitations and Future Work

  • Multi-class Settings: The current theoretical framework is designed for regression and binary classification. The authors note that extending this to multi-class classification is a non-trivial task for future research.
  • Loss Function Specificity: The definition of the minimal stable set is tied to the conditional mean ($E[Y|X]$). For other loss functions (like $L_1$ loss, which targets the median), the optimal set might differ.
  • Linearity in Analysis: While the data generation can be non-linear, the theoretical analysis focuses on the coefficients of a Weighted Least Squares (linear) regressor. Exploring fully non-linear theoretical models is a promising next step.

Summary updated

BibTeX
@inproceedings{xu2022theoretical,
  author = {Renzhe Xu and Xingxuan Zhang and Zheyan Shen and Tong Zhang and Peng Cui},
  title = {{A Theoretical Analysis on Independence-driven Importance Weighting for Covariate-shift Generalization}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=6r8H0sq1t-7},
}
Figure