Introduction
Invariant Risk Minimization (IRM) has emerged as a powerful paradigm for learning features that are stable across different environments, aiming to avoid "spurious correlations"—patterns that hold in training data but fail in the real world. However, IRM often struggles when the underlying relationship between features and labels changes across environments, a phenomenon known as concept drift.
This paper introduces Partial Invariance (P-IRM), a framework that relaxes the strict global invariance constraint of IRM. By allowing models to learn features that are stable within specific partitions of training data, P-IRM achieves better generalization in dynamic real-world scenarios such as evolving language or temporal shifts.
The Challenge of Concept Drift
Standard IRM assumes the existence of a set of features that is perfectly invariant and sufficient for optimal prediction across all environments. In practice, this assumption is often violated. For instance, in natural language processing, the connotation of a slang term might shift over a decade. In such cases, IRM becomes "over-constrained": it discards useful, predictive features simply because they are not perfectly stable across every single training environment. This leads to sub-optimal performance as the model throws away informative but "locally stable" signals.
Methodology: Partial Invariance
The authors propose Partial Invariance (P-IRM) to address this over-constraint. Instead of demanding global invariance across all training environments, P-IRM identifies features that are invariant within a specific partition (a subset) of environments most relevant to the target task.
Two practical implementations are introduced:
- P-IRM (Partitioning): The model is trained exclusively on a subset of environments that are "close" to each other, determined by meta-information.
- P-IRM (Conditioning): The model utilizes data from all environments to learn a representation, but the invariance penalty—the mathematical constraint forcing stability—is only applied to a specific subset. This approach maintains data efficiency while relaxing the rigidity of the invariance constraint.
The success of P-IRM relies on meta-information (e.g., timestamps, domain tags) to calculate distances between environments, facilitating the selection of appropriate partitions.
Experimental Evaluation
The authors evaluated P-IRM across regression, image classification, and natural language processing tasks.
Linear Regression: House Price Prediction
Using a Kaggle dataset where environments were defined by the year a house was built (1910–2010), P-IRM demonstrated superior robustness. As shown in Table 1, P-IRM (partitioned) achieved a Worst Group MSE of 0.873, significantly outperforming standard IRM (1.129) and ERM (1.037).
Image Classification: MetaShift
On the MetaShift dataset, which involves images tagged with varying contexts (e.g., "cat on a rug" vs. "cat on a chair"), P-IRM consistently outperformed IRM in domain generalization. At a distribution distance of $d=0.17$, P-IRM reached 96% accuracy, while IRM lagged at 75.7%.
Named Entity Recognition: SciERC
In the SciERC task, identifying scientific terms in papers published between 1980 and 2016, P-IRM (conditioned) achieved an accuracy of 0.812. This surpassed both standard ERM (0.800) and IRM (0.795), highlighting the benefit of local invariance in language tasks where terminology evolves over time.
Key Insights
- Avoiding the Over-Constraint Trap: Theoretical analysis confirms that even slight changes in causal relationships across environments cause standard IRM to discard highly predictive features.
- Local vs. Global Invariance: Shifting the objective to local invariance allows models to retain "locally stable" features, providing a realistic middle ground between the shift-agnostic ERM and the overly rigid IRM.
- The Value of Meta-Information: While finding optimal partitions is computationally difficult, simple metadata like timestamps often serves as an effective "pseudo-metric" for partitioning in practice.
Conclusion and Future Work
P-IRM offers a more flexible approach to invariant learning, though it currently relies on the availability of meta-information for partitioning. Future research should explore general heuristics to automatically identify optimal partitions when such metadata is absent. Additionally, further investigation into the sample complexity required to learn partially invariant features effectively will be crucial for scaling these methods to even more complex, low-data regimes.
Summary updated