{
  "File Number": "1047",
  "Title": "The Missing Invariance Principle Found – the Reciprocal Twin of Invariant Risk Minimization",
  "Limitation": "Limitations In principle, IRM only requires Ee[y|zi] to be constant across domains in order to guarantee invariance, and therefore it has been previously thought to be generally applicable in a wide range of problems, even though this guarantee was only shown in the impractical limit of optimizing over the unrestricted function space of . Here, we showed a strong negative result that no meaningful form of invariance can be stated for IRM when the function space of is restricted. In contrast, MRI requires a more limiting condition that the label distribution P (y) and P (zi) should be constant across domains, but it can be more generally applied even for the case of restricted function space of . which yields more practicality. A common limitation of both MRI and IRM (Rosenfeld et al., 2020; Ahuja et al., 2021) is that they require significant support overlap across domains in order to guarantee OOD generalization. This may limit the applicability of these methods on certain domain generalization benchmarks that consist of domains that lack such overlap, such as VLCS (different image stylization, Fang et al. (2013)), and Terra-Incognita (different natural backgrounds, Beery et al. (2018)). In the Supplementary Materials, we report that both methods do not show significant improvement over ERM on these datasets (Table 3). Insensitivity of accuracy metric in evaluating invariance For CMINSTa/b, IRM-v1 (ALM) exhibits comparable performance to MRI-v1 in terms of test domain accuracy, despite having significantly worse performance in term of test domain risk (See Table 2). We investigated this phenomenon by analyzing the linear version of the task, toy-CMINSTa/b. The accuracy landscape is piece-wise constant (Fig 8C,F). Especially, it exhibits identical (i.e. invariant) accuracy between train and test domain in the region defined by wi > |ws|. Therefore, the accuracy metric cannot distinguish invariant solutions (ws = 0) from non-invariant solutions within the region. In contrast, the train domain and the test domain risk share the same value only if the solution is invariant (ws = 0) (Fig 8B,E). The constraint function of IRM-v1 (Fig 8A,D) shows that toy-CMNISTa only has invariant local optima and that toy-CMNISTb has additional non-invariant local optima, all of which satisfy wi > |ws|, thus exhibiting the same accuracy performance as the invariant optimum solution. This result illustrates that using accuracy metric alone for evaluating the degree of invariance could be insufficient, and highlights the need to also consider risk for evaluations. Acknowledgments and Disclosure of Funding\nThis research was done as part of Avinash Baidya’s internship at IBM. We thank Joel Dapello for helpful discussions. We also thank the anonymous reviewers for constructive comments.",
  "Reviewer Comment": "Reviewer_3: Strengths:\nPaper is clearly written and well motivated, showing the precise reason for IRM’s failure in certain scenarios.\nThe equivalent perturbation-based formulation can be helpful for easier analysis of IRM-type methods.\nThe qualitative experiments on Shape-Texture dataset in section 4.2 are illuminating; they show how IRM’s objective can induce multiple optima that may use the spurious features.\nWeaknesses:\nWhile the paper has a good set of qualitative experiments on synthetic tasks, it can be improved with more realistic experiments, for example, on the domain generalization benchmark DomainBed [1]. This will also help in clearly identifying if the performance of MRI is better than IRM; currently, the test classification accuracies are on par with IRM for most tasks (Table 3).\nIt would also be good to see how the proposed method fares to other more recent domain generalization methods (e.g., GroupDRO [2], MMD[3], IB-IRM [4], etc.).\nPractical implementation of the proposed method is not fully specified; for example, clear definition of constraints\nc\n→\nfor MRI, how perturbed risks are estimated empirically, etc. Additionally, it seems that IRMv1 is implemented with this reformulation (using constraints) rather than the original implementation, and may not be a fair comparison.\nQuestions:\nFirst line of Equation (9) is missing a square bracket. But I am also confused as to why the output perturbations should be linear and not constant when assuming linear functions\nψ\n.\nEquation (15) or Table 1 3rd column should explicitly specify what\nc\n→\nis. It is also better to provide more details on how to estimate the relevant quantities in the constraint.\nWas IRMv1 implemented using the constraints in equation (15) by estimating the perturbed risks or using the original implementation?\nLine 142: I am not clear on what the assumption on noise is here. Is it still additive but need not be Gaussian?\nEquation (20) has an undefined\nc\n→\n(\nθ\n)\nterm. Should it be\nc\n→\n(\nf\n(\nθ\n)\n)\n?\nThe “Convexity matters” paragraph seems to claim about convexity more generally, which I believe is not backed by the experiments which were solely done in the specific context of IRM-type losses. I think the claims should be appropriately rewritten.\nAFTER REBUTTAL: Authors have addressed my concerns and I have improved my score.\nLimitations:\nYes.\nEthics Flag: No\nSoundness: 3 good\nPresentation: 3 good\nContribution: 3 good\n\nReviewer_4: The novel approach is clearly presented and motivated quite well. The theoretical results appear to be sound, although I have not checked the proofs in the appendix.\nThe empirical results confirm the advantages of MRI-v1 over IRM-v1.\nWeaknesses\nThe empirical improvement of MRI-v1 over IRM-v1 in the linear regime in Table 2 appears to be quite modest. The authors might be able to provide more convincing experiments perhaps with a dataset where IRM-v1 fails more radically, or in the non-linear regime or with architectures more complex than LeNet.\nResults such as Lemma 3.5 seem to rely on either the binary cross-entropy loss or the squared loss and it is not clear if the author's approach is applicable to other loss functions\nThe authors call their approach mirror reflection because they consider label perturbations instead of output perturbations. However instead of the same loss across environments, they require the same change in loss across environments. That reminds this reviewer of equivariance instead of invariance as defined in standard statistical texts such as Casella and Berger. So I have dubbed their approach MRE instead of MRI.\nMinor clarity issue: It is not clear how the penalty parameter\nλ\nor the ALM parameter\nμ\nin the experiments was tuned or how difficult it was to tune these parameters.\nTypo: Heavyside should be Heaviside in Sec. 5.2.1.\nSEM is not defined prior to its use in Sec. 4.1\nQuestions:\nShould\nσ\n(\nψ\n(\no\n)\n)\nin eq (6) simply be\nσ\n(\no\n)\n?\nDo the colors for the plots in Fig. 2 refer to different parameters in the model or to different initial conditions ?\nPlease also note the questions inherent in Weaknesses 2 and 4 above.\nThe authors mention requiring\nE\n-1 independent pair-wise constraints in Sec. 3.2 and Sec 3.3. It appears that all experiments use\nE\n=\n2\n. Does\nE\n>\n2\nincrease the computational burden of MRIv1 versus IRM ? Have the authors does any experiments with\nE\n>\n2\n?\nLimitations:\nThe authors point out the limitations of their approach in Sec. 6. It is not clear if question 3 (weakness 2 and 4) mentioned above indicates other limitations.\nEthics Flag: No\nSoundness: 3 good\nPresentation: 4 excellent\nContribution: 3 good\n\nReviewer_5: Strengths:\nThe generating process considered in Fig.1 and the followed-up invariance regularization are interesting, which complement the generating process of X \\to Y in IRM.\nThis paper is well organized and written.\nWeaknesses:\nThe result analysis is MISLEADING. In Table.2, the MRI has a lower loss than IRM and it was claimed that this result is consistent with Table 3. However, in Table 3, the IRM has better accuracy than the proposed MRI method. Indeed, the comparison in terms of accuracy on test domains is more reflectiveness in the considered scenario, as the MRI and IRM optimized different loss functions.\nThis paper highlighted that the proposed method corrected the \"flaw\" in IRM. However, as far as I'm concerned, this is also misleading, as the two works considered different generating processes. The IRM assumed Y was generated after X (in which the Y is probably given by humans), while the MRI is vice-versa (in which Y is the ground-truth label). In other words, a different definition of Y determines different generating processes, and it is not necessary for a generation process to be constantly correct. For example, if Y denotes the disease label from the clinicians, then it should be X \\to Y. With different generating processes, the invariance and corresponding regularization function can also be different. This can explain the reason for MRI to learn invariant features on the Shape-texture dataset, as the generation of X, and Y follows from Fig.1. In the setting for X \\to Y which can also happen, the MRI should not perform better than IRM, in terms of invariant feature selection. Therefore, these two works are not comparable, as the basic underlying causal graph is different.\nThe claim in lines 109-110 that the conservation of Ee[oy]=EPe(o)[Ee[y|o] · o], is a necessary condition for the conservation of Ee[y|o] is wrong. This is because the Pe(o) can also vary across environments, even if Ee[y|o] is invariant, it is not necessarily held that Ee[oy] is invariant.\nQuestions:\nSee the weaknesses above.\nLimitations:\nAs far as I am concerned, the authors adequately addressed the limitations and potential negative societal impact of their work.\nEthics Flag: No\nEthics Review Area: I don’t know\nSoundness: 1 poor\nPresentation: 3 good\nContribution: 2 fair\n\nReviewer_6: Strengths:\nThe authors claims appear to be true (and are supported elsewhere in the literature), that IRM is over-specified, and that it can be rephrased into a perturbation method. This rephrasing is, itself, original and interesting from an analytic standpoint, but also it suggests another constraint set, which the authors build into a method (MRI).\nExperimental evidence in the main text backs the authors claims, and improves over IRM.\nWeaknesses:\nThe paper is couched deep in the perturbation theory literature and notation. While this essentially the authors' main contribution to this particular problem (i.e. the application of perturbations to IRM and the like), many facts and notations go without explanation, making the paper difficult to follow.\nSimilarly, the intuition of \"mirror reflected\" constraint appears to not be true? Instead, this constraint follows a different intuitional path from Arjovsky 2019, one not from Arjovsky Def 3 but from the (un-numbered) pairwise constraint below def 3. This feels confusing and unclear to read.\nThe paper shows two experiments, even though the testbed suite they use (DomainBed) provides a large number of experimental conditions. Subsection experiments are relegated to the appendices and somewhat but not entirely match main text results(? It is difficult to tell from plots, but Figure 3 does not appear to match Table 1 numbers.) I am mostly concerned that the strong empirical results will not hold up under other domain shifts, and only work for this form of CMNIST; I would be pleased to be shown wrong.\nQuestions:\nHereafter\nL\n=\nL\nbecause mathjax or whatever web framework won't render the subscripts correctly for\nL\n...\nQuestions:\n[1] Under the authors perturbation framework, it seems as though MRI is not a mirror of the IRM framework, but simply a different condition. IRM (under perturbation) prescribes a constraint for\nL\ne\nunder perturbations of prediction output\no\n=\nf\n(\nx\n)\nfor each\ne\n. To me, a mirror of this would be a constraint for\nL\ne\nunder perturbations of label\ny\nfor each\ne\n. If we assume the analysis after Eq. 6 is correct, clearly this leads to\n|\nE\n|\nconstraints; as the authors then conclude, this is one too many.\nInstead, it seems better to claim this as a corrected or modified criterion. The constraints on\nδ\ny\nL\ne\ni\n=\nδ\ny\nL\ne\nj\nfor\ni\n,\nj\npairs in\nE\nproduces\nE\n−\n1\neffective constraints (due to transitivity). This could similarly be done in\nδ\no\n, which, to me, would be the natural mirror. Either\nδ\ny\nor\nδ\no\nproduce the correct number, and, likely the correct formulation on constraints. I think it would be to the benefit of the reader and the authors to rewrite the manuscript with this in mind.\nMoreover, from the authors description it is fairly clear (assuming their derivations are correct) that the condition in Eq. 4 and Def 3.1 do not match. Even if meeting Def 3.1 (eq. 6) implies Eq. 4, it is not a necessary condition, shown by constraint cardinality mismatch. Def 3.1 is strictly stronger than Eq. 4. This is not a fault of the authors of this manuscript obviously (it exists in Arjovsky et al 2019) but would aid the author in speaking about the problems of IRM.\n[2] Definition 3.2 is a first order rewording of Def 3.1. It thus is only true under certain conditions on\nL\n. While I think these assumptions are reasonable, they should be explicitly stated in the definition, not just in the last paragraph of Section 2. (Removing these constraints, we could easily imagine an\nL\nwith some contrived saddlepoint where\nδ\nL\n=\n0\nbut the solution sub-optimal.)\n[3] Figure 3 suggests that in all but CMNISTb, IRM-relaxed should be performant, but these results do not match Table 1. Are these the same results?\n[4] Table 3 should be in the main text? It seems to be a relevant experiment.\nSuggestions:\n[1] At times the authors leave most of the algebra/context to the reader. At almost every instance of the word \"conserved\" the authors leave the reader to find out over which variable the expression is conserved. While it eventually becomes discernible given a careful reading in most instances, it would be helpful to be explicit across the board.\n[2] Some notation is muddled or inconsistent.\nE\nversus\nE\n, the usage of\nδ\nin both the test function and as a functional derivative (symbolic only?). The manuscript perhaps should be carefully reconstructed.\n[3] Figure 2 makes little sense to me. While it may be my own error, if this is the case with the other reviewers I suggest re-writing/building this figure. I cannot tell what the spurious feature should be, or how the constraint sets are determined. I assume the level-sets are the loss function, but this means it is specific to a single domain.\nLimitations:\nThis is a work of theory, and likely does not have direct social impacts outside of machine learning.\nEthics Flag: No\nSoundness: 3 good\nPresentation: 2 fair\nContribution: 3 good",
  "Limitations_refined": "Limitations In principle, IRM only requires Ee[y|zi] to be constant across domains in order to guarantee invariance, and therefore it has been previously thought to be generally applicable in a wide range of problems, even though this guarantee was only shown in the impractical limit of optimizing over the unrestricted function space of . Here, we showed a strong negative result that no meaningful form of invariance can be stated for IRM when the function space of is restricted. In contrast, MRI requires a more limiting condition that the label distribution P (y) and P (zi) should be constant across domains, but it can be more generally applied even for the case of restricted function space of . which yields more practicality. A common limitation of both MRI and IRM (Rosenfeld et al., 2020; Ahuja et al., 2021) is that they require significant support overlap across domains in order to guarantee OOD generalization. This may limit the applicability of these methods on certain domain generalization benchmarks that consist of domains that lack such overlap, such as VLCS (different image stylization, Fang et al. (2013)), and Terra-Incognita (different natural backgrounds, Beery et al. (2018)). In the Supplementary Materials, we report that both methods do not show significant improvement over ERM on these datasets (Table 3). Insensitivity of accuracy metric in evaluating invariance For CMINSTa/b, IRM-v1 (ALM) exhibits comparable performance to MRI-v1 in terms of test domain accuracy, despite having significantly worse performance in term of test domain risk (See Table 2). We investigated this phenomenon by analyzing the linear version of the task, toy-CMINSTa/b. The accuracy landscape is piece-wise constant (Fig 8C,F). Especially, it exhibits identical (i.e. invariant) accuracy between train and test domain in the region defined by wi > |ws|. Therefore, the accuracy metric cannot distinguish invariant solutions (ws = 0) from non-invariant solutions within the region. In contrast, the train domain and the test domain risk share the same value only if the solution is invariant (ws = 0) (Fig 8B,E). The constraint function of IRM-v1 (Fig 8A,D) shows that toy-CMNISTa only has invariant local optima and that toy-CMNISTb has additional non-invariant local optima, all of which satisfy wi > |ws|, thus exhibiting the same accuracy performance as the invariant optimum solution. This result illustrates that using accuracy metric alone for evaluating the degree of invariance could be insufficient, and highlights the need to also consider risk for evaluations. Acknowledgments and Disclosure of Funding\nThis research was done as part of Avinash Baidya’s internship at IBM.",
  "abstractText": "Machine learning models often generalize poorly to out-of-distribution (OOD) data as a result of relying on features that are spuriously correlated with the label during training. Recently, the technique of Invariant Risk Minimization (IRM) was proposed to learn predictors that only use invariant features by conserving the feature-conditioned label expectation Ee[y|f(x)] across environments. However, more recent studies have demonstrated that IRM-v1, a practical version of IRM, can fail in various settings. Here, we identify a fundamental design flaw of IRM formulation that causes the failure. We then introduce a complementary notion of invariance, MRI, based on conserving the label-conditioned feature expectation Ee[f(x)|y], which is free of this flaw. Further, we introduce a simplified, practical version of the MRI formulation called MRI-v1. We prove that for general linear problems, MRI-v1 guarantees invariant predictors given sufficient number of environments. We also empirically demonstrate that MRI-v1 strongly out-performs IRM-v1 and consistently achieves near-optimal OOD generalization in image-based nonlinear problems.",
  "1 Introduction": "Deep learning models have shown tremendous success over the past decade. These models show great generalization properties when tested on the same distribution as the training dataset (indistribution generalization). However, these models often show catastrophic failure when tested on out-of-distribution dataset, revealing that they learned features that are spuriously correlated to the label in the given training domains but do not generalize to the testing domains. For example, deep networks trained on pictures of cow with only grassy backgrounds in the training domain will use the background color as the predictive feature which is easier to learn and generalize poorly to pictures of cow with a dessert background.\nRecently, there has been a growing interest in developing models that generalize well across multiple domains. In particular, there has been a recent body of works that focus on developing algorithms that attempt to learn invariant predictors (Arjovsky et al., 2019; Ahuja et al., 2021; Peters et al., 2016; Rojas-Carulla et al., 2018; Heinze-Deml et al., 2018). Invariant Risk Minimization (IRM) and its practical version, IRM-v1, have garnered significant attention as one of the initial methods that are compatible with deep learning techniques. However, several follow-up studies have empirically demonstrated that IRM-v1 is unreliable at learning invariant representations (Kamath et al., 2021; Rosenfeld et al., 2020; Gulrajani and Lopez-Paz, 2020; Ahuja et al., 2020, 2021). Here, we identify a fundamental flaw of IRM formulation that causes this limitation and propose a new method that is free of this flaw.\n⇤Equal contribution\n36th Conference on Neural Information Processing Systems (NeurIPS 2022).\nRelated Works There has been considerable work in the field of learning invariant representations. They vary from learning domain-invariant feature representations conserving P (f(x)) using kernel methods (Muandet et al., 2013; Ghifary et al., 2016; Hu et al., 2020), variational autoencoder (Ilse et al., 2020), and adversarial networks Ganin et al. (2016); Long et al. (2018); Akuzawa et al. (2019); Albuquerque et al. (2019) to learning invariant class-conditional features P (f(x)|y) (Gong et al., 2016; Li et al., 2018b) in the context of domain adaptation, which assumes access to the test distribution for adaptation. There is also a large body of work to learn invariant representations in the field of domain generalization that doesn’t assume access to test distributions. This includes imposing invariance of Ee[y|f(x)] (Arjovsky et al., 2019) with information bottleneck constraint (Ahuja et al. (2021)), imposing object-invariant condition (Mahajan et al. (2021)), using domain inference (Creager et al., 2021), model calibration (Wald et al., 2021), and others (Krueger et al., 2021; Li et al., 2018a; Shankar et al., 2018).\nOur Contributions We introduce a variational formulation of IRM, and show that it can be modified to yield a new complementary notion of invariance, called MRI. We show that IRM has a fundamental flaw due to the indirect way of imposing invariance which leads to the failure of IRM-v1. In constrast, MRI is shown to be free of this flaw. We prove that MRI-v1 can guarantee invariant predictors in general linear problem settings given sufficient environments. We also show empirical demonstrations that MRI strongly out-performs IRM and consistently achieves near-optimal OOD generalization in nonlinear image-based problems.2",
  "2 Problem Formulation": "Consider a set of environments E = {e}, each of which defines a distribution Pe(x, y) over inputs and labels, from which the dataset of the environment is drawn De ⌘ {(xej 2 Rd, yej 2 R)}. The distribution Pe(x, y) is assumed to be generated according to the causal graph in Fig 1 (Rosenfeld et al., 2020), which includes latent features that are invariantly zi or spuriously zs correlated with the label, from which the observation x is generated.3\nThe risk of a predictor f : X ! O in environment e is defined as the population average\nLe(f) ⌘ EPe(x,y)[l(f(x), y)] (1) = EPe(o)[EPe(y|o)[l(o, y)]] (2) = EP (y)[EPe(o|y)[l(o, y)]] (3)\nwhere o = f(x) is the predictor’s output. Here, we consider standard convex loss functions l : O ⇥ Y ! R 0, including the square loss lsq(o, y) = 12 (o y)\n2 for regression (O, Y ✓ R) and the binary-cross-entropy (BCE) loss llog(o, y) = (1 + y) log(⌘(o)) (1 y) log(1 ⌘(o)) for binary classification (O ✓ R, Y ✓ [ 1, 1]), where ⌘(o) ⌘ 1/(1 + e o) is the sigmoid function.",
  "3.1.1 Original formulation": "Definition 3.1. (Arjovsky et al., 2019) The feature representation f : X ! Z elicits an IRM invariant predictor f : X ! O over a set of environments E , if there exists : Z ! O such that is simultaneously optimal for all environments in E , i.e.\n8e 2 E , 2 argmin  ̄ Le( ̄ f) (4)\n2Code available at https://github.com/IBM/MRI. 3While Fig 1 only shows the causal direction Y ! Zi, the other direction Zi ! Y is also consistent with\nour analysis here as long as P (y) is independent from the environment index e.\nwhere is assumed to be unrestricted in the space of all measurable functions. Lemma 3.2. (Kamath et al., 2021) For standard loss functions4, Definition 3.1 is equivalent to\n9 , 8e 2 E , Ee[y|f(x)] = ( f(x)). (5)\nwhere Ee[y|f(x)] ⌘ EPe(y|f(x))[y] is the feature-conditioned label expectation, and is a monotonic function that depends on the loss function.",
  "3.1.2 Variational formulation": "The original formulation above is overly complex due to the composite predictor f and the optimality condition on . For further analysis, we introduce the following variational formulation. Definition 3.3. A predictor f : X ! O is IRM invariant over a set of environments E , if the risk Le(f) remains stationary under arbitrary infinitesimal perturbations on the predictor output o = f(x) for all environments in E , i.e.\n8e 2 E , Le(f) = lim ✏!0 EPe(o,y)[l(o+ ✏ (o), y) l(o, y)]/✏\n= EPe(o)[EPe(y|o)[@ol(o, y)] · (o)] = 0 (6)\nwhere : O ! O is an arbitrary perturbation that is unrestricted in the space of all measurable functions, and Le(f) denotes the resulting change in risk. Lemma 3.4. For standard loss functions4, Definition 3.3 is equivalent to\n8e 2 E , Ee[y|o] = (o), (7)\nwhich is equivalent to Lemma 3.2 with the composite predictor f replaced by f .\nProof. Eq (6) is satisfied if and only if EPe(y|o)[@ol(o, y)] = 0. For standard loss functions, the loss derivative has the form @ol(o, y) = y+ (o), which yields Ee[@ol(o, y)|o] = Ee[y|o]+ (o) = 0.\nNote that even though Definition 3.3 describes only the first-order condition for the predictor to be simultaneously optimal over all environments, this is indeed the necessary and sufficient condition for optimality, since the loss function l is convex. This yields a simpler formulation of IRM without requiring a composite form for the predictor f .",
  "3.1.3 Conservation law of IRM": "As noted in Arjovsky et al. (2019); Kamath et al. (2021), the essence of IRM’s invariance is the conservation of the feature-conditioned label expectation, i.e.\n8e1, e2 2 E , Ee1 [y|f(x)] = Ee2 [y|f(x)]. (8)\nThis result can be easily seen from eq (5),(7), since their RHS term (o) is constant with respect to the environment index e.\nRemark Notice an intriguing discrepancy in the number of constraints: IRM (eq (4),(5),(7)) imposes one constraint per environment, total of |E| constraints, whereas the conservation law describes |E| 1 equality relationships that Ee[y|o] should share the same value across environments. The missing constraint is that IRM additionally requires the shared value of Ee[y|o] to also be equal to (o). This discrepancy emphasizes the fact that the equality relationships in eq (8) are not direct constraints imposed to hold between environments, but rather a byproduct — an indirect consequence of separate individual constraints all sharing a common intermediate term, (o). Furthermore, it shows that the invariance guarantee of IRM singularly depends on the constancy of this shared term across environments, which proves to be a single point of failure for IRM.\n4 Square loss and BCE loss are considered: (o) = o for square loss, and (o) = tanh(o/2) for BCE loss.",
  "3.1.4 IRM-v1": "Due to the impracticality of considering the unrestricted function space of , Arjovsky et al. (2019) suggested restricting to the space of linear functions. In the variational formulation, this corresponds to restricting the output perturbations to the space of linear functions, which, for scalar outputs, is equivalent to the identity function, (o) = o. This reduces eq (6) to\n8e 2 E , Le(f) = Ee[ @ol(o, y) · o ] = 0. (9)\nThe reduced constraints in eq (9) are identical to IRM-s in Kamath et al. (2021).5 In Arjovsky et al. (2019), this reduced formulation is termed IRM-v1 when the constraints are imposed in a soft manner, i.e. as squared penalty terms (See eq (16)). In the literature, the term IRM-v1 is widely used for the reduced formulation regardless of whether hard or soft constraints are used, which we adopt here.\nHowever, IRM-v1 has been empirically found to behave quite differently from IRM and fail even in simple problems (Kamath et al., 2021). This failure mechanism can be analytically understood here: Since @ol(o, y) · o = o( (o) y) for standard loss functions4, eq (9) is equivalent to\n8e 2 E , Ee[oy] = Ee[o (o)]. (10)\nNote that the RHS of eq (10) originates from the RHS of eq (7). Unlike (o) of eq (7), however, Ee[o (o)] is not constant, since it involves expectation that depends on the environment, and therefore it fails to mediate any meaningful invariance relationship. In Supplementary Materials, we generalize this result to the wider class of perturbations that are mixtures of nonlinear basis functions (See Supplementary Materials B).\nFundamental flaw of IRM The above analysis shows that IRM’s indirect mechanism for attaining invariance through a shared intermediate term is in fact quite fragile, which easily breaks when the function space of (or ) gets restricted. We identify this as the fundamental design flaw of IRM.",
  "3.2 MRI Paradigm": "We now introduce a complementary notion of invariance by considering infinitesimal perturbations on label, which we call the Mirror Reflected IRM, or MRI. Definition 3.5. A predictor f : X ! O is MRI invariant over a set of environments E , if the change in risk due to arbitrary infinitesimal label perturbations is shared across environments, i.e.\n8e1, e2 2 E , Le1(f) = Le2(f) (11) where Le(f) ⌘ lim\n✏!0 EPe(x,y)[ l(o, y + ✏ (y)) l(o, y) ]/✏\n= EP (y)[Ee[ @yl(o, y)|y ] · (y) ] (12)\nwhere : Y ! Y is an arbitrary perturbation that is unrestricted in the space of all measurable functions, and Le(f) denotes the resulting change in risk. Ee[@yl(o, y)|y] ⌘ EPe(o|y)[@yl(o, y)]. Lemma 3.6. For standard loss functions, Definition 3.5 is equivalent to\n8e1, e2 2 E , Ee1 [o|y] = Ee2 [o|y], (13)\nwhich conserves the label-conditioned feature expectation Ee[o|y] ⌘ EPe(o|y)[o] across environments.\nProof. Eq (11) is satisfied if and only if Ee[@yl(o, y)|y] is conserved. For standard loss functions, the loss derivative has the form @yl(o, y) = o+⇢(y)6. Therefore, Ee1 [@yl(o, y)|y] Ee2 [@yl(o, y)|y] = Ee1 [o|y] Ee2 [o|y] = 0.\nRemark Note that MRI attains invariance in a direct manner without involving any intermediate term, which results in the number of constraints in eq (11) matching the conservation law eq (13).\n5IRM-s imposes @ Ee[ l( · o, y)] = 0, where is a scalar factor. Note that @ l( · o, y) = @ol(o, y) · o. 6 Square loss and BCE loss are considered: ⇢(y) = y for square loss, and ⇢(y) = 0 for BCE loss.",
  "3.2.1 MRI-v1": "Restricting the label perturbations to the space of linear functions, or equivalently, an identity function (y) = y, reduces eq (12) to Le(f) = Ee[ @yl(o, y) ·y ]. This reduces the conservation law eq (13) to\n8e1, e2 2 E , Ee1 [oy] = Ee2 [oy]. (14)\nwhich describes a necessary condition for the MRI invariance eq (13). Therefore, MRI’s direct mechanism for attaining invariance continues to hold when is restricted to the space of linear functions.",
  "4.1 Constrained optimization problem": "The full methods of IRM-v1 and MRI-v1 can be formalized as a constrained optimization problem\nmin f2F\nLtr(f) subject to ~c(f) = ~0, (15)\nwhere Ltr = 1|Etr| P\ne2Etr Le is the average risk over the set of training environments Etr ⇢ E . The constraint functions are ~c = ~ L 2 R|Etr| for IRM-v1 and ~c = Q ~ L 2 R|Etr| 1 for MRI-v1, where ~ L 2 R|Etr| is a vector of perturbed risks Le for e 2 Etr, and Q 2 R(|Etr| 1)⇥|Etr| is an orthonormal matrix that satisfies Q~1 = ~0, such that Q ~ L computes the differences of Le between environments. For example, for a training set of two environments Etr = {e1, e2}, Q ~ L = ( Le1 Le2)/ p 2,\nsince Q = [1, 1]/ p 2. See Table 1.",
  "4.2 Soft-constraint methods": "Numerically solving IRM-v1 and MRI-v1 requires converting the hard constraints ~c(f) = ~0 to soft constraints, which allows the use of off-the-shelf gradient-based optimization algorithms.\nPenalty Method (PM) Penalty method is the most commonly used approach, including in Arjovsky et al. (2019), which adds the squared residual constraints as a penalty term to the objective,\nmin f2F\nLtr(f) + µ k~c(f)k2 (16)\nHowever, this method requires increasing µt ! 1 over training iteration t in order to approximate the exact hard-constraint, which leads to training instability and slow convergence (Bertsekas, 1976).\nAugmented Lagrangian Method (ALM) ALM was introduced to overcome the limitations of penalty method (Bertsekas, 1976), which adds a Lagrange multiplier term to (16)\nmin f2F\nLtr(f) + µ k~c(f)k2 + ~ | · ~c(f), (17)\nwhere ~ is typically initialized at ~0 and updated at each training iteration t to accumulate the residual constraints ~c(f(wt)). In practice, ALM can operate with moderate values of µ (⇠ 10) without fine tuning, and thus exhibits fast and stable convergence (Bertsekas, 1976).",
  "5.1 General Linear SEM": "In this section, we demonstrate that MRI-v1 can effectively eliminate all features that are spuriously correlated with the label in a linear predictor, given a sufficient number of environments. Consider a data generating process according to Fig 1, in which the observation x = g(zi, zs) is an injective linear function of the latent features zi 2 Rdi , zs 2 Rds . Note that this Structural Equation Model (SEM) (Pearl, 2009) does not require any assumptions on the generation process Y ! Zi, Zs, which generalizes the SEM of Rosenfeld et al. (2020), which additionally assumed binary labels and additive Gaussian noise for generating the latent features.\nWe consider a linear predictor f : X ! O. Since g is injective and has an inverse over its range, without loss of generality, we can define f as a linear function directly over the latents as\no = f(x;w) = w| i · zi + w|s · zs (18)\nwith parameters w ⌘ {wi 2 Rdi , ws 2 Rds}. Theorem 5.1. Given |Etr| > ds training environments, and that Ee[zsy] are in general linear positions, MRI-v1 will eliminate all spurious feature dimensions.\nProof. MRI-v1’s constraint eq (14) yields 8e 2 Etr, Ee[oy] = wi · Ee[ziy] + ws · Ee[zsy] = const,\nwhich can be expressed in a matrix form as ws ·M 0 = 0, (19) where M 0 = M M̄ · 1 with M ⌘ [Ee[zsy]]e2Etr 2 Rds⇥|Etr| and M̄ = 1|Etr| P e2Etr Ee[zsy].\nSince rank(M 0) = ds, eq (19) is equivalent to ws = 0.\nA similar result was shown for IRM-v1, but under a more restricted setting, such as a specialized linear family of environments with binary labels and additive Gaussian noise (Rosenfeld et al., 2020). In fact, IRM-v1 has been shown to fail in more general linear problems with non-Gaussian noise (Arjovsky et al., 2019; Kamath et al., 2021).\n5.2 Minimal Example: di = 1, ds = 1, |Etr| = 2\nHere, we demonstrate a minimal case of the above general linear problem that involves one invariant feature, one spurious feature and two training environments (Shape-Texture linear regression problem in Section 6.1). See Supplementary Materials for the detailed experimental set up and the analytical solutions. A similar minimal examples for linear binary classification are also analyzed and shown in Supplementary Materials (Fig 6, linear shape-texture classification and toy-CMNISTa/b).\nAnalytic solutions (Hard-constraints, Fig 2A) IRM-v1 has two quadratic equality constraints, Ee1 [o2 oy] = Ee2 [o2 oy] = 0, shown as two elliptic curves. The intersection between the non-convex constraints on a 2-D feature space yields a disjoint set of 0-D points, all of which are local constrained optima, including the true invariant optimum, a zero-predictor solution, and two non-invariant solutions. Note that one of the non-invariant solutions exhibits lower train loss than the true invariant optimum solution.\nWe also test the relaxed version of IRM-v1 by removing the extraneous constraint. The relaxed version has a single constraint Ee1 [o2 oy] = Ee2 [o2 oy], which describes a pair of hyperbolic curves (appears as two straight lines in Fig 2A), i.e. a non-convex constraint. This problem exhibits two local constrained optima, including the true invariant optimum and a non-invariant solution, with the non-invariant solution exhibiting a lower train loss. Therefore, simply relaxing the extraneous constraint does not resolve the fundamental problem of IRM-v1.\nIn contrast, MRI-v1 has one linear equality constraint, Ee1 [oy] = Ee2 [oy], that exactly prescribes the set of all invariant solutions ws = 0. That is, a solution is an invariant predictor if and only if it satisfies this constraint. This is a convex problem, since both the objective and the constraint are convex, and thus features a unique optimum, which is the true invariant optimum solution.\nConvergence Dynamics (Soft-constraints, Fig 2B/C) Here, we analyze the optimization dynamics under full-batch gradient descent (penalty method eq (16) with µ = 5 ⇥ 104). IRM-v1’s convergence is highly dependent on the initialization (shown with differently colored trajectories), due to the presence of multiple local minima. Note that most trajectories do not converge to the true invariant optimum. IRM-relaxed also exhibits complex dynamics due to a saddle point near the true invariant solution: Some trajectories (red and magenta) first approach the line of invariant solutions, but all trajectories eventually converge to the non-invariant solution. Note that the true invariant optimum solution is not even a local optimum of IRM-relaxed at this value of µ, but it would exist in the limit µ ! 1. In contrast, MRI-v1 always converges to the true invariant optimum regardless of initialization since it is a unique minimum.",
  "6 Nonlinear Image-based Problems": "Unlike for linear problems, theoretical proof for invariance is difficult to show for nonlinear problems. Here, we empirically investigate the performance of IRM-v1 and MRI-v1 in nonlinear image-based problems.\n6.1 Datasets\nShape-Texture Dataset We introduce a new dataset that is designed to evaluate domain generalization algorithms across various settings, including linear regression, linear classification, nonlinear image-based regression, and nonlinear image-based classification. The generative process of the dataset involves an invariant feature zi = ei✓i , a spurious feature zs = ei✓s , and a label feature ei✓y , each of which represents an orientation on a complex unit circle: ei✓ 2 S1. The angles of orientations are generated as ✓y ⇠ US1 , where US1 is the circular uniform distribution, and for ⇤ 2 {i, s}, ✓⇤ = ✓y with probability p⇤ or ✓⇤ ⇠ US1 with probability 1 p⇤. The parameter pi = 0.75 is fixed across environments, whereas ps varies from one environment to another. We consider two training environments Etr = {e1, e2} with pse1 = 1, pse1 = 0.8 and one testing environment Etest = {e0} with pse0 = 0.\nIn the linear regression task (section 5.2), the observed input is the concatenated latent features x = [ei✓i , ei✓s ] and the label is y = ei✓y . In the linear classification task, the input is x = [sin(✓i), sin(✓s)] and the label is y = H(sin(✓y)), where H is the sign function. In the nonlinear regression/classification tasks, the observed input is the image composed of two planar waves, in which ✓i is the orientation of the low frequency wave (i.e. shape) and ✓s is that of the high frequency wave (i.e. texture), as shown in Fig 5.\nColored MNIST (CMNIST) CMNIST (Arjovsky et al., 2019) is a synthetic dataset derived from MNIST for binary classification. In this dataset, the label y assigned to an image is based on the digit bit zi (1 for digits 0 ⇠ 4 and -1 for 5 ⇠ 9) such that y = zi with probability pi or zi with probability 1 pi. The color bit zs (1 for red -1 for green) is chosen based on the label such that zs = y with probability ps or y with probability 1 ps. We consider two versions, CMNISTa and CMNISTb, with two sets of environmental parameters: CMNISTa is the version from Arjovsky et al. (2019) with pi = 0.75, pse1 = 0.9, pse1 = 0.8, and pse0 = 0.1 for the training Etr = {e1, e2} and the testing Etest = {e0} environments; CMNISTb uses pi = 0.9, pse1 = 1, pse1 = 0.8, pse0 = 0.1. In the nonlinear tasks, the input observation x is the colored MNIST image. In the abstracted versions, called toy-CMNISTa/b, the input observation is the two-bit data x = [zi, zs] (Kamath et al., 2021).\nRemark Note that both Shape-Texture and CMNIST datasets can be equally understood as being generated from Fig 1 with causal directions Y ! Zi or Zi ! Y (Fig 9).",
  "6.2 Result": "Here, we report the performance of IRM-v1, MRI-v1, as well as the vanilla Empirical Risk Minimization (ERM) algorithm (i.e. without imposing any invariance constraint). For reference, the results are compared to the Oracle performance, which is obtained by applying ERM on the modified training datasets in which the spurious features are rendered uncorrelated with the label.\nWe tested the algorithms under a wide range of hyperparameters for both the Shape-Texture (Fig 3) and the CMNIST-b (Fig 4) datasets. Overall, MRI-v1 consistently achieves good invariant performance close to the Oracle, whereas IRM-v1 often shows either chance-level performance or poor OOD generalization with large differences between the train and the test domain risks. The results for a specific hyperparameter setting is shown in Table 2.\nUnder the PM setting, we observe that IRM-v1 often drives the models to the zero-predictor solution, i.e. making zero output regardless of the input, even with annealing the penalty term to be applied only in the later phase of training. This explains IRM-v1’s identically low performance across train and test domains, consistent to the previously reported results in Gulrajani and Lopez-Paz (2020). In contrast, MRI-v1 never drives the models to the zero-predictor solution, consistent with the finding in Sec 5.2 that MRI-v1 does not have an local minima at the zero-predictor in the linear problem setting.\nInterestingly, the ALM setting greatly improves IRM-v1’s performance especially in terms of accuracy, while MRI-v1’s performance remains relatively unchanged between PM and ALM. Under the ALM setting, IRM-v1 shows comparable or slightly higher accuracy than MRI-v1 for the CMNIST dataset.\nIn the Supplementary Materials, we also report the results for other recent domain generalization methods including MMD (Li et al., 2018b), GroupDRO (Sagawa et al., 2019), and IB-IRM (Ahuja et al., 2021) on the Shape-Texture classification task, which exhibit significantly worse performance than MRI-v1 (Fig 7).",
  "7 Discussion": "Limitations In principle, IRM only requires Ee[y|zi] to be constant across domains in order to guarantee invariance, and therefore it has been previously thought to be generally applicable in a wide range of problems, even though this guarantee was only shown in the impractical limit of optimizing over the unrestricted function space of . Here, we showed a strong negative result that no meaningful form of invariance can be stated for IRM when the function space of is restricted. In contrast, MRI requires a more limiting condition that the label distribution P (y) and P (zi) should be constant across domains, but it can be more generally applied even for the case of restricted function space of . which yields more practicality.\nA common limitation of both MRI and IRM (Rosenfeld et al., 2020; Ahuja et al., 2021) is that they require significant support overlap across domains in order to guarantee OOD generalization. This may limit the applicability of these methods on certain domain generalization benchmarks that consist of domains that lack such overlap, such as VLCS (different image stylization, Fang et al. (2013)), and Terra-Incognita (different natural backgrounds, Beery et al. (2018)). In the Supplementary Materials, we report that both methods do not show significant improvement over ERM on these datasets (Table 3).\nInsensitivity of accuracy metric in evaluating invariance For CMINSTa/b, IRM-v1 (ALM) exhibits comparable performance to MRI-v1 in terms of test domain accuracy, despite having significantly worse performance in term of test domain risk (See Table 2). We investigated this phenomenon by analyzing the linear version of the task, toy-CMINSTa/b. The accuracy landscape is piece-wise constant (Fig 8C,F). Especially, it exhibits identical (i.e. invariant) accuracy between train and test domain in the region defined by wi > |ws|. Therefore, the accuracy metric cannot distinguish invariant solutions (ws = 0) from non-invariant solutions within the region. In contrast, the train domain and the test domain risk share the same value only if the solution is invariant (ws = 0) (Fig 8B,E). The constraint function of IRM-v1 (Fig 8A,D) shows that toy-CMNISTa only has invariant local optima and that toy-CMNISTb has additional non-invariant local optima, all of which satisfy wi > |ws|, thus exhibiting the same accuracy performance as the invariant optimum solution. This result illustrates that using accuracy metric alone for evaluating the degree of invariance could be insufficient, and highlights the need to also consider risk for evaluations.\nAcknowledgments and Disclosure of Funding\nThis research was done as part of Avinash Baidya’s internship at IBM. We thank Joel Dapello for helpful discussions. We also thank the anonymous reviewers for constructive comments.",
  "Reviewer Summary": "Reviewer_3: The paper shows that IRM enforces one more constraint than necessary from viewpoint of the invariance principle, resulting in its failures. Then, a modified paradigm is presented along with a practical version which optimizes the correct set of constraints. Theoretical guarantees are provided in the linear setting and experiments on simple tasks show benefits and the optimization properties of the approach.\n\nReviewer_4: The authors build upon the observations in Kamath et al., 2021 regarding conditional output invariance across environments about Arjovsky's invariant risk minimization (IRM) principle. They derive a novel principle based upon label perturbation equivariance, dubbed Mirror Reflected IRM (MRI).\nThey prove their new approach can eliminate spurious feature dimensions for the case of a linear structural equation model more general than the one considered in Rosenfeld, et al 2020 regarding IRM-v1. In the nonlinear case, they propose optimization using the Augmented Lagrangian method with constraints on all environment pairs. On a newly introduced shape-texture dataset and two versions of the colored MNIST dataset introduced in Arjovsky et al 2019, they demonstrate that MRI-v1 outperforms ERM and IRM-v1, while coming close to the performance of an oracle.\n\nReviewer_5: This paper considered the invariant learning for out-of-distribution generation, under the data-generating process with Y \\to X. With Fig.1, the invariance regularization is proposed to learn the feature z_i that has invariant relation with y across domains, if the model from latent variable to the input is linear and the number of environments is large enough. Empirical studies are conducted on colored-MNIST and shape-texture linear regression datasets.\n\nReviewer_6: This manuscript presents a reciprocal formulation of the Invariant Risk Minimization criterion (Arjovsky et al 2019, arXiv:1907.02893). The authors first present a reformulation of IRM (Def 3.1) as Def 3.2. (\"Perturbation-based IRM\"), which is invariance perturbation\nThey state that Eq.(4) prescribes E-1 constraints, while Eq.(6) (which is equivalent to statements in Def. 3.1 and boldface IRM-v1 defined by Eq.(9) and surrounding text) produces E constraints. The authors claim this extra constraint causes inconsistency in IRM-v1 in comparison with the IRM criterion (eq. 4), which leads to poor performance.\nThe authors then propose a new invariance condition, MRI (mirror-reflected IRM) which is a perturbation condition on the loss in y (instead of a condition on the output x).\nThey provide empirical results using an implementation of MRI constraints on a standard architecture (LeNet)."
}