[Paper Review] Empirical or Invariant Risk Minimization? A Sample Complexity Perspective
This paper compares empirical risk minimization (ERM) and invariant risk minimization (IRM) through a sample complexity lens, showing that IRM outperforms ERM in out-of-distribution generalization under confounder or anti-causal shifts—achieving solutions within O(√ε) of the ideal predictor—with sample complexity scaling as O(1/ε²) and polynomially with model complexity. In contrast, ERM remains asymptotically biased in such settings, while both methods perform similarly under covariate shift.
Recently, invariant risk minimization (IRM) was proposed as a promising solution to address out-of-distribution (OOD) generalization. However, it is unclear when IRM should be preferred over the widely-employed empirical risk minimization (ERM) framework. In this work, we analyze both these frameworks from the perspective of sample complexity, thus taking a firm step towards answering this important question. We find that depending on the type of data generation mechanism, the two approaches might have very different finite sample and asymptotic behavior. For example, in the covariate shift setting we see that the two approaches not only arrive at the same asymptotic solution, but also have similar finite sample behavior with no clear winner. For other distribution shifts such as those involving confounders or anti-causal variables, however, the two approaches arrive at different asymptotic solutions where IRM is guaranteed to be close to the desired OOD solutions in the finite sample regime, while ERM is biased even asymptotically. We further investigate how different factors -- the number of environments, complexity of the model, and IRM penalty weight -- impact the sample complexity of IRM in relation to its distance from the OOD solutions
Motivation & Objective
- To resolve the open question of when to prefer IRM over ERM for out-of-distribution generalization.
- To analyze the finite-sample and asymptotic behavior of ERM and IRM under different distribution shift types.
- To quantify the sample complexity of IRM relative to the true invariant predictor in polynomial generative models.
- To identify conditions under which ERM is asymptotically biased, even with infinite data.
- To compare the performance of ERM and IRM across multiple distribution shift mechanisms including covariate shift, confounders, and anti-causal variables.
Proposed method
- Formalizes distribution shifts via an invariance condition: P(Y|Φ*(X)) is constant across environments.
- Analyzes ERM and IRM under structural equation models with linear and polynomial generative mechanisms.
- Derives sample complexity bounds for IRM, showing O(1/ε²) scaling with slack ε in IRM constraints.
- Uses gradient analysis to prove ERM’s asymptotic bias when the matrix ρ̄ has full rank.
- Employs min-max optimization in IRM to enforce invariance across environments, minimizing worst-case risk.
- Applies theoretical tools from optimization and high-dimensional statistics to bound deviation from the ideal invariant predictor.
Experimental results
Research questions
- RQ1Under what distribution shift types does IRM outperform ERM in terms of sample complexity and finite-sample performance?
- RQ2Is ERM asymptotically unbiased when confounders or anti-causal variables are present in the data-generating process?
- RQ3How does the sample complexity of IRM scale with the slack ε in its constraints and the complexity of the model class?
- RQ4What conditions lead to ERM being biased even with infinite data, and how does IRM avoid this?
- RQ5How do the number of environments, model complexity, and IRM penalty weight jointly affect IRM’s convergence to the invariant predictor?
Key findings
- Under covariate shift (Φ* = identity), ERM and IRM achieve the same asymptotic solution and exhibit similar finite-sample behavior, with no clear winner.
- In confounder or anti-causal shift settings (Φ* ≠ identity), ERM is asymptotically biased and fails to converge to the true invariant predictor, even with infinite data.
- IRM can achieve a solution within O(√ε) of the ideal invariant predictor, with sample complexity scaling as O(1/ε²) for polynomial models.
- IRM’s sample complexity increases polynomially with the model class complexity, while ERM’s bias persists regardless of data size in non-covariate-shift settings.
- The bias in ERM arises when the matrix ρ̄ = [𝔼[εᵉXᵉ]] has rank at least one, which holds generically under non-degenerate distributions.
- IRM’s min-max optimization ensures convergence to the invariant predictor under mild regularity conditions, while ERM does not guarantee such invariance.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.