Venue: NeurIPS 2021 Conference

Reviews:

final_score: rating: 7: Good paper, accept
review_content: summary: The paper casts robustness to spurious correlations as a model's dependence on input data that is not stable under stress testing. Stress testing here corresponds to changing part of the input data that a practitioner believes should not change the prediction. The authors term this counterfactual invariance and consider two different causal structures that could've produced the data. Identifying distribution-level implications (as opposed to unit-level) of these causal structures, the authors propose regularization schemes to enforce when learning predictors to ensure that counterfactual-invariance holds (under certain assumptions). The effectiveness of these schemes is shown both theoretically and empirically.
main_review: This paper tackles an important problem (of building models robust to spurious correlations) in an interesting and well-motivated way (using independence implications of the assumed causal graph). The main idea of using this independence as regularization in learning representations is well-motivated. The theory supports the claims of generalizing to arbitrary distribution with the same causal structure (and mechanisms) as the one the training data comes from. This, shown in theorem 4.2, is the most illuminating part of the paper, I think.

Empirically, the proposed method seems easy to implement (at least when Z is of small cardinality) and the experiments indicate sizeable improvements. Showing the performance changing for different levels of regularization shed some light onto the workings of the method.

Could the authors explain why in theorem 4.2, the proposed counterfactual invariance property only helps guarantee out of performance generalization for certain kinds of correlations, like the guarantee for the causal-direction graph requires no confounding but works under selection? I suspect this is because the relationship between the label and the covariates can change but a simple of example of how the performance changes would be helpful.

Further, could the authors explain the significance of assuming Z is discrete? It seems like the first lemma depends on it.

Finally, could the authors comment about how one would go about choosing the causal structure over the anti-causal structure (vice versa) for some data at hand?


limitations_and_societal_impact: One limitation I can think of for this paper is where the additional variable Z has a large number of categories or is high-dimensional; for example, in the task of paraphrase detection, a possible Z is the number of matching words, length etc. The proposed MMD-based independence method might pose problems because the groups for each possible value-pair of Y, Z may be too small. in the high-dimensional case, most of these groups may have only a single sample.
review_title: null

final_score: rating: 7: Good paper, accept
review_content: summary: This paper presents conditions that are necessary for counterfactual invariant predictions under certain assumptions. They derive these from causal graphs and show the connection to worst-case domain generalization. Experiments on natural language datasets show that the proposed conditions do lead to a decrease in worst-domain error.
main_review: [Update] Increased my score based on the rebuttal. 

The paper presents a nice characterization of causal and anti-causal prediction tasks and the associated independence properties that follow from their respective causal graphs. The examples in Section 2 are useful to understand the main point. Rather than directly regularizing using ground-truth counterfactual examples as in past work, the paper claims to propose "necessary" conditions that can be measured by data. The connection to out-of-domain generalization is good for completeness.

My only reservation is that the paper's key result (the marginal or conditional independence regularizers) is very, very similar to recent line of work in domain generalization once you think of Z as a domain (different domains have perturbations on the non-causal features or their relationship with Y). As a result, it misses an opportunity to address the limitations that have been described for such regularizers. 

