Heterogeneous Risk Minimization

Jiashuo Liu, Zheyuan Hu, Peng Cui, Bo Li, Zheyan Shen

Abstract

Machine learning models often fail under distribution shifts because they exploit spurious correlations present in training data. While Invariant Risk Minimization (IRM) addresses this, it typically requires explicit environment labels. We present Heterogeneous Risk Minimization (HRM), a framework that jointly discovers latent heterogeneous environments and learns invariant features. HRM achieves robust out-of-distribution generalization without manual environment partitioning, often outperforming models provided with ground-truth labels.

Introduction

Standard Empirical Risk Minimization (ERM) assumes that training and testing data are independent and identically distributed (IID). However, real-world data often contains "spurious correlations"—features that predict the label in the training set but fail in new environments. For instance, a model might identify cows based on green grass backgrounds rather than the animal itself.

Existing "Invariant Learning" methods like IRM attempt to find features with stable predictive power across different environments. The bottleneck is that these environments must be manually labeled, which is often impossible for large, pooled datasets. HRM solves this "circular dependency": to find invariant features, one needs environments; to find environments, one needs to know which features are variant.

The HRM Framework

The HRM framework consists of two interactive modules that form a positive feedback loop, as illustrated in Figure 1.

The HRM framework architecture showing the interaction between heterogeneity identification ($M_c$) and invariant prediction ($M_p$).
  1. Heterogeneity Identification ($M_c$): This module partitions pooled data into latent environments using a clustering algorithm (Expectation-Maximization). It specifically clusters data based on the relationship between variant features and labels, aiming to maximize diversity across clusters.
  2. Invariant Prediction ($M_p$): This module takes the identified environments and performs feature selection to find a "maximal invariant predictor." It utilizes a variance penalty to ensure the chosen features maintain a stable relationship with the target across all discovered environments.

A critical "Convert" step links these modules: once $M_p$ identifies invariant features ($\Phi$), the remaining features are designated as variant ($\Psi$) and fed back into $M_c$ to refine the environment clusters. This mutual promotion ensures that as clusters become more diverse, the invariant predictor becomes more robust.

Experimental Results

The authors validated HRM across synthetic simulations (Selection Bias and Anti-causal Effect) and real-world datasets, including Car Insurance Prediction, People Income Prediction (Adult dataset), and House Price Prediction.

Comparison of HRM against baselines showing superior accuracy stability as spurious correlation strength varies in testing environments.

As shown in Figure 6, HRM demonstrates remarkable stability. In scenarios with high spurious correlation strength, standard methods like ERM and DRO see their accuracy plummet in testing environments. In contrast, HRM maintains high, stable performance. Notably, in the People Income task, HRM outperformed IRM even though IRM was provided with ground-truth demographic labels. This suggests that HRM's discovered environments are more "theoretically optimal" for enforcing invariance than manual labels.

Key Insights and Limitations

HRM demonstrates that environment labels are often a coarse proxy; latent environments discovered by the model can be more effective at forcing the removal of spurious correlations. Theorem 4.2 in the paper supports this, showing that greater diversity in cluster centers leads to a better invariant predictor.

However, some limitations remain. The current framework operates on raw feature vectors; extending this to deep representation learning (e.g., image pixels) is a primary area for future work. Additionally, while the EM algorithm is effective, formal convergence guarantees for the $M_c$ module are still needed, and the joint optimization process introduces higher computational costs than standard ERM.

Conclusion

Heterogeneous Risk Minimization provides a powerful path forward for robust machine learning in the absence of environment metadata. By automating the discovery of data heterogeneity, HRM enables models to generalize to unseen distributions more effectively than traditional supervised invariant learning methods.

Summary updated

BibTeX
@inproceedings{liu2021heterogeneous,
  author = {Jiashuo Liu and Zheyuan Hu and Peng Cui and Bo Li and Zheyan Shen},
  title = {{Heterogeneous Risk Minimization}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=4pie6J-jQu},
}
Figure