Robust Invariant Representation Learning by Distribution Extrapolation

Kotaro Yoshida, Konstantinos SlavakisarXiv 2025 · DOI

Introduction

Standard machine learning models typically operate under the i.i.d. assumption, where training and test data are drawn from the same distribution. In real-world scenarios, this assumption frequently fails, leading models to rely on "spurious features"—correlations that exist in the training set but do not generalize to new environments. This paper introduces a robust framework for learning invariant features by applying distributional extrapolation to the Invariant Risk Minimization (IRM) framework. By synthesizing "pseudo-unseen" environments during training, the proposed methods prevent models from overfitting to training-specific quirks and significantly improve performance on out-of-distribution (OOD) tasks.

The Challenge of Invariant Risk Minimization

Invariant Risk Minimization (IRM) was developed to identify features that maintain a consistent relationship with the label across different environments. However, the practical implementation, IRMv1, is notoriously sensitive. In cases where training environments lack sufficient diversity or the model is over-parameterized, the IRM penalty can be minimized without the model actually learning the underlying causal structure. Essentially, the model "cheats" by satisfying the mathematical conditions of invariance through spurious means.

Proposed Methodology

The authors propose a framework that extrapolates beyond the provided training environments to enforce a stricter form of invariance.

1. Linearizing the Penalty

The original IRMv1 penalty is non-linear, complicating its integration into broader optimization frameworks. The authors introduce a new loss function, $J_{IRM,e}$, which computes the squared norm of the gradient before taking the expectation. This linearization makes the penalty additive and easier to manipulate mathematically across distributions.

2. Distributional Extrapolation

Drawing inspiration from Risk Extrapolation (REx), the authors use affine combinations of environment losses—including negative coefficients—to simulate distributions that lie outside the span of the training data. This "stretches" the environmental diversity available to the model.

3. New Variants: mm-IRMv1 and v-IRMv1

  • mm-IRMv1 (Min-Max): This variant searches for the "worst-case" extrapolated environment and minimizes the penalty there, forcing the model to remain invariant even in extreme synthetic scenarios.
  • v-IRMv1 (Variance-based): This version adds a penalty based on the variance of the IRM penalties across environments, serving as a stable regularizer.

Experimental Evaluation

The methods were evaluated on both synthetic and real-world benchmarks:

  • Structural Equation Models (SEMs): Synthetic tasks with known ground-truth causal relationships to measure "causal error."
  • Vision Benchmarks: Colored MNIST (CMNIST), Colored FashionMNIST (CFMNIST), PACS (Photo, Art, Cartoon, Sketch), and VLCS (Viggo, LabelMe, Caltech, Sun).

Results and Key Insights

Causal Accuracy and Robustness

In synthetic SEM tests, the extrapolation methods demonstrated superior ability to recover causal structures. Specifically, mm-IRMv1 reduced causal error by up to 72% compared to standard IRMv1 when training environments were highly similar.

Causal and non-causal error comparison on synthetic SEM tasks showing significant error reduction for the proposed methods.

Performance on Vision Benchmarks

On complex vision datasets, the proposed variants consistently outperformed IRMv1 and other state-of-the-art methods like Bayesian IRM (BIRM). For instance, v-IRMv1 achieved a 1.6% average accuracy boost over the base IRMv1 across all benchmarks.

Performance comparison across vision benchmarks (CMNIST, CFMNIST, PACS, VLCS) highlighting the improvements of 'v' and 'mm' variants.

Key Takeaways

  • The Majorization Trick: The authors prove that their linearized loss ($J_{IRM,e}$) acts as an upper bound to the original IRMv1 penalty. Minimizing this bound provides a stronger guarantee of true invariance.
  • Extrapolation as Diversity: Mathematical extrapolation can serve as a proxy for physical environmental diversity, allowing IRM to function correctly even with limited training environments.
  • Better Calibration: The proposed methods produced better-calibrated models, mitigating the overconfidence often seen in standard IRMv1 predictions.

Discussion and Future Work

While effective, the methods face some challenges. The mm-IRMv1 variant can exhibit numerical instability in high-dimensional settings like ResNet-18 due to the non-smooth nature of the min-max optimization landscape. Additionally, the framework introduces new hyperparameters ($\alpha_{min}$ and $\gamma$) that currently require computational grid searches. Future research may focus on adaptive methods for choosing extrapolation coefficients to stabilize training and reduce hyperparameter sensitivity.

Summary updated

BibTeX
@misc{yoshida2025robust,
  author = {Kotaro Yoshida and Konstantinos Slavakis},
  title = {{Robust Invariant Representation Learning by Distribution Extrapolation}},
  year = {2025},
  eprint = {2505.16126},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.16126},
}
Figure