1) The "marginal regularization"  is the domain invariance condition for representation learning in domain adaptation/generalization (DG) and has been proposed by Muandet (2013), [Li et al](https://openaccess.thecvf.com/content_cvpr_2018/papers/Li_Domain_Generalization_With_CVPR_2018_paper.pdf). Further, recent work has also shown the fundamental issues with this regularization (see [Zhao et al.](https://arxiv.org/abs/1901.09453), [Akuzawa et al.](https://arxiv.org/abs/1904.12543)). The simplest case is where they do not work is when the distribution of Y, P(Y) changes across domains. Perhaps this is why authors needs to assume P(Y)=Q(Y) in Def. 4.1, but this seems a very strong assumption. It will be good to address this literature upfront when the regularizer is proposed---that will also help to justify Def. 4.1 more naturally.

2) The "conditional regularization" term is the class-conditional domain invariance condition (see, e.g.,  [Li et al. (b)](https://arxiv.org/abs/1807.08479), many works actually use the same metric MMD). Can the authors acknowledge this past work upfront in their manuscript since the regularization term is exactly the same? Again, as with 1, recent work has shown the limitations of this regularizer (see [Mahajan et al.](https://arxiv.org/abs/2006.07500)). That work claims that this regularizer is correct only when the distribution of causal features remains the same across domains. It will be good for the authors to discuss their regularizer in light of these results. There is an interesting discussion here, on whether there is a difference in assumptions between the DG literature and this work, or simply a notational difference.

Evaluation: The experiments on natural language tasks are a good addition to the DG literature which mostly focuses on image classification.  For that reason, it may be difficult to compare to the past work in DG. But perhaps the authors can compare their regularizers to simpler DG methods that can work for language tasks too, like contrastive matching over items with the same class but different Z (see [Motiian et al.](https://openaccess.thecvf.com/content_ICCV_2017/papers/Motiian_Unified_Deep_Supervised_ICCV_2017_paper.pdf)) How do the results compare? It is a bit odd to have no baselines on non-causal regularization approaches that have been proposed before.

Overall, I think this paper adds a nice twist to the standard domain generalization/adaptation regularizers and adapts it for robust learning with confounders. 


limitations_and_societal_impact: NA
review_title: null

final_score: rating: 6: Marginally above the acceptance threshold
review_content: summary: In this work, the authors focus on how to build models that are robust to spurious correlations. The focus of the paper is language datasets. The authors work with two types of DAGs -- a) association of the label with the invariant feature is anti-causal, and b) association of the label with invariant feature is causal. The authors propose a notion of invariance, which they call counterfactual invariance, that they require the predictor to satisfy. Under this notion, the prediction $f$ has to remain invariant under all the potential outcomes that $X$ can have under variations to the spurious feature $Z$. Since the notion of counterfactual invariance is hard to enforce as counterfactuals are not observed, the authors come up with necessary conditions that are then used as proxies to enforce counterfactual invariance. The necessary conditions are different in the two directions causal and anti-causal. Further, the authors analyze the relationship between best counterfactual invariant predictor on train domain and target domain (under appropriate notion of changes allowed in target domain). Finally, the authors establish conditions for min-max optimality of the predictor that is learned. 
main_review: The paper is very nicely written. The application to language models is particularly interesting and novel. I have a few concerns that I highlight below. 

1. **Counterfactual invariance notion in fairness**  The authors towards the end in the paper recognize that the notion of counterfactual invariance in an equivalent form already exists [Silva et al.]. Also, from the notion of counterfactual invariance, the necessary conditions that authors identified, which are very well known as demographic parity and equality of odds. Since there is so much overlap with the fairness literature, it is quite important to see the discussion where the notions are introduced and also following the theorem. Also, the authors should explain if they add theory to fairness literature. One would argue that there are papers that establish that equality of odds and demographic parity are not compatible is well-known. I believe that showing how one notion is better suited for one type of DAG and another for another type of DAG might be less well known in fairness literature. Also, another contribution that authors could highlight w.r.t fairness literature might be the connection of counterfactual fairness to demographic parity and equality of odds. 

2. **Counterfactual invariance notion in domain generalization** The notion that the authors introduced is very closely related and equivalent under some conditions to the notion of G-invariance in [Robey et al.]. In Robey et al., the authors introduced the notion that the prediction $f(X) = f(G(X,e))$. $G(X,e)$ can be understood as a model that generates the potential outcomes under different environments. I believe a discussion in the same place as to how the notion introduced by the authors and the notion in [Robey et al.] is related is very important. 


3. **Reconciling [Robey et al.] and the claims of the authors** In [Robey et al.], the authors learn the model $G$. In the terminology used in the current paper, we can say that the authors learned the model to generate the potential outcomes by observing the variations in the observational data. Finally using the model $G$ the authors enforce $G$-invariance. However, in this paper the authors claim that it is necessarily needed to know the causal or anti-causal direction and then use different penalties accordingly.  How to reconcile that we could learn the model for potential outcomes and not have to worry about two different necessary conditions - - demographic parity and equality of odds. A detailed discussion on whether it is really the case we cannot circumvent the need for knowing the causal direction is very important. 


4. **Examples of**  $X_Z^{\perp}$ The authors should actually provide mathematical examples in the paper to show how to decompose $X$ in the two DAGs. Currently, I had to look at the proofs to better understand this and I believe some examples of this can really help the reader. 

*** 

## References

[Silva et al.] Kusner, Matt J., Joshua R. Loftus, Chris Russell, and Ricardo Silva. "Counterfactual fairness." arXiv preprint arXiv:1703.06856 (2017). 

[Robey et al.]  Robey, A., Pappas, G. J., & Hassani, H. (2021). Model-Based Domain Generalization. arXiv preprint arXiv:2102.11436.
limitations_and_societal_impact: Yes, the authors have provided the limitations and have stated N/A for negative societal impact.
review_title: null

final_score: rating: 8: Top 50% of accepted NeurIPS papers, clear accept
review_content: summary: In this paper, the authors study counterfactual invariance in machine learning models---intervening on “non causal” parts of the input should not change model predictions---and its relation to how models generalize out-of-domain. The authors show that counterfactually invariant predictors rely more on “causal” features as opposed to spurious correlations, thus generalizing to unseen distributions where these spurious correlations may not hold. The authors further propose two regularization schemes (one if the underlying data generation mechanism is represented by a causal model and another if it is an anticausal model) using which we can train counterfactually invariant predictors without access to counterfactual examples---as opposed to most prior work in which researchers often seek to either automatically construct or crowdsource counterfactual examples. They show that these strategies are heavily dependent on the underlying causal mechanisms, and that applying the regularization scheme designed for a causal model could lead to worse performance if the underlying data generation mechanism was anticausal and vice versa. The authors offer empirical evidence on text classification tasks (review helpfulness classification and natural language inference) to support their theoretical findings. I have some concerns about the paper (as discussed below) but overall I believe this paper builds on an exciting line of work and offers good theoretical and empirical contributions.
main_review: - The paper is well motivated, and studies an important question of how predictive models may rely on causally relevant features or spurious correlations and the impacts on model performance out of domain. 
- This paper is a significant contribution to an emerging line of research. To the best of my knowledge, so far there is only one paper that offers a theoretical explanation for the relationship between counterfactual invariance and out-of-domain generalization [1]. This paper takes a different route but arrives at the same conclusion, advancing our theoretical understanding of counterfactual invariance.
- There are some gaps between the conditional independence signature proposed in the paper and counterfactual invariance, however, to the authors’ credit they acknowledge that as a limitation of their methodology. However, this is not limited to their work, in fact, this as they correctly point out, this is a limitation of working with observational data.
- The proposed regularization schemes are dependent on the underlying causal mechanism (causal vs anticausal). From a practical point of view, requiring one to have knowledge of the underlying causal direction between the covariates and the label of interest can be a limiting factor in practical utility of proposed regularization schemes, as a mismatch between the enforced independence condition and underlying causal structure can lead to worse out of domain performance.
- The paper does not offer a discussion of prior work that provides an explanation for the effectiveness of counterfactual invariance as it relates to out-of-domain generalization. I believe this can be easily fixed in a future version. The paper could in general use a better discussion of related work, especially as it relates to Peters et al. (2016).
- The empirical investigation also has some limitations: first, I think the experiments section could use some background on dataset selection, processing, etc. Second, the whole focus of this paper is on how counterfactually invariant predictors generalize better to out of domain data. However, despite the presence of multiple datasets (representing plausible distribution shifts) for the tasks of how helpful a review is---check Yelp dataset, you can construct various test sets (businesses, restaurants, etc.)---and for natural language inference, the experiments are restricted only to Amazon reviews (from one category) in the former and MNLI in the latter. These results would be more convincing if the authors show that these results (better ood performance) hold on a battery of out-of-domain datasets.

I'm happy to improve my score if the authors can address these concerns.

There’s a typo on Line 252: “conditinal” → “conditional”

Curiosity question: Did you try experiments with regularizing the causally mismatched MMD on domain shift?

Missing references:

[1] Divyansh Kaushik, Amrith Setlur, Eduard H. Hovy, and Zachary Chase Lipton. "Explaining the Efficacy of Counterfactually Augmented Data." In International Conference on Learning Representations. 2021.


--------------------------------------------------------------------------------------
I have read the author response, including the clarifications offered and the additional details promised by the authors that would appear in the final draft. I will keep my score as before and recommend a strong acceptance for this paper and encourage the authors to continue pursuing this line of research.
limitations_and_societal_impact: I believe that the authors have provided a sound discussion of the limitations of proposed regularization schemes. But as they also showed in their experiments, regularizing causally mismatched MMD could make the model more reliant on spurious patterns, thus I would like the authors to include a discussion of how this limitation could potentially lead to catastrophic failures in critical applications.
review_title: null

Meta-review: All reviewers have given very positive reviews with positive revisions after the discussion.

Briefly, the notion of counterfactual invariance discussed, its relation to stability against spurious variation and different conditions/regularization depending on the DAG model that is needed to enforce it have been well appreciated. Empirical results on text have been satisfactory as well. 

There remains some minor concerns which authors have promised to address in their response. I encourage the authors to add additional material that they have promised to various reviewer concerns.


Decision: Accept (Spotlight)