Causal Effect Regularization: Automated Detection and Removal of Spurious Correlations
Authors: Abhinav Kumar
Amit Deshpande
Amit Sharma
Venue: NeurIPS 2023 poster (2023)
Keywords: Spurious Correlation
Out of Distribution Generalization

Abstract: In many classification datasets, the task labels are spuriously correlated with some input attributes. Classifiers trained on such datasets often rely on these attributes for prediction, especially when the spurious correlation is high, and thus fail to
generalize whenever there is a shift in the attributes’ correlation at deployment. If we assume that the spurious attributes are known a priori, several methods have been proposed to learn a classifier that is invariant to the specified attributes. However, in real-world data, information about spurious attributes is typically unavailable. Therefore, we propose a method that automatically identifies spurious attributes by estimating their causal effect on the label and then uses a regularization objective to mitigate the classifier’s reliance on them. Although causal effect of an attribute on the label is not always identified, we present two commonly occurring data-generating processes where the effect can be identified. Compared to recent work for identifying spurious attributes, we find that our method, AutoACER, is
more accurate in removing the attribute from the learned model, especially when spurious correlation is high. Specifically, across synthetic, semi-synthetic, and real-world datasets, AutoACER shows significant improvement in a metric used to quantify the dependence of a classifier on spurious attributes ($\Delta$Prob), while obtaining better or similar accuracy. Empirically we find that AutoACER mitigates
the reliance on spurious attributes even under noisy estimation of causal effects or when the causal effect is not identified. To explain the empirical robustness of our method, we create a simple linear classification task with two sets of attributes: causal and spurious. Under this setting, we prove that AutoACER only requires the ranking of estimated causal effects to be correct across attributes to select the
correct classifier.

Causal Effect Regularization: Automated Detection and Removal of Spurious Correlations
Abhinav Kumar Microsoft Research abhinavkumar. wk@gmail. com
Amit Deshpande
Amit Sharma Microsoft Research
Microsoft Research
wwwttddeemiirrsooooioio com
mushhar@iccrosen com
Abstract
In many classification datasets, the task labels are spuriously correlated with some input attributes. Classifiers trained on such datasets often rely on these attributes for prediction, especially when the spurious correlation is high, and thus fail to generalize whenever there is shift in the attributes' correlation at deployment. If we assume that the spurious attributes are known a priori, several methods have been proposed learn classifier that is invariant the specified attributes. However, in real-world data, information about spurious attributes is typically unavailable. Therefore, we propose method that automatically identifies spurious attributes by estimating their causal effect on the label and then uses a regularization objective mitigate the classifier's reliance on them. Although causal effect of an attribute on the label is not always identified, we present two commonly occurring data-generating processes where the effect can be identified. Compared to recent work for identifying spurious attributes, we find that our method, ACEE, is more accurate removing the attribute from the learned model, especially when spurious correlation is high. Specifically, across synthetic, semi-synthetic, and real-world datasets, AutoACER shows significant improvement in a metric used quantify the dependence of a classifier on spurious attributes (AProb), while obtaining better or similar accuracy. Empirically we find that AutoACER mitigates the reliance spurious attributes or when the causal effect is not identified. To explain the empirical robustness our method, we create simple linear classification task with two sets of attributes: causal and spurious. Under this setting, we prove that AutoACER only requires the ranking of estimated causal effects to be correct across attributes select the correct classifier.
under noisy estimation of causal effects
Introduction
When trained datasets where the task label is spuriously correlated with some input attributes. machine learning classifiers have been shown to rely on these attributes (henceforth known as spurious attributes) for prediction [10 23 [T]. For example in sentiment classification dataset that we evaluate (Twitter-AAE [4). demographic attribute like race could be spuriously correlated with the sentiment of sentence [9]. Classifiers trained such datasets are risk of failure during deployment when the correlation between the task label and the spurious attribute changes 2 12 30 [0].
Assuming that a set of auxiliary attributes available at training time (but not at test time), several methods have been proposed to mitigate the classifier's 's reliance the spurious attributes. The first category of methods assumes that the spurious attributes are known a priori. They develop regularization 33 [5] 22), optimization [30] or data-augmentation [17 16 [4] strategies to train a classifier invariant to the specified spurious attributes. The second category of methods relaxes the assumption of known spurious attributes by automatically identifying the spurious attributes and
37th Conference on Neural Information Processing Systems (NcurIPS 2023).

---

STAGE Estimate Causal Effect
STAGE 2 Causal Effect Regularization
True Causal Effect
Evaluation Metrics Classifier
Estimatedd Effect
Lowe Edtmatioon
Error
Regubetion Causal Effect
(2))
Spurlousness (AProh)
Avg Group
Low Spurious Correlation
Effect (xtimate(C,...) > Effect Extimata(s
AzE
(2))
Spurious Attr.
Eddinatedd Effect
P
High Esdimatto Eror
o Trask Alir.
Regularize
(c)
Causel Effect
High Spurious Correlation
Effect Extimata(C, Effect Entimate (S..
S spuriousness (AProb)
Group
Causal Attribute (c)
Spuricuu Altribute (2,
DRRMPrIOr Method
Figure 1:
To reduce dependence on spurious attributes in classifier, our method AutOACER has two stages. Stage I (middle panel) estimates the causal effect of attributes on the task label. Stage 2 (right panel) ensures that the causal effect of each attribute the classifier's prediction matches its estimated causal effect on the task label. In the bottom panel, due to high spurious correlation the estimation of average causal effect is error-prone. AutoACER works well even in such high correlation scenarios as shown by the Spuriousness score, AProb (see definition in
regularizing the classifier to be invariant them. To identify spurious attributes, these methods impose assumptions on the type of spurious correlation they deal with. For example, they may assume that attributes are modified in input via symmetry transformation [55] or group transformation 24]. or the gentrateneatingg process follows specific graph structure such as anti-causal (38) However, all these methods assume a strict dichotomy-eve every attribute either spurious or not oothh makes them susceptible to imposing incorrect invariance whenever there is mistake in identifying the spurious attribute.
In this paper, we propose a method that regularizes the effect of attributes on a classifier proportional to their average causal effect on the task label, instead of strictly binning them as spurious (or not) using an arbitrary threshold. We propose two-step method that (1) uses an effect estimation algorithm to find the causal effect of a given attribute; (2) regularizes the classifier proportional the estimated causal effect for each attribute estimated in the first step. We call the method AutoACER, Causal Effect Regularization for automated removal of spurious correlations. If the estimated causal effects are correct, AutoACER is perfect in removing a classifier's ' reliance on spurious attributes (i.e., attributes with causal effect close zero), while retaining the classifier's acceuracy. But in practice is difficult to have good estimates of the causal effect due to issues like non-identifiability. noise in the labels 399, , or finite sample estimation error 3. Under such conditions, we find that AutoACER is more robust than past work (25) since it does not group the attributes as spurious or causal and regularizes the classifier proportional to the estimated effect.
We analyze our method both theoretically and empirically. First, we provide the conditions under which causal effect is identified. An implication of our analysis is that causal effect is identified whenever the relationship between the attribute and label is fully mediated through the observed input (e.g, text or image). This is often the case in real-world datasets where human labellers use only the input to generate the label. Even if the causal effect is not identified, we show that AutoACER is robust errors in effect estimation. Theoretically, on simple classification setup with two sets of attributes-can causal and spurious-we prove that only the correct ranking of the causal effect estimates needed to learn a classifier invariant to spurious attributes. For the general case with multiple disentangled high-dimensional causal and spurious attributes, under the same condition on correct causal effect rankings, we prove that the desired classifier (that does not use spurious attributes) is preferred by AutoACER over the bascline ERM classifier.
To confirm our result empirically, we use three datasets that introduce different levels of difficulty in estimating the causal effect of attributes: (1) Syn-Text: synthetic dataset that includes an unobserved confounding variable and violates the identifiability conditions causal effect estimators;
(2) MNIST34: semi-synthetic dataset from (24), where we introduce noise in the image labels;
(3) AAE:, which is real-world text dataset. To evaluate the robustness of methods to spurious correlation, we create multiple versions of each dataset with varying levels of correlation with the spurious attribute, thereby increasing the difficulty to estimate the causal effect. Even with a noisy
2

---

For classification task, let (ar', ,y, a y²))__1 ~ Pm be the set of example samples from the data distribution P. where x' E X are the input features, y' E Y are the task labels and a² = (ai...., at)) aj A, are the auxiliary attributes, henceforth known as attributes for the example x We use "xa," to denote an example "x" to have attribute aj E AA. These attributes are only observed during the training time. The goal of the classification task referred to as task henceforth, is to predict the label y" from the given input x'. The task classifier can be written as c(h(z)) where h X - Z is an the classifier on estimate of the causal effect of attributes, our method shows significant improvement over previous algorithms in reducing the dependence of classifier on spurious attributes, especially in the high correlation regime. Our contributions include,
Causal effect identifiability guarantee for two realistic causal data-generating processes, which is the first step to automatically distinguish between causal and spurious attributes.
A method, AutoACER, to train a classifier that obeys the causal effect of attributes on the label.
Under a simplified setting, we show that it requires only the correct ranking of attributes.
Evaluation on three datasets showing that AutoACER is effective at reducing spurious correlation even under noisy, high correlation, or confounded settings.
2 OOD Generalization under Spurious Correlation: Problem Statement
encoder mapping the input ar to a latent representation == (xr) and e Z top of the representation Z.
Generalization to shifts in spurious correlation. We interested in the setting where the data-generating process is causal [31] i.c. there is a certain set of causal attributes that affect the task label y. Upon changing these causal attributes, the task label changes. Apart from these attributes, there could be other attributes defining the overall data-generatin attribute e E C called spurious attribute if it correlated with the task label in the training dataset and thus could be used by classifier trained to predict the task label, as a shorteut [38] (22. But their correlation could change at the time of deployment, affecting the classifier's 's accuracy.
process (see Fig. 2 [ examples).
Using the attributes available at training time, our goal is to train a classifier c(h(x)) that is robust to shift in correlation between the task label and the spurious attributes. We the fact that changing spurious attributes will not lead to a change in the task label i.e. they have zero causal effect on the task label y. Hence, we use the estimated causal effect of an attribute automatically identify its degree of spuriousness. For spurious attribute, its true causal effect on the label is zero and hence the goal is to ensure its causal effect on the classifier's prediction also zero. More generally, we would like to regularize the effect of each attribute on the classifier's 's prediction to its causal effect on the label. In other words, unlike existing methods that aim to discover a subset of attributes that are spurious (24] 25 38), we aim to estimate the causal effect of each attribute and match it. Since our method avoids hard categorization of attributes that downstream regularizers need to follow, we show that is a more robust way of handling estimation errors when spurious correlation may be high.
3 Causal Effect Regularization: Minimizing reliance on spurious correlation
We now describe our method to train classifier that generalizes to shift in attribute-label correlation by automatically identifying and imposing invariance w.r. to spurious attributes. In $3.1 we provide sufficient conditions for identifying the causal effect, crucial first step detect the spurious we present the AutoACER method and its theoretical analysis.
attributes. Next, in $ and $3.3]
3.1 Causal Effect Identification
Since our method relies on estimating the causal effect of attributes on the task label, we first show that the attributes' causal effect is identified for many commonly ocurring datasets. The identifiability of the causal effect of an attribute depends on the data tetttaggnnratnng process (DGP). Below we present two illustrative DGPs (DGP-1 and DGP-2 from Fig. 2 under which the causal effect is identified. DGP-/ refers to the case where the task label is generated based on the observed input X which in turn may be caused by observed and unobserved attributes. DGP-/ is common in many real-world datasets where the task labels are annotated based on the observed input either automatically using Thus DGP-1 is applicable for all
some deterministic function or using human annotators 17 29
3

---

the settings where the input X has all the sufficient information for creating the label. Mouli and Ribeiro [25] consider another DGP where set of transformations (like rotation or vertical- -flpss in image) over base (unobserved) image generates the input X. We adapt their graph to our setting where we include each observed attribute as node in the graph, along with hidden confounders. Depending on whether they are spurious or not, these attributes may cause the task label Y. DGP-2 and DGP-3 represent two such adaptations from their work, with the difference that DGP-3 also allows unobserved attributes to cause the task label.
Generally for identifying the causal effect one assumes that we only have access to observational data (P). But here we also assume access to the interventional distribution for the input, P(X]do(A) where the attribute A is set to a particular value, as in [24]. This is commonly available in vision datasets via data augmentation strategies over attributes like rotation or brightness, and also in text
datasets using generative language models [ 37 Having access to interventional distribution P(X do A)) could help us identify the causal effect in certain cases where observational data (P) alone cannot as we see below.
Proposition 3.1. Let DGP-1 and DGP-2 in Fig. 2 be the causal graphs of two dataa-gnnerating processes. Let A, C,S be different altributes, X be the observed inpul, Y be the observed task label and U be the unobserved confounding variable. In DGP-2, x is the (unobserved) core inpus feature that affects the label Y. Then:
1. DGP-1 Causal Effect Identifiability: Given the interventional distribution P(X]do(A)) the causal effect of the attribute A on task label Y is identifible using observed data distribution.
2. DGP-2 Causal Effect Identifiability: Let C' be a set of observed attributes that causally affect the task label Y (unknown to us). S be the set of observed attributes spuriously correlated with task label Y (again unknown to us), and let V = CUS S be the given set of all the attributes. Then if all the causal attributes are observed then the causal effect of all the attributes in V can be identified using observational data distribution alone.
Proof Sketch. (1) We show that we can identify the interventional distrihution P(Y]do(A) (A)) which is needed to estimate the causal effect of A on Y using the given observational distribution P(Y|X) and interventional distribution P(X [d)(A). (2) For both causal attribute C' and spurious attribute S, we show that we can identify the interventional distribution P(Y (Y)))(S) or P(Y (do(C)) using purely observational data using the same identity without the need to know whether the variable is causal or spurious a priori. See $B for proof.
Note that DGP-1 and DGP-2 are not exhaustive. We provided them simply illustrative examples to show that there exist DGPs, corresponding to commonly occurring datasets, where the attributes' effect is identified. However, the effect not identified in DGP-3 and possibly other DGPs. Moreover, in practice, the underlying DGP for given task may not be known or mis-specified. Hence. in $3.2 we design our method AutoACER such that it does not depend on knowledge of the true DGP. When the effect is identified, our method is theoretically guaranteed to work well. Empirically, as we show in Section 4 our method also works to remove the spurious correlation for datasets corresponding to DGP-3 where the causal effect of A on Y is not identified. In comparison, prior methods like Mouli and Ribeiro (25 provably fail under DGP-3 (see for the proof that their method would fail to detect the spurious attribute).
3.2 AutoACER: Causal Effect Regularization for predictive models
Our proposed method proceeds in two stages. In the first stage, it uses a causal effect estimator to identify the causal effect of an attribute on the task label. Then in the second stage, it regularizes the classifier proportional to the causal effect of every attribute.
Causal Effect Estimation, Given a set of attributes A = fai...., 0+ }. the goal of this step to estimate the causal effect (T. of every attribute E A. The causal effect of attribute on the label Y is defined as the expected change in the label Y when we change the attribute (see A for formal definition). our Prop 3.1 gives us sufficient conditions needed to identify the causal effect. Then one can use appropriate causal effect estimators that work under those conditions or build their own estimators using the closed form causal effect estimand given in the proof of Prop 3.1 However, to build
Stage 1:
the data-generating process of the task is one of DGP-1 or DGP-2,

---

DGP-1
DGP-2
DGP-3
Figure 2: Causal graphs showing different data- data-generating processes. Shaded nodes denote observed variables; the red arrow denotes an unknown target relationship. Node denotes the observed input features and node Y denotes the task label in all the DGPs. Node A refers attributes; could denote either causal or spurious attribute. If A is a causal attribute then the red arrow will be present in the underlying true graph otherwise not. Node U denotes the unobserved confounding variable which could be the potential reason for spurious correlation between an attribute (A or S) and Y. The node C in DGP-2 denotes causal attributes and node S denotes spuriously correlated attributes. The node x in DGP-2 and DGP-3 denotes the unobserved causal attribute that creates the label Y along with other observed causal attributes (C or A). the first two graphs, the causal effect of attributes (A and C, S respectively) on Y is identified (see Prop 3.1.
general method, we propose technique that does not assume knowledge of the DGP. Specifically, we use a conditioning-
estimator (based on the backdoor criterion (27]) and assume the observed variables (X) as the backdoor variables. There is rich literature on estimating causal effects for We use deep learning-based estimator from Chernozhukov et al. (6] to estimate the causal effect (henceforth called Riesz). Given the treatment along with the rest of the covariates, it learns a common representation that approximates backdoor adjustment to estimate the causal effect (see S for details). Even the causal effect in the relevant dataset is identifiable, might get noisy estimate of the effect due to finite sample error or noise in the labels. Later in $3.3 and X we will show that our method is robust to error in the causal effect estimate attributes baseline effect estimator,
high dimensional data 122 33 6
the direct effect estimator (henceforth called Direct) defined as Ex (E (E X, a 1) - E(Y a=
both theoretically and empirically. Finally,
= 0)) for attribute
E A that has limited identifiability guarantees (see $ for details).
Stage2: Regularization. Here our method regularizes the model prediction with the estimate of causal effect (T ..., T,,,,FF,, TF..) of each attribute A = {ai1..., The loss objective is,
LAutAACER = (/ (Lock (c(h(z)). v) + R CReg (a.8)
where R is the regularization strength hyperparameter, P is the training data distribution ( The first term Ltask (c(h(z))) y) can be any training objective e.g. cross-entropy or max-margin loss for training the encoder li and task classifier e jointly to predict the task label given input a. Our regularization loss term Litgg aims to regularize the model such that the causal effect of an attribute on the classifier's output matches the estimated causal effect of the attribute a, the label. Formally,
Σ
B(n.))-(aan)) (dd((()))))) )c(ME)) T -Tas
Lieg
(=(1......1AA
where Teg ~ Q(x,e,) be sample from counterfactual distribution 2 = P( (2r,)) and nee the input had the attribute in input Vc been d/.
3.3 Robustness of AutoACER with noise in the causal effect estimates
Our proposed regularization method relies primarily on the estimates of the causal effect of any attribute e, regularize the model. Thus, it becomes important study the efficacy our method under error or noise in causal effect estimation, which is expected in real-world tasks due to finite sample issues, incorrect choice of causal effect estimators, or due to properties of the unknown underlying DGP. We consider a simple setup to theoretically analyze the condition under which our method will train better classifier than the standard ERM max- max-margin objective (following previous work [99 13 261) in terms of generalization to the spurious correlations. Let A (cai,..... cu,, sp1,.... } be the set of available attributes where caą are causal attributes and sp, are the spurious attributes. For simplicity, we assume that the representation encoder mapping X to Z i.e h X > Z frozen and the final task classifier (c) is a linear operation over the representation. Following Kumar et al. 19 we also assume that z is disentangled representation
5

---

w.r.t the causal and spurious attributes, i.e. the representation vector & can be divided into two subsets, features corresponding to the causal and spurious attribute respectively. Thus the task classifier takes the form c(z) = Σx=1 Weas Eca + ΣE=1 Wap; =xp, Note that we make the disentanglement assumption only for creating simple setup so that we can theoretically study the effectiveness of our method in the presence of noisy estimates of the causal effects. Our method does not require this assumption.
Let Least (0; (a, Bm)) be the max-margin objective (see $ for details) used to train the task classifier "c" to predict the task label Vm given the frozen latent space representation z. Let the task label y and the attribute "a" where a E A be binary taking value from (0. 1). The causal effect of an attribute E A on the task label Y given by T E. E = 1) E(Y]do(a)
0) P(y = 1/do(a) 1) P(y = 1 0) (see $ for definition). Thus the value of the causal effect is bounded s.t. TE. E [-1,1] 1] where the ground truth causal effect of spuriously correlated attribute "sp" is T Tssp = O and for causal attribute "ca" is [T Fea > O. Given that we assume a linear model, instantiate simpler form of the regularization term Liteg for the training objective given in Eq.
L Reg =
Σ k= (1,
Aeas | llp
Σ (112......))
AspyllWsp llp
where Aeas e/|TE and Aap, = E/pT are the regularization strength for the causal and spurious features Zea, and Esp; respectively, |. is the absolute value operator and || p is the Lp norm of the vector w. Since [T E [0, 1]. we have X(-) 1/ 1. In practice, we only have access to the empirical estimate of the causal effect T (.)) denoted as T'E() and the ready to state the main theoretical result that shows our regularization objective will learn the correct classifier which uses only the causal attribute for its prediction, given that the ranking of estimated treatment effect is correct up to some constant factor. Let [S] denote the set S}}.
regularization coefficient becomes A() 1/) Now
Theorem 3.1. Let the latent space be frozen and disentangled such that z [Zeas.... Zeak: : Zepi..... Reps] (Assm D.1y. l.. Let the desired classifier gls (z)= >K wdes Zcoo be the max max-margin classifier among all linear classifiers that only the causal features Zcaz for prediction. Let cmm (z) Σk Wean Zeaz + EE==1 Waps Zap, be the max-margin classifier that uses both the causal and the spurious features, and let w sps + O. Vj E [J]. We assume w of O, Mj E [,], without loss of generality because otherwise, we can restrict our attention only to those i.e 1 ΣK 1l 1|p=2 1. Then if regulaiization coefficients
j E [J] that have w wimm f O. Let the norm of the parameters of both the classifier be
sp,
Σ K
Ek= 1 c04 1 Ej=11l
{{ {Pae
Donns Xapp
dea oug.
|||
mm ll
are related s.t. mean
This (EEKK)AE|T
where mhe
then
Preference: LAuteACEn(dess (z)) < CAAtOACEn (cmmm Thus, our causal effect regulariza-
tion objective (Def 3 which uses the spurtously correlated feature.
will choose the (z) classifier over the max-margin classifier cm (x)
Global Optimum: The desired classifier (z)) is the global optimum of our loss function LAutOAEER when J = K 1, = 2, the regularization strength are related s.t. deas < Xep. (T' > [T'E and search space of linear classifiers e(z) are restricted to have the norm of parameters equal to 1.
Remark. The result of Theorem 3.1 holds under more intuitive but stricter constraint on the regu- larization coefficient X which states that Xan; > (FI1s)) )>cas. = IT'E.p,) ( (T' vk E [K] and j E [J]. The above constraint states that if the treatment effect of the causal feature is more than that of the spurious feature by constant factor then the claims in Theorem 3.7 hold.
Proof Sketch. (1) We compare both the classifier (ee and (z) using our overall training
objective to our training objective LAutDACER (Eq, D. Given the relation between the regularization
strength mentioned in the above theorem satisfied, we then show that one can always choose
regularization strength "R" greater than constant value s.t classifier nm incurs greater

---

regularization penalty than (2))(2) (Eq. 3 which is not compensated by the gain in the max margin objective of e (z) over (2))(2) Thus, the desired classifier cde((z) ) has lower overall loss than the c (z) in terms of our training objective AastoACER. (2) We use the result from the first claim
to show that edea (z) has lower loss than any other classifier that uses the spurious feature 2sps Then, among the classifier that only uses the causal feature cca, show that again dd= has the lower loss w.r.t. AutoACER Thus the desired classifier has a lower loss than all other classifiers w.r.t Actt with parameter norm 1 hence global optimum. Refer $D for proof.
4 Empirical Results
4.1 Datasets
Theorem showed that our method can find the desired classifier in a simple linear setup. We now evaluate the method synthetic, semi-synthetic and real-world dataset. Details are in $E
Syn-Text. We introduce synthetic dataset where the ground truth causal graph is known and thus the ground truth spuriously correlated feature is known apriori (but unknown to all the methods). The dataset contains two random variables (causal and confound) that cause the binary main task label V/m and the variable spurious is spuriously correlated with the confound variable. Given the values of spurious and causal features, we create a sentence as input. We define Synn-Txt-Obs-CC Conf- a version of the Syn-Tex Tyn-Text dataset where all three variablessattrriuttes are observed. Next, to increase difficulty, we create a version of this dataset- - Syn-Tex-e Saaut--nnoo-CCaan observed in the training dataset, corresponding to DGP-3 from Fig. 2
where the confound attribute is not
MNIST34. We use MNIST 20 to compare our method on a similar semi-synthetic dataset as used in Mouli and Ribeiro (25.. We define a new task over this dataset but use the same attributes, color, rotation, and digit, whose associated transformation satisfies the lumpability assumption in their work. We define the digit attribute (3 and 4) and the color attribute (red or green color of digit) as the causal attributes which creates the binary main task label using the XOR operation. Then we add rotation (0" or 90") ) to introduce spurious correlation with the main task label. This dataset corresponds to DGP-2, where C is color and digit attribute, S is rotation attribute and is an empty set.
Twitter-AAE 4 This is a real-world dataset where the main task predict a binary sentiment label from a tweet's text. The tweets are associated with race of the author which is spuriously correlated with the main task label. Since this is real-world dataset where we have not artificially introduced the spurious attribute we don't 'ont have ground truth causal effect of race on the sentiment label. But we expect it to be zero since changing race of person should not change the sentiment of the tweet. We use GPT3 (5] to create the counterfactual example by prompting it to change the race-specific information in the given sentence (see for examples). This dataset corresponds to DGP-1, where the node A is the spurious attribute race.
Varying spurious correlation in the dataset. Since the goal is to train model that doesn't 't rely on the spuriously correlated attribute, we create multiple settings for every dataset with different levels of correlations between the main task labels ym and spurious attribute Ye.p Following [1),, we use predictive correlation metric to define the
correlation that we vary in our experiments. The predictive correlation (x) measures how informative one label or attribute (s) is for predicting
the other (t), k := Pr(s = t) = Σx= [[s = t)/N, where N is the size of the dataset and 1..] is the indicator function that is 1 if the argument is true otherwise O. Without loss of generality, assuming s = 1 is correlated with t = and similarly, s = is correlated with t = O: predictive correlation lies indicates that the attributes are fully
in K [0.5, 1] where x- = 0.5 indicates no correlation and correlated. For Syn-Text dataset, we vary the predictive correlation between the confound attribute and the spurious attribute; for MNIST34, between the combined causal attribute (digit and color) and the spurious attribute (rotation); and for Twitter-A.A AAE, between the task label and the spurious attribute (race). See S for details.
4.2 Baselines and evaluation metrics
Baselines. We compare our method with five baseline algorithms: (i) ERM: Base algorithm for training the main task classifier using cross-entropy loss without any additional regularization. (ii) Mouli+ CAD: The method proposed in [25] to automatically detect the spurious attributes and
7

---

-1000
-590
10000
-1200
-100
-1300
-150
-1400
-2500
-3000
-200
-1500
mtaatin
-3500
0.7
0.9
170
0.15
0.7
0.9
predtictive correlation
corrolation
predictive correlation
(a) Syn-Text-Unobs Sooost-nnos-Coonl dataset
(b) MNIST34 dataset
(c) Twitter-AAE dataset
Figure 3: Detecting spurious attribute using Mouli+CAD: x-axis is the predictive correlation and y-axis shows the score defined by Mouli+CAD. The orange curve shows the score for true spurious attribute. The blue curve shows the score for setting when Mouli+CAD considers none of the given attributes as spurious. The attribute with the lowest score is selected as spurious. If the blue curve has the lowest score for dataset with predictive correlations (x), Mouli+CAD will not declare any attributes as spurious for that K. (a) and (b). Mouli+CAD fails to detect the spurious attribute at high k. (c) Mouli+CAD correctly identifies the race attribute as spurious.
train a model invariant to those attributes. Given set of attributes, this method computes a score for every subset of attributes, selects the subset with minimum score as the spurious subset, and finally enforces invariance with respect to those subsets using counterfactual data augmentation (CAD) (iii) MouditAutoAAERR: Empirically, we observe that CAD does not correctly impose invariance for given attribute (see $F for discussion). Thus we add a variant of Mouli+CAD's method where instead using CAD it uses our regularization objective (Eq. 2 to impose invariance using the causal effect T E. = 0 for some attribute "a". (iv) Just Train Twice 21 (J77): Given known spurious attribute, JTT aims to train a model that performs well on all subgroups of the dataset, where subgroups are defined based different correlations between the task label and spurious attribute. Unlike methods like GroupDRO [30], JTT requires (expensive) subgroup labels only for the examples in the validation set. (v) Invariant Risk Minimization 12) (IRM): This method requires access to multiple environments or subsets of the dataset where the correlation between the spurious attribute and task label changes and then it trains classifier that only uses the attributes with stable correlations across environments (see for experimental setup).
B2 16.
Metrics. We use two metrics for evaluation. Since all datasets have binary task labels and attributes, we define a group-based metric (average group accurucy) to measure generalization under distribution shift. Specifically, given binary task label E {0, 1} and spurious attribute E {0, 1} Following Kumar et al. [19] we define
groups, one for each combination of (y, a). The subset of 0) are the majority group Smaj while groups (y = 1, a = 0) and (y = 0, a = 1) make up the minority group Smin. We expect the main classifier to exploit this correlation and hence perform better on Smaji but badly Smin where the correlation breaks. Thus we want a method that performs better on the average accuracy on both the groups i. Aec(Sman)) where Acc(Smaj) and Ace(Smin) are the accuracy on majority and minority group respectively. The second metric (AProb) measures the reliance of a classifier on the spurious feature. For every given input 2a we have access to the counterfactual distribution (æxr) Q(xx)
the dataset with (y = a,a 1) and (y 0,
(22) where the attribute A = a is changed to A a'. AProb is defined as the change in the prediction probability of the model on changing the spurious attribute in the input, thus directly measuring the reliance of the model on the spurious attribute. For background on baselines refer SA a detailed description of our experiment setup refer
4.3 Evaluating Stage 1: Automatic Detection of Spurious Attributes
Failure of Couli+CAD in detecting the spurious attributes at high correlation. In Fig. 3 we test the effectiveness of Mouli+CAD to detect the subset of attributes which are spurious on different datasets with varying levels of spurious correlation (n). In Syn-Text dataset, at low correlations (N 0.8) Mouli+CAD correctly detects spurious attribute (orange line is lower than blue). As the correlation increases, their method incorrectly states that there is no spurious attribute (blue line lower than orange). MNIST34 dataset, Mouli+CAD does not detect any attributes as spurious (shown by blue line for all x). For Twitter-AAF dataset, Mouli+CAD's method is correctly able to detect the spuriously correlated attribute (race) for all the values of predictive correlation, perhaps because the spurious correlation is weak compared to the causal relationship from causal features to task label.
8

---

Table I: Causal Effect Estimate of spurious attribute. Direct and Riesz are two different causal effect estimators as described in $3.2 Overall we see that Riesz performs better or comparable the baseline Direct and closer to ground truth value O. Since Twitter-AAF AAE is a real dataset we don't 't have a ground causal effect of race attribute but we expect be zero (see
Predictive Correlation (x)
Dataset
True
Method
0.5
0.6
0.7
0.8
0.9
0.99
Direct
0.00
0.00
0.01
0.08
0.16
0.22
0
Riesz
0.00
0.03
0.03
0.03
0.05
0.15
Direct Riesz
-0.01
0.13
0.24
0.37
0.49
0.67
Syn- Tenn-Tex-Unnos-CCr
0
0.06
0.19
0.31
0.42
0.58
0.70
Direct Riesz
0.02
0.03
0.05
0.06
0.15
0.27
MNIST34
0
-0.01
0.06
0.05
0.04
0.2
0.31
Direct Riesz
0.01
0.07
0.12
0.20
0.27
0.31
Twitter-AEE
0.02
0.07
0.12
0.17
0.27
0.37
AXSACM
Mout AuroAce
Aerage GUApkCCURRS
Anrogg Suap
0.9-
0..0
0.8
0.6
0.5
0.01
0.5
0.5
0.11
corrulation
correlation.oo
corrlatiion
0.8
0.7
0.7
Taak dha
11I
Ehit
0.5
0.4-
0.4
predh clive correla wlatraation (4)
predi clive COTT clution Lt)
prede dlvee corrulation
(a) Unobs-Conf
(b) MNIST34
(c) Twitter-AAF
Figure 4: Average group accuracy (top row) and AProb (bottom row) for different methods. x-axis denotes predictive correlation (x) in the dataset. Compared to other baselines, (a) and (b) show that AutoACER performs better or comparable in average group accuracy and trains a classifier significantly less reliant to spurious attribute as measured by AProb. In (a), IRM has lower APoob as compared to other methods but performs worse on average group accuracy. Mouli+CAD performs better in average group accuracy in (c) but relies heavily on spurious attribute shown by high AProb whereas AutoACER performs equivalent to all other baselines on average group accuracy with lowest APoo among all.
AutoACER is robust to error in the estimation of spurious attributes. Unlike Mouli+CAD's method that does a hard categorization, AutoACER estimates the causal effect of every attribute on the task label as fine-grained measure of whether an attribute is spurious not. [ the estimated treatment effect spurious attributes in every dataset for different levels of predictive correlation (x). We use two different causal effect estimators named Direct and Riesz with the best estimate selected using validation loss (see { Overall, the Riesz estimator gives a better or comparable estimate of the causal effect of spurious attribute than Direct, except in the Sex-Text- Unobs-Com dataset where the causal effect is not identified. At high predictive correlation 0.9), expected, the causal effect estimates are incorrect. But as we will show next, since AutoACER uses a continuous effect value to detect the spurious attribute, it allows for errors in the first (detection) step to not affect later steps severely.
4.4 Evaluating Stage 2: Evaluation of AutoACER and other baselines
Fig. compares the efficacy of our method with other baselines in removing the model's reliance on spurious attributes. On Syn- Syn-Texx-Unnon Text-Unobs-Con dataset, our method (AutoACER) performs better than all the other basclines for all levels of predictive correlation (x) on average group accuracy

---

(first row in Fig. 4ap. In addition, AProb (the sensitivity of model on changing spurious attribute in input, see 4.1 for our method the lowest compared to other baselines (see bottom row of Fig. 4ap. For K: 2 0.8, Mouli+CAD is the same as ERM since it fails to detect the spurious attribute and thus doesn't 't impose invariance w.r.t the spurious attribute. (Fig. 3a for details). On MNIST34 dataset, the average group accuracy of all methods is comparable (except JTT that performs worse), but AutoACER has a substantially lower Prob than baselines for all values of K. Again, the main reason why Mouli+CAD fails is that it is not able to detect the spurious attribute for all and thus doesn't ' impose invariance w.r. them (see Fig. 3b and $4.3). On Twitter-AAE dataset, Mouli+CAD correctly detects the race attribute as spurious and performs better in terms of Average Group Accuracy compared to all other baselines. But if we look at AProb, the gain in accuracy is not because of better invariance: in fact, the reliance on the spurious attribute (race) is worse than ERM. In contrast, AutoACER has lowest APoob among all while obtaining comparable accuracy to ERM, JTT and IRM. To summarize, in all datasets, AutoACER ensures higher comparable accuracy to ERM while yielding the lowest A Prob. Note that AutoACER does not require knowledge of the spurious attribute whereas JTT and IRM do; hence we selected the best model using overall accuracy on the validation set for all the methods (see Eq. 33). For fair comparison to JTT and IRM, in $22 (Fig. 7 we show results under the setting where all the methods (including Auto) assume that the spurious attribute is known. Even with access to this additional information, we observe a similar trend as Fig. AutoACER performs equivalent to all other baselines on average group accuracy with the lowest Prob among all. Finally, in $ we provide an in-depth analysis of our results, provide recommendations for selecting among different causal effect estimators used by our method (F11) and evaluate AutoACER and other baselines on an additional dataset Civil-Comments a popular dataset for studying generalization under spurious correlation ($F2)
18
5
Related Work
Known spurious attributes. When the spuriously correlated attributes are known priori, three major types of methods have been proposed, based on worst-group optimization [30], conditional data augmentation [ Methods like GroupDRO [30] create multiple groups in the training dataset based on the spurious attribute and optimize for worst group accuracy. To reduce labelling effort for the spurious attribute, methods like JTT (21] and EIIL 77) improve upon GroupDRO by requiring the spurious attribute labels only on the validation set. Other methods assume knowledge of causal graphs and impose conditional independence constraints for removing spurious attributes B5 [2]. Methods based on data augmentation add counterfactual training data where only the spurious attribute is changed (and label remains the same) [16. 14 [7].
independence constraints [35] 15 22]
Automatically discovering spurious attributes. The problem becomes harder spurious attributes are not known. Mouli and Ribeiro's work (4|25) provides a method assuming specific kinds of transformations on the spurious attributes, either transformations that form finite linear automorphism groups [24] or symmetry transformations over equivalence classes (25). Any attribute changed via the corresponding transformation that does not hurt the training accuracy is considered spurious. However, they do not consider settings with correlation between the transformed attributes and the task labels. Our work considers a more realistic setup where we don't impose any constraint on the transformation or the attribute values, and allows attributes be correlated with the task label (at different strengths). Using conditional independencies derived from a causal graph, Zheng and Makar (38) propose method automatically discover the spurious attributes under the anti-causal classification setting. Our work, considering the causal classification setting (features cause label) complements their work and allows soft regularization proportional to the causal effect.
6 Limitations and Conclusion
We presented a method for automatically detecting and removing spurious correlations while training a classifier. While we focused on spurious attributes, estimation of causal effects can be used to regularize the effect of non-spurious features too. That said, our work has limitations: we can guarantee the identification of causal effects only in certain DGPs. In future work, it will be useful to characterize the datasets on which our method is likely to work and where it fails. Another limitation that our method not guaranteed to work on datasets with an anti-causal gata-gene process, wherein the observed input æ and other attributes generated from the task label y.
10

---

References
[1] Martin Arjovsky, Léon Bottou, Ishaan Guirajani, and David Lopez-Paz. Invariant risk mini- mization, 2019. URL htlLiittss//aaii.orrg//
02893
[2] Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk mini- mization, 2020.
[3] Timothy B. Armstrong and Michal Koles'r. Finite-Sample Optimal Estimation and Inference on Average Treatment Effects Under Unconfoundedness. Cowles Foundation Discussion Papers 2115, Cowles Foundation for Research in Economics, Yale University, December 2017. URL https://ideas: repec. wwwpee.rppeeeeeeaa....
[4] Su Lin Blodgett, Lisa Green, and Brendan O'Connor. Demographic Dialectal Variation in Social Media: A Case Study of African-Ammeican English. In Proceedings of EMNLP, 2016.
[5] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners, 2020.
[6] Victor Chernozhukov, Whitney Newey, Victor Quintas-Martinez, and Vasilis Syrgkanis. Riesznet and forestriesz: Automatic debiased machine learning with neural nets and ran- dom forests. In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvári, Gang Niu, and Sivan Sabato, editors, International Conference Machine Learning. ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pages 3901-3911 PMLR, 2022. chernozhukov 22a. html
mlr press/v162/
[7] Elliot Creager, Jörn-Herrik Jacobsen, and Richard S. Zemel. Environment inference for invariant learning. In International Conference Machine Learning, 2020. URL https seapi.semanticcchllar www.ciccccolar.oo/rorotooou wrgg/orppssDDD.....oooo. ID: :2: 232097557
[8] Jacob Devlin, Ming-Wes Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Confer- ence of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume (Long and Short Papers), pages 4171 4171-4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi 10. 186338 1/N19-1433 URL httpp:::/accaaaahlllleeeo/////e orgooog/// Notg/N19-110 1423
[9] Yanai Elazar and Yoav Goldberg. Adversarial removal of demographic attributes from text data. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 11-21, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi (0.11865////DD 1002. URL
[10] Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In Proceedings of the 32nd International Conference on International Conference on Machine Learning Volume 37, (C, page 1180-1189. JMLR.org, 2015.
[11) Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel Bowman, and Noah A. Smith. Annotation artifacts natural language inference data. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguis- ties: Human Language Technologies, Volume 2 (Short Pupers), pages 107-112, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi 10.1 18.53///v 1/N18-217
URL https://aclantholll org/N18 2017
[12) Guido W Imbens and Donald Rubin. Causal inference statisties, social, and biomedical sciences. Cambridge University Press, 2015.

---

[13] Ziwei Ji and Matus Telgarsky. The implicit bias of gradient descent on nonseparable data. In Alina Beygelzimer and Daniel Hsu, editors, Proceedings of the Thirty-Second Conference on Learning Theory, volume 99 of Proceedings of Machine Learning Research, pages 1772-1798. PMLR, 25-28 Jun 2019. httllttts:::ppoceeediiii
mlr www.srresss//veeeee ji19a. html
[14] Nitish Joshi and He He. An investigation of the (in)effectiveness of counterfactually aug- mented data. In Proceedings of the 60th Annual Meeting of the Association for Com- putational Linguistics (Volume 1: Long Papers), pages 3668-3681, Dublin, Ireland, May 2022. Association for Computational Linguisties. -ong. 256
URL
https://acllattholee wwt.://g////222/.
[15] Jivat Neet Kaur, Emre Kiciman, and Amit Sharma. Modeling the data-generating process is necessary for out-of-distribution generalization. In JCML 2022: Workshop on Spurious Correlations, Invariance and Stability, 2022. URL https:://genreeveew www. ceret/fooummid KfB7QnuseT9
[16] Divyansh Kaushik, Amrith Setlur, Eduard Hovy, and Zachary C Lipton. Explaining the efficacy of counterfactually augmented data. International Conference on Learning Representations (ICLR), 2021.
[17] 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. URL https::/ www.:/eennfffooeeeeeeeeee idd HHWW11D
[18] Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, Tony Lee, Etienne David, Ian Stavness, Wei Guo, Berton Earnshaw, Imran Haque, Sara M Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, and Percy Liang. Wilds: A benchmark of in-the-wild distribution shifts. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 5637-5664, PMLR, 18-24 Jul 2021. URL https://proceeddngg: mlr prwss/
[19] Abhinav Kumar, Chenhao Tan, and Amit Sharma. Probing classifiers are unreliable for concept removal and detection. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh, editors, Advances in Neural Information Processing Systems, volume 35, pages 17994-18008. Curran Associates, Inc., 2022. URL https: httpps:/pproceedinggg. neurips www.eep....pppppeeeeeeeeeeeeeeee hacc/pper_fflesss Confrreooneeecccce pdf
[20] Yann LeCun, Corinna Cortes, and CJ Burges. Mnist handwritten digit database. ATT Labs [Online]. Available: http://yann.lecur lew.uunn..o/eeu///nnissis 2, 2010.
[21] Evan Z Liu, Behzad Haghgoo, Annie Chen, Aditi Raghunathan, Pang Wei Koh, Shiori Sagawa, Percy Liang. and Chelsea Finn. Just train twice: Improving group robustness without training group information. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 6781-6792. PMLR, 18-22 24 Jul 2021. URL htLthttss///pcceediii mlr. (rress/v139/liu2111 html
[22] Maggie Makar, Ben Packer, Dan I. Moldovan, Davis W. Blalock, Yoni Halpern, and Alexan- der D' Amour. Conference on Artificial Intelligence and Statistics, 2021.
shortcut removal using auxiliary labels. In International
[23] Tom McCoy, Ellie Pavlick, and Tal Linzen. Right for the wrong reasons: Diagnosing syn- tactic heuristics in natural language inference. In Proceedings of the 57th Annual Meet- ing of the Association for Computational Linguistics, pages 5428-3448, Florence, Italy, July 2019. Association for Computational Linguistics. 1001110.18633///71199933 URL https://aclanthhology.
[24] S Chandra Mouli and Bruno Ribeiro. Neural networks for learning counterfactual g-invariances from single environments. In International Conference on Learning Representations, 2021.
12

---

[25] S Chandra Mouli and Bruno Ribeiro. Asymmetry learning for counterfactually-innnrrr classification OOD tasks. In International Conference on Learning Representations, 2022.
[26] Vaishnavh Nagarajan, Anders Andreassen, and Behnam Neyshabur. Understanding the fail- modes of out-of-distribution generalization. In International Conference Learning
Representations, 2021. URL httpps://ppeereeiieeee httte:///ppaarrrrreee.as//tttttd
[27] Judea Pearl. Causality. 10110.0017//809980055 1800161
Cambridge University Press, 2 edition, 2009.
[28] Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In Empirical Methods in Natural Language Processing (EMNLP), pages 1532-1543, 2014. URL http: htttp://www... aclweb. org/ htt////ooooog//-11//6.
[29] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2383-2392, Austin, Texas. Novem- ber 2016. Association for Computational Linguistics. 1o1/10018333////11-1266 URL https://aclanthol..
org D/g//D1611100 org/D16-1264 1264
[30] Shiori Sagawa, Pang Wei Koh, Tatsunori Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. In International Conference on Learning Representations (ICLR), 2020.
[31] Bernhard Schölkopf. Dominik Janzing, Jonas Peters, Eleni Sgouritsa, Kun Zhang, and Joris Mooij. On causal and anticausal learning. In Proceedings of the 29th International Coference on International Conference Machine Learning, ICML' 12, page 459-466 Madison, WI,
USA, 2012. Omnipress. ISBN 9781450312851.
[32] Indira Sen, Mattia Samory, Claudia Wagner, and Isabelle Augenstein. Counterfactually aug- mented data and unintended bias: The case of sexism and hate speech detection. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4716-4726, Seattle, United States, July URL
2022. Association for Computational Linguistics. TO.
https: / aclaaalnonoooooyoooooo org/ 2022. nwa.anallllaamm main. 347
[33] Claudia Shi, David Blei, and Victor Veitch. Adapting neural networks for the estimation of treatment effects. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neurul Information Processing Systems, volume 32, Curran Associates, Inc., 2019. URL https: httpps://ppoceeeeinng httpro/ceeeiiingneeeiiiieep.pepe www..ms..ccpppprr.r...eeeeee fiwes/llaaaalee /apee// 20gg///lle2bbbbbaaao66644eeeeee2
[34] E. C. T. Inequalities. by g.h. hardy, j.c. littlewood and g. pólya. 2nd edition. pp. xii, 324. 27s. 6d. 1952. (cambridge university press). The Mathematical Gazette, 37(321):236222) 236, 1953. 000100000175002557200000
[35] Victor Veitch, Alexander D' A'mour, Steve Yadlowsky, and Jacob Eisenstein. Counterfac- tual invariance to spurious correlations in text classification. In Mare' Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wortman Vaughan, edi- tors, Advances in Neural Information Processing Systems 34: Annual Conference on Neu- ral Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pages 16196-16208, 2021. URL htLLittts////poeeeeee weweiinggg...uuiieee wttpsccccppppeec/eeeeee ppaper/2021/hah) 87 7771077711b002986111000666688883 htt.:///oe...oooooooooorraaaeaaa Abstract
[36]
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Huggingface's 's transformers: State-of-the-ar natural language processing, 2019. URL https://::: //tpx//axvv..////////// www.xiiw.oggab/b/i....a 03771
13

---

[37] Tongshuang Wu, Marco Tulio Ribeiro, Jeffrey Heer, and Daniel Weld. Polyjuice: Generating counterfactuals for explaining, evaluating, and improving models. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11t International Joint Conference on Natural Language Processing (Volume I: Long Papers), pages 6707-6723, Online, August 2021. Association for Computational Linguistics. doi T0.186533v1/22222 .acl
long.52. 523
URL httph: httpps://cclaantoooogg org 2ttg//2221..111o..555555 .23
[38]
Jiayun Zheng and Maggie Makar. Causally motivated multi-shortcut identification and removal. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho. and A. Oh, editors, Advances in Neural Information Processing Systems, volume 35, pages 12800-12812. Curran Associates, Inc., 2022. URL htt.L/tttpp//prrceeddnggs nwwrips cc/ wacccpaper__aee files/ 2ttpppprrr.eeeeepppp///////////1 paper/2022/filel 356c3397522663222ee66//66666--p2 Poneeeeeeeeapaapee-eoeeeeeeeeee .df
[39] Yuchen Zhu, Limor Gultchin, Arthur Gretton. Matt J. Kusner, and Ricardo Silva. Causal inference with treatment measurement error: a nonparametrie instrumental variable approach. In James Cussens and Kun Zhang, editors, Proceedings of the Thirty-Eightha Conference on Uncertainty Artificial Intelligence, volume 180 of Proceedings of Machine Learning Research, / pages 2414-22222 2424. PMLR, 01-05 Aug 2022. URL https:://proceeeeeee
mlr press/
v180 zhu2a.. html
14

---

A Mathematical Preliminaries
A.1 Causal Effect Estimation and RieszNet Estimator
Let (X, Y, A) denote random input point from the data distribution, where A is the auxiliary attribute label and X is the input covariate and is the task label. Assuming binary A, the average causal effect (or equivalently called as average treatment effect) of attribute A on the task label Y is defined as (Chapter 3 in Pearl (27):
TE (A) =] - E|y do (A) = =0
(4)
Given X satisfies sufficient backdoor adjustment the causal effect can be estimated using (see Chapter 3 in Pearl [27] for details):
Direct = TEA = 1xx
| [| A -| 0]
(5)
Henceforth, we will refer the above estimate of causal effect as Direct. Often in practice, the backdoor adjustment variable X is high dimensional (e.g., vector encoding of text or images), and as a result, it becomes difficult to estimate the above quantity. Thus, several methods have been proposed to efficiently estimate and debias the causal effect for high dimensional data 16 33
In this paper, we use one the recently proposed methods (6), henceforth denoted by Riesz, that uses insights from the Riesz representation theorem to create multitasking neural network-based method to get debiased estimate of the causal effect. Since this method uses a neural network to perform estimation, it is desirable for many data modalities such as text and image that require a neural network to get .A, then the estimator used by Riesz is a good representation of the input. Let g = E[ [X given by:
TE = E Ejoo( XX A) g(X
where ap (X, A) is called a Riesz representer (RR), whose existence is guaranteed by the Riesz representation theorem. Lemma 3.1 in Chernozhukov et al. [6] states that in order to estimate g(X, A) = E| A), suffices to estimate g(X, A) B(Y|ao( (",,)) A)). Since og(X, A) is scalar quantity. it is more efficient to estimate E(Y|aoo( A)) than to condition on high dimensional (X, A). Thus, Riesz uses multi-tasking objective to learn both ag (x(X, AX,) A) and g(X, A) jointly. First, neural network is used encode the input (X, A) to latent representation Z. Then, the architecture branches out into two heads; the first head trains the Riesz representer (x(X, (X, A) and the second branch is used to train (XX, A) (see Figure 1 and Section 3 in Chernozhukov et al. [6] for details). Let the loss used to train the Riesz representer be called as RRloss and the loss used to train g(X, A) be called as REGloss and L2Reg be the 12 regularization loss (see Section 3 in 6 for the exact form of loss). Therefore, the final loss can be written as
RieszLoss REGloss + Rí RRloss + R2 L2RegLoss,
with Rj and R2 as the regularization hyper parameters, Chernozhukov et al. (6) also suggests using another term in the overall loss (TMLEloss) which we do not consider in the current setup. After
training the whole neural network jointly with the above loss objective, the causal effect estimate could be calculated using:
Riesz == Ex (o 9(X, A=
(8)
Chernozhukov et al. 66 also proposes another debiased measure of the causal effect given by:
DebiasedRiesz Ex (9
g(X, A 0)) A) g A(X]
We observe that this measure gives worse estimate than Riesz Syn-Text dataset where the ground truth causal effect known. Thus, in all our experiments we only use the Riesz estimator and leave the exploration of DebiasedRRessz as future work. Please see for the setup we use in experiments to estimate the causal effect for different datasets.
A.2 Max Margin Objective
Taking inspiration from the description of the max-margin classifier from Kumar et al. 19 and Nagarajan et al. 26), we give brief introduction to the max-margin training objective that used to train the classifier we consider in Theorem 3.] Consider an encoder h X - Z mapping
15

---

the input a to latent space representation and classifier c: 2 + Y that uses the latent space representation to predict the task label y as c(z) w 2. The hyperplane c(z) the decision boundary of the classifier. Let the task label be binary, taking values or -1, without loss of generality (otherwise, the labels could be relabelled to conform this notation). Then the points falling on one side of decision boundary c(= < O are assigned one predicted label (say -1) and the ones falling on the other side the other predicted label (say + +1). Then the distance point having task label y, from the decision boundary is given by:
called
y y=c(z) w
Mc(z)=
(10)
where ||l|| is the L. norm of the classifier. The margin of classifier is the distance of the closest latent representation from the decision boundary. Thus, the goal of the max- max-margin objective is then to train a classifier that has the maximum margin. Equivalently, we want to minimize the following loss for training classifier that has the largest margin.
y y'c(z")
mm (c(Z),Y) = (-1) min
(1I)
||<(2) 112
where the minimum is over all the training data points indexed by i.
B Proof of Prop 3.1
Proposition 3.1. Let DGP-1 and DGP-2 in Fig. 2 be the causal graphs of two data getta-genrratig processes. Let A, C, S be different attributes. be the observed input, Y be the observed task label and U be the unobserved confounding variable. In DGP-2, is the (unobserved) core input feature that affects the label Y. Then:
1. DGP-1 Causal Effect Identifiability: Given the interventional distribution P(X|do(A) the causal effect of the attribute A on task label Y is identifiable using observed data distribution.
DGP-2 Causal Effect Identifiability: Let C be set of observed attributes that causally affect the lask label Y (unknown to us), S be the set of observed altributes spuriously correlated with task label Y (again unknown to us), and let the causal attributes are observed then the causal effect of all the attributes in V can be identiiied using observational data distribution alone.
USS be the given set of all the attributes. Then if all
To identify the causal effect of attribute on the label Y, we need access to the interventional distribution P(Y (do(A)). For example, in the case when A is binary random variable the average causal effect of A on Y is given by EA = E[ = 1] A) = 0j. We
Proof. First Claim:
can write (Yl A)) as:
P(Y(do(A))
ΣΣ X
P(Y,X,U|aO(A)
ΣΣ
(12)
Σ Σ ((U))(XIU,aO((1)
Σ P(YIX)((X((((A))
Since have access the interventional distribution ((X)o(AA) and access observational distribution P(Y.X, A), we can also estimate (()) using the above identity completing the first part of the proof.
Second Claim: We are given the attributes V/ {C, S). but we do not know the distinction between the causal and spurious attribute beforchand. We will show that we can identify the interventional
16

---

distribution P(Y]do(A) where E V. A = C, then we have:
P(Y]do(C)) Σ P(Y.S)do(C))
Σ P(S(I)())))YYISS))==== Σ P(S)P(Y(S,CC
(13)
9
Σ
MIA
Then, when we have A S, we have:
P(Y|do(S)) = Σ P(Y,CIdo(S))
Σ PICIdo(S)) do(s))
P(C)P(YIC,5)
(14)
E P(P)A))((TT) A)P((())
MIA
Thus, P(Y P(Y|do(A)) = Epra P(V) A)P(YIV) for all A E V and could be estimated from pure observational data.
C Failure of Mouli on DGP-2 and DGP3
Mouli and Ribeiro 225 define a particular DGP for their task and propose a score that identifies the invariant transformations. DGP-2 and DGP-3 Fig. F adapt the causal graph taken in their work to our setting, where the unobserved variable associated with every transformation is replaced with an observed attribute. addition, we add an additional level of complexity the DGP by introducing the unobserved confounding variable U that introduces spurious correlation between different attributes in DGP-2 and between an attribute and task label DGP-3. The graph DGP-1 is different from their setting and thus cannot use their method. This shows that the method proposed their work doesn't generalize to different DGPs. Below, we show that their method will able to identify the spurious attribute in the DGP-2 but fail to do so in DGP-3.
Corollary C.O.1. Let the observed input X be defined as the concatenation of the C, and x in DGP-2 i.e. X = [C, S, and A and in DGP-3 i.e. X [A, Then, Theorem I in Mouli and Ribeiro (25] will correctly identify the spurious attribute in DGP-2. For DGP-3, it will incorrectly claim that there an edge between A and Y even if it is non-existent the original graph.
Proof Sketch. For attribute A to be spurious, the score proposed in Theorem in Mouli and Ribeiro [33 requires conditional independence of the with the task label Y given the rest of the observed attributes and core input feature x. For DGP-2, we show that both the spurious attribute correctly satisfy that condition whereas the causal attribute correctly doesn't satisfy satisfy the condition. Then for DGP-3, we show that even if the attribute A is spurious, it cannot be conditionally independent to given x due unblocked path - U Y in the graph. See the complete proof below.
Proof. Theorem in Mouli and Ribeiro 25 defines a score, henceforth called mouli's score, to identify whether there is edge between any node N in the graph and the main task label Y. There no edge between N and Y iff for all X
xX))Tx(X)) Uv) P(Y Uy Uv =0
(15)
where N is the most-expressive representation that is invariant with respect to the node N.
Case 1 - DGP-2: For DGP-2 when the node N is causal (C), we have X [r. Sc())
[z. S] and Uy Φ) Thus, the mouli's 's score becomes:
P(Y|x, P(Y|,,, C.S) #0
(16)
17

---

since for at least one combination of z, C,S we have 1r S) * P(Y C, S) since C & Y in DGP-2. Thus, mouli's score doesn't incorrectly mark causal node C' spurious. Next for spurious node S, we have (X) [x. CI; thus the mouli's 's score becomes:
P(Y a. C) P(Y C, =0
(17)
for all x, C.S we have P(Y|a,C) C) P(Y C,S) since Y|C, Thus the mouli's score correctly identifies the spurious node S.
Case 2 D-P-3: For DGP-3, when the node N = A. we have X = [ar, A),T((() = [x] and if is spurious i.e. there is no edge from A to Y in the actual graph then the mouli's 's score becomes:
P(Y P(Y|2, ( A)lv + 0
(18)
for all x; A since A LLY = the mouli's score will be non-zero and will fail to identify A as a spurious node.
p(Y P(Y|æ, A) for atleast one setting of (z, A,Y. Thus
D Proof of Theorem 3.1
We start by formalizing the assumption we made about the disentangled latent space in $3.3
Assumption D.1 (Disentangled latent space). Let A {ear...., cak, sp,...., sp!....,sp.} be the set of altribute given to us. The latent representation 2 is disentangled and is of form F........ Zeax: zap ................................ sopps....77p............. N.xzp where zeat E Rd is the features corresponding to causal at- tribute "cag" " and Eep, E IR are the features corresponding to spurious attribute "sp,". Here dk and dj are the dimensions of zcaz and zep, respectively.
Now we are ready to formally state the main theorem and its proof that shows that is sufficient to have the correct ranking of the causal effect of causal and spurious attributes to learn classifier invariant to the spurious attributes using one instantiation of our regularization objective 33) Our proof goes in two steps:
1. First Claim:
To prove that the desired classifier will be preferred by loss objective over the classifier learned by the max-margin objective (henceforth denoted as undesired), we compare the loss incurred by both the classifier w.r.t to our training objective. Next, we show that given the ranking of the causal effect of causal and spurious attributes follows the relation mentioned in the theorem statement, there always exists regularization strength when the desired classifier has lower loss than the undesired one w.r.t to our training objective.
Second Claim: Using our first claim we show that the desired classifier will have lower loss than any other classifier that uses the spurious attribute. Thus the desired classifier is preferred over any classifier that uses the spurious attribute using our loss objective. Then we show that among all the classifier that only uses the causal attribute for prediction, again our loss objective will select the desired classifier.
Theorem 3.1. Let the latent space be frozen and disentangled such that
Zeays.... Zeaw: ; s.pr...., 2spu] (Assm D.I.. Let the desired classifier ddea (2)= undes Zeap. be the max-margin classifier among all linear classifiers that use only the causal features Zeaz, 's for prediction. Let emm (z) =k== = waar Zeng + +Ez=1 mmm Zap; be the max-margin classifier that
sps
sp; + O, Vj [J]. We assume ap; + Vj E [J], without loss of generality because otherwise, we can restrict our attention only to those j E [J] that have wamm # 0. Let the norm of the parameters of both the classifier be set i.e
uses both the causal and the spurious features, and let u mom
k= Ekill Io 1|==2 + ΣE== |lmmm 11=2 1l 1|2 1|== 1. Then if regularization coefficients
K
caz
{ [Deae Xap;
des 1|
masm Ib,
are related s.t. mean
Mhet (EEIK. * where Tik
then
Preference: CAutoACER(cees (z)) < LAAutACER (cram (C (z)). Thus, our causal effect regulariza- tion objective (Def 3 will choose the edea classifier over the max-margin classifier emom ()) which uses the spurtously correlated feature.
18

---

2. Global Optimum: The desired classifier (z) is the global optimum of our loss function = 2, the regularization strength are related s.t. Deas Aeps = ee > sp1 and search space of linear classifiers e(z) are restricted to have the norm of parameters equal I.
AutaACER when
Proof. Proof of Part 1: Since we are training our task classifier using the max-margin objective (Eq. 11 thus over training objective becomes:
K
AAwoACER (c(h(z))) ((noAACE(((((()))) mm (c(h(a:)). + R eea Weax
Xeps /eaapplll (19)
where Ilpppp the h,p norm. For ease exposition, we will denote c(h(zr)) as c(z) where z the latent space representation of æ given by z h(xx). Next, we will show that there al- ways exists regularization strength R 0 s.t. (AutOACERR("MM (z)) EAutoACER cmm (2))
given mean (1 This KKEKKIJEUU)
(from the main statement of Theorem 3.1 To have dess (z)) LAulOACER cmm (z)) we need select the regularization strength 2
LAutAACER(
s.t:
Lumm (2))) + R.
deas des llp
(20)
K
Lim (2), R
Acas
w
mm
+
Xeps
20
llp
spy
The max-margin objective (see A.2 for background) given given by Cmon (c(z). = (-1) min; y'o(=()) } where z is the latent space representation of the input xe with label y and ||o(2)]l2 [[<[=)lla
the L.2nnorm of the weight vector of the classifier c(2). The norm of both the classifier ı (z) and em (z) is (from the statement of this Theorem 3.1 Substituting the max-margin loss for both the
classifier in Eq. 20 we get:
(-1)-min (gtcee +RR R.
Aeac deee llp
k=1
(21)
K
(-1) min min (m)c)m(())) + R
Neas
1 1
+
Aaps
w sp,
k=1
Rearranging the above equation we get:
R-
Acas
lpp
|| des [|
Asp, Spp llle
(22)
terml
mm))) min ((
min
the LHS-term above equation greater than O, then we can always select a regularization strength R > 0 s.t. the above inequality is always satisfied, whenever
min; { mm)(m)) min; { dge
R
(23)
Ek=1 Aeas
1p
|oodes [Ip]
Ej= dep, (1 1|p
19

---

{ Acak Pops
Next we will show that given mean always greater than O. For LHS-term! to be greater than O we need:
Thi
df the LHS-terml in Eq. 22
ke (e())
Aeap 2ar llp
Ra llp
(-1)
Asp; 2o llp
(24)
Aeap
| llp
|| |1 11p)
Aaps 1/ (
llp
Since AG) = ()) and (>E E [0, 1] we have A0.
> (see $3.3 for discussion). From the
main statement of this theorem we have eo f 0 have the following two cases:
|1 ap, ||r for all value of "p". Next,
Case
Ek= Aeaa
| 100 mm
S For this case the above Eq. 24 trivially satisfied
since Σ)
Asp;
lIp
a Vj E [J], Asp; and
sps || 0.
Case 2
Ek=1 k=
K
Aoaa
Ilp
1000-11100 1/ lp
> 0):
Since for all j [J] we have Aaps > and
bop
||
1pp
O, rearranging we get:
Asp,
20 7r spy
1p
Aesan
cap llp
1 llp)
1=
>1
w mng
w Knn
j=1
k==1
uuma ll
(25)
1
JCJ
Σj=1
Aoag Aspy
updea
1p
u 1p
k=
20 1|p
LHS-term 3
The above equation is the harmonic mean the LHS-term and LHS-term 3 is >> 0 for all values of We know that the harmonic mean is always less than equal to the arithmetic mean for set of positive numbers (Inequalities book by GH Hardy (34). Thus the above inequality satisfied if the following inequality is satisfied:
J
K
Aeac Xap,
cot 1uupp He
ΣΣ
(26)
J. J.K
K
J=
Since the above condition on regularization strength of features satisfied (given in the main statement < AAutoACER mr (z)) thus completing the proof.
of this theorem), we have CAutoAC (cales (z))
The above Eq. 26 states that the mean of
Aong,
w des
No 10 wong lle
should less than J/K. Thus
Xayy
wumm lpp
the above equation is also satisfied individually all the terms considered when taking the mean are individually less than J/K. K. Thus, stricter but more intuitive condition on X's Eq.. 26 satisfied given by:
Acas )nki K Aeps K TE sp, Th.s)) T'Ear
J
(27)
w
des co.
1|p
where Me.
Upmm
Proof of Part 2: Given p 2 and since K = 1 and J = 1, the desired classifier takes form (2)
des Rea,1 dee Zeg- For ease of exposition, will drop "1" from the subscript which denotes
20

---

Table 2: Conditional Probability Distribution for Syn-Text dataset (P(Y [casual, confound)): The rows represent the different settings of the parent attributes causal and confound and the columns represent different values the task label Y can take. Each cell represents the probability of observing the task label given the parent's setting.
Y =
0.99 causa/=0, confound=1 causal=1, confound=0 causal=1, confound=1
causa/=O, confound=0
0.01
0.30
0.70
0.70
0.30
0.01
0.99
the feature number. Let c² (2) w Zeo + w Zsp be any classifier which uses spurious feature
ssp for its prediction s.t. w o O. From statement 1 of this theorem, when the regularization strength
are related such that Aca 17 < Asp. we have LAutoACER(c (z)) < LAutoACER(c" where
modee 11 122 Since the search space of the linear classifiers constrained to have the norm
|
of parameters equal to 1 we have |/ 112 + || = and |/ || = 1. Let | S = E [0, 1).
then have / v1 02, Substituting these values in 17 get:
1
(70)
V1 8
(28)
(0 + 1)
1
Thus ny()) decreasing function for [0, and has its maximum value Umar 1 at 0 Thus, if the regularization strengths are related such that Aca Tmar < Asp for all possible c²)). Since we are given that Aea < Asp in the second statement of the theorem cde*(2) ) is preferred by our regularization objective among all possible (z). Next, among the classifier (z) + (ze(()) which only uses the causal feature for prediction, have:
Aea < Xsp we
have LAutoACER(" (z)) < LAutOACEn(C*
CAutoACEn(C (z)) (cmm(d + R. {>ea {1eal1eo
1o l12] Lmm (c Rdca .1 (29)
CAutoACER(c(E2) = Lym
(c) (c +R R- (caalllwalll
(c + RAca
(30)
Since the desired classifier has maximum margin when using only causal feature for prediction (by definition), have Cym (cdex( Lmm (z)) for all other classifiers (z)) which only uses the causal feature for prediction. Thus the desired classifier the global optimum for our loss
function LAutoACER when the classifiers constrained to have parameters with norm equal to thereby completing the proof.
E Experimental Setup
E.1
Datasets
We perform extensive experiments 6 datasets spanning synthetic. semi-synthetic, and real-world datasets. (4 give results for such datasets - Syn-Text which is synthetic dataset, MNIST34 which is semi-synthetic dataset and twitter-AAE which is real-world dataset. In $ we further evaluate our methods and other baselines on one additional real-world dataset (CmmintComment)) which has three different subsets. Below we give detailed description of all the datasets.
Syn-Tex Dataset. To create this Syn-Text dataset we first create a tabular dataset with three binary attributes- causal, spurious and confound. The causal and confound attribute create the task label (Y) and the confound attribute creates the spurious attribute. Causal and confound attributes are independent, P(causal 0) P(causal = = 0.5 and P(confound 0) P(confound =
21

---

Table 3: World List corresponding to every Attribute for Syn-Text dataset. Every value of a given attribute associated with the following list words. For creating sentence we take the values of every attribute, randomly sample 3 words from the corresponding set, and concatenate them form the final sentence i.c. sentence [causal words, confound words, spurious words].
Attribute
Value
Word List
0
apple, mango, tomato, cherry, pear, fruit, banana, pear, grapes
Causal
1
rose, jasmine, tulip, lotus, daisy, sunflower, flower, marigold, dahlia, orchid
0
bad, inferior, substandard, inadequate, rotten, pathetic, faulty, defective,
Confound
1
good, best, awesome, teriffic, mighty, gigantic, tremendous, mega, colossal,
0
horror, gore, crime, thriller, mystery, gangster, drama, dark
Spurious
comedy, romance, fantasy, sports, epic, animated, adventure, science
Table 4: Automatically generated counterfactual example using GPT3.5 for Twitter-AAB dataset.
Input Race
Input Sentence
Generated Counterfactual
white
hey guess where i just ? cracker
Hey, guess where I jus' at? Cracker Barrel! Dey had plenty o' mashed potatoes. Jus' thought I'd letchu know.
barrel. they had plenty of mashed potatoes just thought i'd let you know. twitter-entity
#CrackerBarreCrrvvin
white
girl don't ton't sit there and listen to him talk about lacrosse when we all know you have no clue what he is saying
Girl, don't siddity there listenin' to him talkin' 'bout lacrosse when we all know you ain't I got no clue 'bout what he sayin'..
black
we don't wanna neva end
We don't want it to ever end.
black
i wonder if reggie evan still thnk blatche and joe johnson on the same level as lebron
I wonder if Reggie Evans still regard Blatche and Joe Johnson at the same level as LeBron.
0.5. The conditional probability distribution (CPD) of the task label given to the parents is given in Table[2] The CPD for spurious attribute is not fixed i. P(spurious confound) = which we vary in our experiment to change the overall predictive correlation of spurious attribute with the task label. We then create versions of this dataset (1) Syn-Text-Ohs-Conf and (2) Tonn-Tex--nnoss-Cone the Syn-Text-Obs- Obss--of dataset, we keep all the attributes in the dataset but for Syn-Text-Ohr Tee-------b--off to simulate the real-world setting where there is an unobserved confounding variable remove the confound attribute from the dataset. Post this, we use this tabular dataset to generate textual sentences for every example. For each of the values of (observed) attributes, we sample 3 words from fixed set of words (separate for each value of attribute) that we append together to form the final sentence -ee---ex-tUnns-Coa Unobs-Conf dataset corresponds to the DGP-3 in the Fig. where the unobserved node U is the confound attribute and A is the spurious attribute and there is no edge between A and task label Y. In our experiment, we sample Ik examples using the above methods and create an 80-20 split for the train and test set. Note that the predictive correlation mentioned in experiments and other tables for all versions of Syn-Tex dataset is between the confound and spurious attribute given by experiments require access to the counterfactual example ae @(x.) where the attribute A is changed to A a' in the input. To generate this counterfactual example we flip the value of
In
(see Table 3 for the set of words corresponding to every attribute). The Syn-Text-
(onffouddd Our
22

---

Table 5: Words associated with different attributes in Civil-Comments dataset.
Attribute
Associated Word List
Race
black, white, supremacists, obama, clinton, trump, john, negro, blacks, whites, nigga
Gender
male, patriarchy, feminist, woman, men, man, female, women, he, she, him, his, mother, father, feminists, boy, gor.
Religion
christian, muslim, allah, jesus, john, mohammed, catholic, priest, church, islamic, islam, hijab
the attribute in the given input and generate the corresponding sentence using the same procedure mentioned above.
MNIST34 Dataset. We use the MNIST to evaluate the efficacy of our method on the vision dataset. Following Mouli and Ribeiro (25). we subsample only the digits 3 (digit attribute label=0) and 4 (digit attribute label=1) from this dataset and create a synthetic task. To create this dataset, we first take grayscale image (with digit attribute either or 4). Then we add background color red labeled as I or green labeled as 0 - to the image uniformly randomly i.c. P(color]digii = 0.5. We create the task label using a deterministic function over the digit and color attribute formally defined as Y = color XOR digit where XOR is the exclusive OR operator. Thus the attribute, digit, and color are causal attributes for this dataset. Next, to introduce spurious correlation we add rotation transformation to the image - 0 labeled as or 90º labelled as O. We vary the correlation between the causal attributes (color and digit) and spurious attribute (rotation) by varying the CPD P(rotation|colo digit). Since the combined causal attribute label is the same as the task label the predictive correlation between the task label and spurious attribute is given by k P(rotation] color, digit) which vary in all our experiments. The above -ata-genn process resembles DGP-2 in the Fig. where the node C' is the combined causal attributes (color and digit) and the node S is the spurious attribute (rotation). The core input feature x is an empty set this dataset. All the attributes combinedly create the final input image X. We sample 10k examples using the above process described above and create an 80-20 split for the train and test set. Our experiments require access to the counterfactual example a.' Q(x,) where the attribute A = is changed to A = a' in the imput. To generate this counterfactual example we flip the value of the relevant attribute the attribute label and generate the counterfactual image.
Twitter-AAF, Dataset. This a real-world dataset where given a sentence the task is to predict the sentiment of the sentence. Following Elazar and Goldberg (.. Kumar et al. [19], we simplify the task to predict the binary sentiment (Positive or Negative) given the tweet. Every tweet is also associated with the demographic attribute "race" which is correlated with the task label in the dataset. Following Elazar and Goldberg ( Kumar et al. [19] and considering that changing the race of the person in the tweet should not affect the sentiment,
consider race as the spurious attribute. We use the code made available by Elazar and Goldberg 9 to automatically label the tweet with the race that uses AAE Aafrican-Americe aata-generating process of this dataset resembles DGP-1 in Fig. 2 siscc the sentiment (task) labels are annotated using a deterministic function given the input tweet (9)). The dataset I and code F to create the dataset are available online. We subsample 10k examples and use an 80-20 split for the train and test set. See SE.2 for details on how we vary the predictive correlation in this dataset between the task labels and spurious attribute in our experiment. Our experiments require access to the counterfactual changed A a' in the input. Since this is a real-world dataset where we don't 't have access to the data-generating process. Thus we take help from GPT3.5 (text-davinci-003 model) [3] to automatically generate the counterfactual tweet where the race attribute is changed. See Table 4 for sample of generated counterfactual tweets.
English) and SAE (Standard American English) as a proxy for race. This
example x.,' Q(xx.) where the attribute A
Civil-Comments Datasets. To further evaluate our result another real-world dataset conduct use another dataset Civil-Comment, (WILDS dataset, [8] Given a sentence, the task is to predict the toxicity of the sentence which continuous value in the original dataset. In our experiment,
TwitterAAE dataset could be found online at: http://slanglab cs umass. edu/TvitterAAE/ 'The code for twitter-AAE dataset acquisition and automatically labeling race information is available at: https://githul com www.yaaaaaaalaaaaaa demog- removal
"iivil Comments dataset is available online at httpps://ww. http://www...oooooooooooo/aaa/as
civil_commente
23

---

we binarize this task to predict whether the sentence is toxic or not by labeling the sentence with toxicity score 2 0.5 as toxic or otherwise non-toxic. We use a subset of the original dataset (CiiilComeentsldenttiee
which includes an extended set of auxiliary identity labels associated with the sentence. We finally select three different identity labels (race, gender; and religion). Race attribute takes two values black or white, Gender attribute takes two values male or female, and Religion attribute also takes two values muslim or christian. We expect that these identity attributes to have zero causal effect the task label since changing person's 's race, gender, or religion in the sentence should not change the toxicity of the sentence. For each considered identity label, we create corresponding different subset of the dataset named Civil-Comments (Race), Civil-Commentt (Gender), and Civil- Cill-Comments (Religion). This data getteranng process of this dataset also follows DGP-1 since toxicity (task) labels were generated from human amnotators. We subsample 5k examples for Civil-Comments (Race) and Civil-Comments (Gender) and 4k examples to create Civil-Comments (Religion) dataset that we use in our experiments. Then, we use 80-20 split to create train and test set. For details on how we vary the predictive correlation see $E.2 In our experiment, for every input x we need access to the counterfactual where the attribute's 's value is changed in the input. To create such counterfactuals we use a deterministic function that remove the words related to the attribute from the sentence. Currently, we use hand-crafted set of words for each of the attributes for removal, we plan to replace that more natural counterfactual generated from generative models like GPT3, Table [ show the set of words associated with every attribute that we use for removal.
E.2 Dataset with varying levels of spurious Correlation.
We create multiple subsets of the dataset with different levels of predictive correlation (k) between the task label (y) and the attribute (a). The task label and all the attributes we consider in our work are binary taking values from and 1. Following Kumar al. [9]. we define 4 subgroups in the dataset for each combination of (y, a). The subset of the dataset with (y = 1, a 1) and (y = 0, = 0) defined as majority group Smaj where the task labels y are correlated with the attribute. The remaining subset of the dataset where the correlation break is named Smin which contains the dataset with (y = 1, a = 0) and (y- = 0,a = 1). Next, we artificially vary the correlation between the attribute and the task label by varying k = Pr(y a) i.e. the number of examples with the same task label and attribute. Following Kumar et al. 19]. we can reformulate x in terms of the size the majority and minority groups:
|Smayl |Smayl + |miil
K
(31)
For both Twitter-AAR and Civil-Comments dataset, we consider 6 different settings of k from the set (0.5, 0.6, 0.7, 0.8, 0.9, 0.99) by artificially varying the size of Smaj and Smin. To do so, we keep the size of Smaj fixed, and then based on the desired value of K we determine the number of samples to take in Smin using the above equation. Thus for different values of the overall training dataset size ([Smajl + [Smin)) 1) changes in Twitter-AAE and Civil-Comments datasets. Thus it is important to only draw an independent conclusion from the different settings of x in these datasets.
E.3 Encoder for the different datasets.
We give the details of how we encode different types of inputs to feed to the neural network in our experiment. For specific details of the rest of the architecture see the individual setup for every method in $E.4 E.3
and E.6
Syn-Text Dataset. tokenize the sentence into list of words and use 100-dimensional pretrained GloVe word embedding (28) to get a vector representation for each word. Next, to get the final representation of a sentence we take the average of all the word embedding in the sentence. The word embedding is fixed and not trained with the model. Post this we add an additional trainable fully connected layer (with output dimension 50) without any activation to get the final representation for the sentence used by different methods with different loss objectives (see
F.. and E.6).
MNIST34 Dataset. We directly take the image as input and normalize it by dividing it with scalar 255. Post this we use a convolutional neural network for further processing the image. Specifically, we apply the following layers in sequence to get the final representation of the image.
24

---

1. 2D convolution layer, activation = relu, filter size (3,3), channels = 32
2D max pooling layer, with filter size (2.2)
3. 21) convolution layer, activation relu, filter size (3,3), channels = 64
2D max pooling layer, with filter size (2.2)
5. 2D convolution layer, activation relu, filter size (3,3), channels 128
Next, we flatten the output of the above last layer to get the final representation of the image used by different methods with different loss objectives (see $E.4 E.5
and E.6
Twitter-AAB and Civil-Comments Datasets. We Hugging Face
36 transformer implemen-
tation of BERT 8 bert-base-uncased model to encode the input sentence. We use the pooled output of the [CLS] token as the encoded representation of the input for further processing by other methods (see $E.4 E.5 and E.6). We start with the pretrained weight and fine-tune the model based on the
specific task.
E.4
Setup: Causal Effect Estimators
We use two different causal effect estimators - -irectt (Eq. 5 and Riesz (Eq. 8 causal effect of attribute on the task label Y (see 1 for details of the individual estimators).
to estimate the
Direct estimator in practice. For Direct estimator we use neural network to estimate S|Y|X, A]. To get the causal effect we select the best model based either based on validation loss validation accuracy in the prediction of the task label Y given (X, A)). We refer to these two versions of Direct estimators Direct(loss) and Direct(acc) for the setting when validation loss and validation accuracy are used for selection respectively. To estimate P[Y|X, A] we use the following loss objective:
[Y g(X, A)] R L2loss
(32)
where g(X, A) is the neural network predicting the task label Y given input (X, L2loss is the L2 regularization loss and R the regularization strength hyperparameter. For Syn-Text dataset, we don't apply L2loss, for MNIST34 dataset we do hyperparameter search over R E {0.0, 0.1, 10.0, 100.0, 200.0, 1000.0), J, for twitter-AAB we use E {0.0, 10.0, 100.0, 1000.0) and Civil-Comments dataset we use R E (0.0, 1.0, 10.0, 100.0, 200.0, 1000.0).
Riesz estimator in practice. To get the causal effect from Riesz we optimize the loss function defined in Eq. 8 We fix the regularization hyperparameter R1 for RRloss to fixed value 1 in all the experiments and search over the L2loss regularization hyperparam- eter (R2). For Syn-Text dataset, we don't use the L2loss at all, for MNIST34 dataset we search over R2 E {0.0, 0.1, 1.0, 10.0, 100.0, 200.0, 1000.0), for Twitter-AAE dataset we use R2 E {0.0. 10.0, 100.0, 200.0, 1000.0} and for Civil-Comments dataset we use Rs {0.0, 1.0, 10.0, 100.0, 000.0, 1000.0). Then similar to Direct estimator, for selecting the best model for estimating the causal effect we use validation loss and validation accuracy of g(X, for predict- ing the task label Y using input (X, A). We call the estimators Riesz(loss) and Riesz(acc) based on this selection criteria.
For both the estimator we train the model for 200 epochs/iterations Syn-Tex: dataset and 20 epochs for the rest of the datasets and use either validation loss or validation accuracy to select the best training epoch (as described above).
E.5 Setup: AutoACER
We use the regularization objective defined in Eq. I and 2 to train the classifier using our method AutoACER. For each dataset, first, we encode the inputs to get vector representa- tion using the procedure described in {E.3] We use cross-entropy objectives to train the task prediction (Ltask). Next, we take the causal effect estimated from Stage and map to the closest value in set (-1.0, -0.5, 00.1, 1, 0.0, 0.1, 0.3. 0.5, 1.0]. For Syn-Text and MNIST34 dataset we map the estimated treatment effect from Stage to the closest value set -0.7 -0.3, 1. 0.0, 01 0.3, 0.5, 0.7, 6.7,1.00 1.03. The mapped causal effect is then used to regularize the model using the regularization term Reg (see [nd Also, we search over the regularization strength R (Eq. I to select the best model. For all the datasets choose the
25

---

value of R from set {1, 10, 100, 1000}. We train the model for 20 epochs for all the datasets. Next, to compare the results with other methods we select the best model (across different regularization hyperparameters and training epochs) that has the highest accuracy on the validation set. Here accuracy of the model is defined as:
EN ((((z;; = yi)
accuracy of model
(33)
N
where 1 (-) is the indicator function that is equal to if the argument is true and O otherwise, "f" is the model, 2; is the input to the model and yi is the target label, and N is the total number of sample in the dataset.
The abovementioned selection criteria assume that we don't know the spurious attribute. However, some of the baselines we considered in our work (JTT and IRM) do assume that the spurious attributes are known and use them to train and select the best model that generalizes under spurious correlations. Thus for a fair comparison, in $F2 and Fig. 7 we re-evaluate all the methods on all the datasets by relaxing this assumption. Now we select the configuration that performs the best on the following metric (see
$4. for the definition of the individual metrics):
Majority Group Accuracy + Minority Group Accuracy (I-AProb)
selection criteria-
(34)
E.6 Setup: Mouli+CAD and other related baselines
As mentioned in Mouli and Ribeiro [25], given a set of attributes (AA), we train two models for cach subset (a) of the attributes (a C A) (1) model trained to predict the task label Y while being invariant to the attributes in a, (2) a model trained to predict the random label while being invariant to the attributes in a. Using these two models we compute the score for every as defined in Equation 8 in Mouli and Ribeiro [25]. Then we select the subset of attributes with the lowest score as spurious and train a classifier to predict the task label and be invariant this subset of attributes. Similar to [25] we use counterfactual data augmentation (CAD) to impose invariance w.r.t to desired set of attributes (denoted as Mouli+CAD in all our experiments). We also experiment with using ACER to impose instead of CAD by using a causal effect equal to O for the attributes for which we want to impose invariance (see $4.2 for details). When using AutoACER we search over regularization hyperparameter R from the set {1, 10, 100, 1000}. Unless otherwise specified, we use the same selection criteria to select the best model for comparison with other methods as described in Eq. 33
E.7 Setup: JTT baseline
We follow Algorithm 1 as described in Liu al. 21] and train the model in two steps. First, we train model with cross-entropy loss over all the examples (ERM). For Ten-Tex--Unob--eee tune the number epoch to train the model from set (4,8) 8) using the model selection criteria defined later in step 2 of this method. For MNIST34 and Twitter-AAS AAE we keep the number epochs fixed at 8 and 10 respectively for this first step. In the next step, we upsample the examples in the datasct that the ERM model predicted wrong in the first step by factor of Xup. We tuned the hyperparameter Aup over the set {2, 4, 8} for
dataset, we
dataset and over set (2,4) for both MNIST34 and Twitter-AAE datasets. We train the final model using the oversampled dataset for 20 epochs for Syn-Texx Ton-Tex--Unob---e Unobs-Conf, Conf, 20 epochs for MNIST34, and 10 epochs for Twitter-AAE dataset. Unless otherwise specified, we use the same selection criteria to select the best model using the validation dataset as described in Eq. 33
Seoxt-Unoos-Cor
E,8 Setup: IRM baseline
We implement the IRMv1 to train the model using IRM objective as described in Arjovsky et al. M. We use the cross-entropy loss for estimating the prediction error (R² in the IRMvl I equation). We compute the norm of the gradient term directly by squaring the gradient of cross-entropy loss w.r.t. the dummy classifier w = 1.0 as described in the IRMv1 equation. We fine-tune the regularization coefficient À over the set {1e15, 5c15} for Tex--eeets-----CC dataset and (1e14, 5e14, le15) for the Twitter-AAE dataset. We used such high regularization to scale up the gradient penalty term to have the same scale as the cross-entropy loss term which otherwise would have dominated the training objective. Unless otherwise specified, we use the same selection criteria to sclect the best model using the validation dataset as described in Eq. 33
dataset. [1e14} for MNIST34
26

---

Table 6: Estimated Causal Effect for spurious attribute in Syn-Text-Obs-Cof dataset: The causal effect is estimated on multiple datasets with varying predictive correlation (x). The true causal effect of spurious attribute is O. In our experiment, we used two different causal effect estimators, Direct and Riesz. Each of them has two different ways select the best estimate, using validation loss or validation accuracy (see $E.4 details). The causal effect from Direct estimator is close to the correct value for lower predictive correlation (ı I 0.7) but the error increases as increases. The causal effect for causal and spurious attribute is identifiable in this dataset since the confound attribute is a sufficient backdoor adjustment. Riesz estimator learns a common representation that approximates the backdoor adjustment, thus, is expected to perform better even under high value of R. We observe Riesz(loss) estimator has the lowest or equivalent estimation error compared to other estimators for all values of K.
Direct
Riesz
True
Direct(acc)
Direct(loss)
Riesz(acc)
Riesz(loss)
0.5
-0.01
-0.00
0.01
0.00
0.6
0
-0.01
0.00
0.01
0.03
0.7
0.00
0.01
0.02
0.03
0.8
0
0.05
0.08
0.04
0.03
0.9
0.10
0.16
0.20
0.05
0.99 0
0.17
0.22
0.26
0.15
Table 7: Estimated Causal Effect for spurious attribute in Syn-Text-Unobs-CCC dataset: The causal effect is estimated multiple datasets with varying predictive correlation (x). The true causal effect of spurious attribute is 0. In our experiment, we used two different causal effect estimators, Direct and Riesz. Each of them has different ways select the best estimate, using validation loss or validation accuracy (see $E.4 for details). The sata-generating process for this dataset is given by DGP-3 (Fig. 2 where the confound attribute is the unobserved variable (see $E.1 for details) and the identifiability of causal effect is not guaranteed. Thus, as expected, both the methods Direct and Riesz have high estimation error and the error increases as the value of к increases. Among both, the Direct estimator performs better than Riesz for this dataset. Our method uses this estimated causal effect to regularize the classifier. We observe that our method is robust to this error in the estimation of causal effect and trains a classifier that performs better on average group accuracy and for has significantly lower AProb compared other baselines (see $4.4 F2 and Fig. 4a discussion).
Direct
Riesz
True
DE(acc)
DE(loss)
Riesz(acc)
Riesz(loss)
0.5
0
-0.01
-0.01
0.01
0.06
0.6
0
0.10
0.13
0.16
0.19
0.7
0
0.20
0.24
0.29
0.31
0.8
0
0.38
0.37
0.43
0.42
0.9
0.49
0.49
0.57
0.58
0.99
0
0.65
0.67
0.67
0.70
E.9
Computing Resources
We an internal cluster of P40, P100, and V100 Nvidia GPUs run all the experiments. We run each experiment for 3 random seeds and report the mean and standard error (using an error bar) for each of the metries in experiment of Stage 2 and other baselines and report the mean over random runs for all the experiments Stage (Causal Effect Estimation).
Additional Empirical Results
F.1 Extended Evaluation of Stage Detecting Spurious Attribute
Causal Effect Estimator Recommendation. In this work we evaluate the performance of 2 different causal effect estimators - Direct and Riesz - each with two different ways of selecting the best mode either using validation loss accuracy (see $E.4 4 for details) on 6 different datasets.
27

---

Table 8: Estimated Causal Effect for causal attribute in
dataset: The causal effect is estimated on multiple datasets with varying predictive correlation (x). The true causal effect of spurious attribute is 0.29. In our experiment, we used two different causal effect estimators, Direct and Riesz. Each of them has two different ways select the best estimate, using validation loss or validation accuracy (see ŞE.4for for details). The increasing value of λ indicates the increasing predictive correlation of spurious attribute the dataset (see E. for details). Even though there no guarantee of the identifiability of causal effect, both the methods estimate almost correct causal effect for the causal feature. On the other hand, the previous method Mouli+CAD will incorrectly identify the causal feature as spurious for this dataset and thus will incorrectly impose invariance w.r.t to causal attribute. (see Fig. 5a and S
for more discussion).
Direct
Riesz
K
True
DE(acc)
DE(loss)
Riesz(acc)
Riesz(loss)
0.5
0.29
0.31
0.25
0.33
0.29
0.6
0.29
0.29
0.30
0.27
0.32
0.7
0.29
0.27
0.30
0.29
0.30
0.8
0.29
0.33
0.30
0.34
0.29
0.9
0.29
0.32
0.31
0.32
0.29
0.99
0.29
0.31
0.31
0.30
0.29
Table 9: Estimated Causal Effect for spurious attribute (rotation) in MNIST34 dataset: The causal effect is estimated on multiple datasets with varying predictive correlation (R). The true causal effect of spurious attribute is 0. In experiment, Direct and Riesz. Each of them has two different ways to select the best estimate, using validation loss validation accuracy (see for details). The data-generating process of this dataset is given by DGP-2 (Fig. ( and the causal effect is identifiable using only observational data (see Prop The ground truth causal effect of spurious attribute O. Overall the Riesz(loss) estimator has lower or equivalent error in the estimation of the causal effect for most of except very high K = 0.99. As the predictive correlation (x) of spurious attribute increases the error in the causal effect estimate of spurious attribute increases. When training the classifier, we show that our method (AutoACER) robust to this error in the estimation of the causal effect of spurious attribute (see Fig. 4b 15
used two different causal effect estimators,
and
12 for discussion).
Direct
Riesz
True
DE(acc)
DE(loss)
Riesz(acc)
Riesz(loss)
0.5
0.02
0.02
0.01
-0.01
0.6
0
0.04
0.03
-0.01
0.06
0.7
0
0.05
0.05
-0.10
0.05
0.8
0
0.07
0.06
-0.07
0.04
0.9
0.11
0.15
0.09
0.20
0.99
0
0.28
0.27
0.50
0.31
Table 6 (Syn-eext-Obs-oonf, Table 7 Syyn-Text-Unnos-Coe Table (NNIST34) and Table TO (Twitter-AAE and Civil-Commentl summarizes the performance of different causal effect estimator on these datasets. Different datasets bring different data-gent aata-generating processes which bring different challenges for these estimators since the causal effect may may not be identifiable (see individual tables for each dataset for discussion). We observe that one particular setting of the Riesz estimator iee. Riesz(loss) performs consistently better comparable other estimators across the dataset. There are certain setting, especially at the high predictive correlation (k) where even Riesz(losy (loss doesn't 't perform well and have large error in the estimation of treatment effect. But will show in F22 that our method AutoACER is robust to error in the estimation of the causal effect.
Baseline Mouli+CAD can incorrectly detect causal attribute as spurious. When given spurious attribute we have seen that Mouli+CAD can sometimes fail to detect the spurious attribute (see $4.3 for discussions). But sometimes this Mouli+CAD can make an even more severe mistake detect a causal attribute spurious. Fig. demonstrat on such failure in Syn-TText-nnobs-Cnn dataset. When both the attribute- causal and spurious - given to Mouli+CAD, incorrectly identifies both the attributes spurious for 0.7 (shown by the red curve having the lowest score).
28

---

Table 10: Estimated Causal Effect for spurious attribute in Twitter-AAE, Civil-Comments (Race),
(Gender) and Civil-Comments (Religion) dataset: The causal effect is estimated on multiple version of each datasets with varying predictive correlation (k). In our experiment, we used different causal effect estimators, Direct and Riesz. Each of them has two different ways to select the best estimate, using validation loss or validation accuracy (see $E.4 for details). In Twitter-AAE dataset the spurious attribute in race, in Sivil-Comment (Race) the spurious attribute is also race, in Civil-Comments (Gender) the spurious attribute is gender and in Civil-Comments (Religion) the spurious attribute is religion. The prediction task in Twitter-AAE dataset is sentiment classification and in Civil-Comments datasets it is toxicity prediction. The true causal effect spurious attribute is unknown every dataset. But we expect the spurious attribute to have 0 causal effect on the task label since changing the race/gender/veliiion of person should not change the sentiment or toxicity of the sentence. The data data-genette generating process for all these dataset is given by DGP-1 (Fig. 2). where the attribute "A" is the spurious attribute (see $ for details). The causal effect for any attribute "A" is identifiable given access to observational data and interventional distribution P(X|dd((a
(Prop 3.1b Since Riesz estimator assumes access to the counterfactual distribution Q = a( (aa) (see $E.4), we expect to have lower estimation error than Direct. Surprisingly, Direct performs comparably to Riesz estimator in all the datasets. When training the classifier, we show that our method (AutoACER) is robust to error in the estimation of the causal
effect of spurious attribute (see $4.4 F22 and Fig. 4c 16
for discussion).
Direct
Riesz
Dataset
DE(acc)
DE(loss)
Riesz(acc)
Riesz(loss)
0.5
0.01
0.01
0.03
0.02
0.6
0.07
0.07
0.12
0.07
0.7
0.12
0.12
0.12
0.12
Twitter-AAE
0.8
0.21
0.20
0.18
0.17
0.9
0.32
0.27
0.25
0.27
0.99
0.35
0.31
0.40
0.37
0.5
0.02
0.02
0.06
0.06
0.6
0.04
0.04
0.09
0.09
0.7
0.07
0.05
0.08
0.09
Civil-Comments (Race)
0.8
0.08
0.08
0.09
0.11
0.9
0.15
0.15
0.15
0.18
0.99
0.22
0.22
0.23
0.27
0.5
0.00
0.00
0.03
0.01
0.6
0.01
0.01
0.04
0.05
0.7
0.03
0.02
0.09
0.09
Civil-Comments (Gender)
0.8
0.04
0.05
0.06
0.12
0.9
0.09
0.09
0.12
0.12
0.99
0.13
0.12
0.15
0.18
0.5
0.01
0.00
0.00
0.00
0.6
0.02
0.03
0.02
0.02
0.7
0.02
0.03
0.01
0.04
Civil-Comments (Religion)
0.8
0.04
0.04
0.04
0.03
0.9
0.06
0.06
0.06
0.05
0.99
0.07
0.08
0.09
0.08
For > 0.7, again it incorrectly detects the true causal attribute spurious. If only give the causal attribute as input to Mouli+CAD, again causal attribute (shown in orange) will be detected as spurious attribute since it has lower score than the subset with attribute (blue curve) for all values of k. But if we look at the causal effect estimate of causal attribute in Syn-Text-Unobs- it is close the correct value 0.29 for all values of even though the identifiability of causal effect for this dataset is not guaranteed (see Table g) Thus using continuous measure of the spuriousness of attribute using the causal effect estimates can help mitigate the limitation of discrete measures (used in Mouli+CAD) like false positive and false negative detection of spurious attributes.
dataset
29

---

5.00
-200
-1000
-1500
130
0
1900
-2500
-20
.000
"statonn
-3000
-2500
predetive correiation
predictiee comrestoon
(a) Syn- Texl-Unobs-Cout
(b) MNIST34
(c) Twitter-AAE
-230
-200
-450
-600
-800
-200
1.000
1000
1000
1200
1200
-1200
0.5
predictvee
0.6
0-3
1400
predictive
0.6
O'W
2.0 3.0
2-6
5
0.5
3.0
(d) Covle-oommens (Race)
(e) Civil-Comments (Gender)
(f) Civil-Comments (Religion)
Figure 5: Score used by Mouli+CAD for determining the spurious attribute. Given tuple of attributes in a given dataset, the baseline method Mouli+CAD defines a score for every subset of attribute and determines the least scoring subset spurious. The empty subset "O" denotes that no attribute is considered spurious. The x-axis shows different levels of predictive correlation (k) in the dataset and the y-axis shows the score assigned by Mouli+CAD different subsets of attributes. We include some additional attribute not considered in Fig-Bi for Syn- Ten-Text--nnos-ee
and MNIST34 datasets and summarize the score for Eivil-Comments datasets. In (a), we include the score for all the subsets of attributes (causal and spurious) in the Syn-Text dataset. When given all the attribute the same time, Mouli+CAD will incorrectly detect both the attribute (causal and spurious) as spurious shown by the red curve for K < 0.7 and the causal attribute as spurious for K > 0.8. Thus Mouli+CAD will completely fail in determining the correct spurious attribute for Syn-Tex dataset. When only given the causal attribute in the dataset, it will again incorrectly detect causal attribute as spurious since it will have a lower score compared to the subset with no attribute as shown by the orange curve being always lower than the blue curve. In (b), we again include the score for every subset of attributes- rotation (spurious) and color (causal) which were partially included in Fig. 3 Again, Mouli+CAD will fail to identify any attribute as spurious for all S 0.9 (shown by the blue curve with the lowest score) and will incorrectly detect the causal attribute (color) as spurious for x 0.99 (shown by the orange curve). For (c) Twitter-AAE, (d) Civil-Comments (Race), (e) Civil-Comments (Gender) and (f) Civil-Comments (Religion) MoulitAutoACER is able to correctly identify the spurious attribute shown by the orange curve with the lowest score. In Fig. 6 we show that Mouli+CAD doesn't 't always impose correct invariance with respect to spurious attribute and might fail to detect the correct spurious attribute once the correct invariance is imposed. See $.. for further discussions.
Spuriousness Score used by Mouli+CAD be misleading. Given set of attributes, Mouli+CAD creates multiple classifiers where they impose invariance with respect to different subsets of attributes. Using these invariant classifiers, they define spuriousness score for all the subsets of attributes. Then the subset of attributes with a minimum score is selected as spurious. We observe in our experiment that Mouli+CAD when training the invariant classifier is not able to completely enforce invariance. Thus the score defined using the invariant model might be misleading. Fig. shows one such instance of failure. The second row of Fig. 6c shows that Mouli+CAD doesn't impose correct invariance w.r.t the spurious race attribute (shown by high AProb of the orange curve). Next, we use AutoACER to enforce correct invariance w.r.t race attribute by regularizing the classifier with zero causal effect for race attribute. This enforces correct invariance shown by low Prob in the second row of Fig. 6f a result, we observe that the score for the spurious attribute (shown by the orange curve in the first row of Fig. (f). is higher than blue. Thus enforcing the correct invariance Mouli+CAD AD will fail to detect the race attribute as spurious since the blue curve has a lower score than orange for all values of < 0.9.
30

---

F.2 Extended Evaluation of Stage 2: AutoACER and other baselines assuming the Spurious attribute is known
In $4.4444m Fig. 4 we compared AutoACER with other baselines where we used overall accuracy as the selection criteria to select the best model (see Eq. (3). However, some of the baselines (IRM and JTT) assume that spurious attributes are known and use this information to train and select the best model that generalizes under spurious correlations. Thus, in this section for a fair comparison, we re-evaluate all the methods on all the datasets again by providing them with the knowledge of spurious attributes. Refer to Eq. for details on how we select the best model with this information. Fig. summarizes the result for AutoACER and other baseline with this selection criteria.
Unobs-Conf, MNIST34 and Twitter-AAR dataset We extend the evaluation in Fig. 7 by adding the comparison of the performance of AutoACER and other baselines over these accuracy metrics for Syn-Text- Unoes--foo-- MNIST34, and TwitterAAA datasets in Fig. 8 Overall, AutoACER performs comparable or better than other baselines for and MNIST34 datasets. In Twitter-AAE dataset, Mouli+CAD performs better in worst group and minority group accuracy than AutoACER. But AutoACER has significantly lower AProb compared to other baselines signifying that the learned classifier is invariant to the spurious attribute.
Other evaluation metrics for
Evaluation of AutoACER on Comments dataset- - a real-world dataset where given a sentence the task is to predict the toxicity of the sentence. We have three different subsets of this dataset, Civil-Comments (Race), Civil- Comments (Gender), and Civil-Comments (Religion) where the attribute race, gender and religion the spuriously correlated with task label (see $E. for details). Fig. compares AutoACER with other baselines over a number of different metrics. Unlike Twitter-AAi dataset where Mouli+CAD gave significant gains in the average group accuracy, AutoACER perffrrrms comparably to Mouli+CAD and improves over ERM over this metric on all the subsets. Although, AProb is low for all the baseline methods, AutoACER again gives classifier with much lower AProb, especially for high values of predictive correlation (x). On all subsets of Civil-Comments dataset, AutoACER also performs comparably to other baselines over other accuracy metrics minority group accuracy and worst group accuracy used to evaluate the efficacy of generalization over spurious attribute [30].
dataset. We evaluate our method on Civil-
Counterfactual Data Augmentation is not sufficient for imposing correct invariance. Fig. gives us a hint that Mouli+CAD might not be sufficient for learning a model that is invariant to spurious attribute. For Twitter-AAE dataset (see Fig. [c] and Civil-Commmenss dataset (see Fig. [O). AutoACER has comparable or slightly lower average group accuracy than Mouli+CAD. But AutoACER has a significantly lower value of AProb than other baselines and thus is able to impose correct invariance w.r.t spurious attribute. Thus it seems that counterfactual data augmentation used in Mouli+CAD might be using some other mechanism to perform better on average group accuracy than imposing we combine Mouli+CAD and AutoACER to get the
invariance w.r.t to spurious attribute. In Fig. 9 best out of both worlds (denoted as Autoli+AutACEER + +CA). As expected we observed that the final classifier has a significant gain in the average group accuracy and has AProb than ERM classifier. We leave the task of understanding how CAD gives better gains in average group accuracy to future work. See Fig. [9 for details of other additional details of experiments with CAD that might shed some light on this question.
Robustness of AutoACER error in detection of spurious attributes. AutoACER follows two-step procedure to train a classifier that generalizes to spurious correlation. First, in Stage 1, it estimates the causal effect of the given attribute on the task label determine a continuous degree of spuriouness for that attribute. Then in Stage 2, it regularizes the classifier proportional to the estimated causal effect with the goal of imposing invariance with respect to spurious attribute. Since AutoACER is heavily reliant on the estimate of causal effect for correctly enforcing the invariance with respect to spurious attribute we need to analyze its robustness to noise in the estimation of causal effect. For simpler classifiers, our 3.1 shows that we don't 't need correct causal effect estimate to learn classifier invariant to spurious correlation. For the case when we have two high dimensional variables one causal and another spurious as long the ranking of the causal effect of causal and spurious attribute correct AutoACER will learn a classifier completely invariant to spurious attribute. This result on simpler classification task hinted that we don't 't need completely correct
31

---

estimate of attribute to learn more complicated invariant classifier trained on real-worls dataset. We conduct an experiment where we knowing use a range of non-zero causal effects for spurious attribute (ground truth causal effect is zero) to regularize the model using AutoACER. We observe that AutoACER is less sensitive to even large noise the causal effect (> 0.5) on the metrics like average group accuracy and AProb for a large range of regularization strength (R). Even with large error in the causal effect AutoACER trains a classifier with high average group accuracy and low AProb. Fig. 11 12 and 13 summarizes the result for
MNIST34 and Twitter-AAE dataset. Also, we show the robustness of AutoACER when using the causal effect
estimates from different estimators we consider in our work in Fig. 14 15 and for these datasets.
32

---

-1000
-1300
-200
-2000
-1400
-1000
-1200
-3000
0.5
0.6
0-7
0.0
0.9
coive corretation
0.5
0.6
0.7
0.0
0.322
2 0.300
rotacion
0.00
0.445
0.275
2.00
0.40
0.250
0.30
0.200
predictioe cormeacioon
presicttee etlon
(b) Civil-Comments (Race), Mouli+CAD
(a) MNIST34, Mouli+CAD
(c) Twitter-AAE, Mouli+CAD
-4.0
-600
-250
800
-300
1010
-1000
-2000
-000
-3000
Cace
73.00
preditive coridaation lx)
predictive corretation Cal
ored ct Ve corretat (cT
Stata Naniee 078
0.30
0.25
Idtation
race
Spafcce Mar.eeeeeeee
0.4
0.22
0.30
0.20
0.1
0.5
0.6
0-7
0.0
0.9
05
0.5
0.7
0.8
2.0
1.0
0.5
3.6
0.7
5.0
0.9
1.0
(d) MNIST34,
(c) Civil-Comments (Race), Mouli+AutoACER (R=1000)
(1) Twitter-AAF
Aouli+AutoACER (R=100)
MoulitAutoACER (R=100)
Figure 6: Counterfactual Data Augmentation doesn't impose complete invariance: The x-axis in every plot denotes the predictive correlation in the dataset, and the y-axis in the first row of every plot shows the score computed by the previous Mouli's method for a different subset of attributes. Different methods could be used to impose invariance w.r. to certain subset of attribute in the classifier and compute a score to quantify the spuriousness of classifier. In (a) (b) and (c) counterfactual data augmentation (CAD) is used to impose invariance whereas in (d) (e) and (f) AutoACER is used to impose invariance. The empty subset "0" denotes that no attribute is considered spurious. Then the attribute with the lowest score is detected as spurious attribute. The y-axis in the second row of every plot measures the reliance of the classifier on spurious attributes on imposing invariance w.r.t to labeled attribute using AProb. The blue curve shows reliance the spurious attribute when no invariance is imposed and the orange curve shows reliance on spurious attribute when we impose invariance w.r.t to spurious attribute. Sometimes CAD doesn't 't impose correct invariance in the classifier which may create mistakes in detecting the spurious attribute. For Civil-Comments (Race) and -witter-AAF dataset the second that CAD is not able to impose correct invariance with respect to the spurious attribute shown by high AProb of spurious attribute in the classifier which supposed to be invariant spurious attribute (orange curve). AutoACER to impose the required invariance (second row in (e) and (I)) shown by AProb close to 0 for the orange curve. After the correct invariance is imposed using AutoACER, Mouli's ' score fails to determine the race attribute (which is actually spurious) as spurious for k S 0.9 shown by a blue curve having lower score in the first row of (f). The relative ordering of score (first row) remains the same for MNIST34 and Civil- Covil-Comment (Race) after imposing invariance using either CAD (in (b)) or AutoACER (in (d), (e)).
of (b) and (e) respectively shows
33

---

BB Amece
AusaACO
Avengee Croup Accurslty
2r1
PM
Hoil-C60 2019
Averaee Group Accuracy
Ro
IAM
201
0.9
0.9
0.9
0.8
0.8
0.8
Average
0.7
0.7
0.7
0.6
0.6
0.6
0.5
predictive correlation
correlation
predi correlation
Houl AuroACE
0.6
AvSANCER
Houli AusoicE
Houll AuroACER
0.5
Squatou Topic &Prah
0.5
Topic &Prab
0.5
Tapic
0.4
0.2
0.0
0.5
0.6
0.7
0.8
0.9
0.99
0.0
0.5
0.6
0.7
0.8
0.99
0.0
0.5
0.6
0.7
0.8
0.9
0.99
predictive correlation
predictive correlation (K]
predictive correlation
Syn-Text Syn-Text-Unobs Unobs-Cone Conf
(b) MNIST34
(c) Twitter-AAF
Figure 7: Average group accuracy (top row) and AProb (bottom row) for different methods when the spurious attribute is known. x-axis denotes predictive correlation (x) in the dataset. We observe a similar trend as in Fig. 4 where none the methods assumed that the spurious attribute is known. Compared to other baselines, (a) and (b) show that AutoACER performs better comparable in average group accuracy and trains a classifier significantly less reliant to spurious attribute as measured by AProb. Mouli+CAD performs better in average group accuracy in (c) but relies heavily on spurious prop shown by high AProb whereas AutoACER performs equivalent to ERM on average group accuracy with lowest AProb among all. Refer Eq. 34 for the model selection criteria used select the best model and for further discussion see
F2
34

---

1.2
Aurroge Group krunnry
PM
Rerrag Goop Arcor
1.0
0.9
0.9
0.9
0.8-
0.8
0.8
0.7
0.7
0.6
predictive corrriatiio..oo L6]
predictive correlation 1x)
preditive correlation (x)
0.25
Modii CAN
Mod-rrAn
Modi-CA CAn
Spurbos Taok ghos
0.5
MOLE
Spurbue Tock drree
0.20
Mcatenoonaa
Spudooi Tosl grop
0.5
Moute AAAALE
0.3-
0.3
0.10
0.0
0.5
0.6
0.7
0.8
0.8
0.99
0.00
0.5
0.6
0.7
0.8
0.9
0.94
0.0
0.5
0.6
0.7
0.0
0.8
0.99
predictive
1.2
Robrity Croas Accundty
1.0
Hajorty Grous Accuray
1.0
CAM
Helery Grors Acuuray
1.0
0.8-
0.8-
0.8
0..4
0.4
0.2
0.2-
0.2
predittive correlation 04)
predictive comrlation 160
predittie correlation (A)
1.2
1.2
1.2
Nhorty Cruio Accumogh
Hork HALE-NAARACER
Modil CAO
Nearty Accursgj
1.0
Moate AalAAc
MoLE-CAO
Niporty Grapp Accumegh
Modi
0.8
0.0
0.c.
0.6
0.0
0.4
0.4
0.2
0.0
0.5
0.6
0.
0.8
0.8
0.99
0.0
0.5
86
0.7
0.9
0.94
0.0
0.5
0.99 AMAACE
0.6
0.7
0.8
0.8
predictive correlation
predictive
pred correlation
Moutl
AZsACC
Mout-
Wont Sruu Acurroy
1.0
1.0
1.0
0.0-
Wonst Gruup
0.4
0.4
0.2
predictive correlation (6)
predictive correlation (6)
predictive correlation (6)
(a) Syn-Text-Unobs-Cont
(b) MNIST34
(c) Twitter-AAF
Figure 8: Additional evaluation metries. We include three additional metrics used in the past work 30 to evaluate the generalization of classifier to spurious correlation in addition to Average Majority group accuracy (third row), Minority Group
group accuracy and AProb as used in Fig. Accuracy (fourth row), and Worst group accuracy (bottom row). x-axis denotes predictive correlation (x) in the dataset. Compared to other baselines, (a) and (b) show that AutoACER performs better in minority group accuracy, comparable or better in the worst group accuracy, and trains a classifier significantly less reliant on spurious attribute as measured by AProb. The majority group's accuracy is expected to increase as the predictive correlation (k) increases since the classifier could start using the spurious attribute for making predictions.
(a), the majority group accuracy remains almost similar even as the к increases whereas it increases for other baselines. This shows that AutoACER trains a classifier that doesn' 't rely on spurious attribute even at high values of k. Similarly, in (b), the majority group accuracy of classifier trained by other baselines is higher than AutoACER at higher values of к implying a higher reliance on spurious attribute. Mouli+CAD performs better in all group-wise accuracy in (c) but relies heavily on spurious prop shown by high Probb whereas AutoACER performs equivalent to ERM on all group-wise accuracy with lowest APoob among all. See $F2 for further discussions and refer to Eq. 34 for the model selection criteria used to select the best model.
35

---

1.2
AutoACER
CAD
Average Group Accuracy
1.1
AutoACER
Mouli Mouli--CADSamplahaall
ERM
AUtOACER
0.9
0.8
0.7
0.6
0.5
0.8 predictive correlation (x)
0.6
Mouli' AutoACER AutoCCE
Spurious Topic AProb
0.5
Mouli AutoACER CAD
0.4
0.3
0.2
0.1
0.5
0.6
0.7
0.8
0.9
0.99
predictive correlation (x)
1.2
AutOACER
Mouli+CAD(harr Mouli CADGampllhain
Moulile AutoACER
ERM
Worst Group Accuracy
Mouli+ AutoACER CAD
0.8
0.4
0.0
0.5
0.6
0.8
0.9
0.99
predictive correlation (x)
Figure 9: Combining AutoACER and Mouli+CAD gives good trade-off in Accuracy and AProb: The x-axis denotes predictive correlation (K) in the dataset and the y-axis shows different evaluation metrics. Mouli+CAD performs better in average group accuracy whereas AutoACER performs better in AProb (see F22 and Fig. for more discussion). Thus counterfactual data augmentation (CAD) might not be best method impose invariance with respect to a spurious attribute. Thus we augment Mouli+CAD with AutoACER (denoted green bar) to get the best out of both worlds. MouAiAAutoACER +CAD show similar increase in average group accuracy Mouli+CAD and at the same time have lower Prrbb than Mouli+CAD and ERM. We experiment with two different settings where we halve the number of samples used to train the task classifier to test whether this gain in average group accuracy is due to increased sample size and thus the number of gradient updates when we perform CAD. Mouli+CAD (hardhalf) shows the setting when reduce the initial dataset before augmentation to half and thus the effective dataset size and thus the number of gradient updates becomes the same after augmentation as used observe that the average group accuracy becomes equal to
AutoiA + CAD and shown by the
in other baselines. In this setting, other baselines where we don't i perform CAD. In the second setting, Mouli+CAD (samplehalf), we randomly subsample half of the counterfactually augmented dataset in every training iteration. Thus the effective number gradient updates is the same as other baselines. this setting, we observe similar behavior Mouli+CAD in both average group accuracy and Arrob metrics. These two experiments thus suggest that the number of gradient updates (better training) is not the main reason behind the gain of the average group accuracy when using counterfactual data augmentation. We leave the question for future work of understanding the mechanism behind how CAD is able to perform better on average group accuracy without completely imposing invariance with respect to spurious attributes. See $22 for further discussions and refer to Eq. 34 for the model selection criteria used select the best model.
36

---

Muck PLAA BAM
Moskes C
Merrgge Group Acuusyy
1.1
558
1.1
Meeroge Group Accurayy
1.1
568 Mostthaacc
1.0
0.9
Aecroge Group
0.9
0.9
0.8
0.8
0..
0.7
0.7
0.7
0.5
B.6
0.7
0.94
0.5
8.6
0.9
0.5
0.6
0.7
0.99
predictive
correiation 1x0
predictive correlation 1x)
predictive correiation 1x0
0:25
0:25
0:25
eAM
PAM
AusOACO
PAM
Spurtous Tople 0Preb
0.20
Spurous Trgpte direh
0.20
Spurlous Tople 8Prab
0.20
0.15
0.15
0.155
0.10
0.10
0.10
0.05
0.05
predictive correlation
predictive correlation
predlctive correlation
1.2
NoLE+CAA
Maul-CCAD
Majorit Group Acc./mry
Noul CAaooAAN
Majoriy Group Groui Accurazy
3.00
0.6
0.4
Majorty
0.4
0.2
0.2-
0.2
0.0
0.5
0.5
0.7
0.8
0.9
0.94
0.0
0.5
0.6
0.7
0.8
0.9
0.99
0.0
0.5
0.6
0.7
0.8
0.9
0.94
predictive corrllaiio (x)
predictive correlation (x)
predictive correlatio (x)
1.2
1.2
1.2
N
Whorty Graup Accurse?
1.0
5000
RAM
Wmortty Accurscy)
1.0
RAM
Weonty Group Accuracy)
1.0
260
RAM
0.8
0.8
0.8
0.6
0.6
0.6
0.4
0.4
0.4
0.2
0.2
0.99
0.0
0.0
0.9
0.99
0.99
predictive correiation
predictive correation 1A)
predictive correiation
1.2
1.2
1.2
Worst Group Accurey
1.0.
Neeeow
CAM
Worst Accurccy
2.0.
CAM
Worst Group Accurscy
1.0
CAM
0.8-
0.8
0.6
0.5
0.6
0.7
0.8
0.5
0.6
0.9
0.5
0.6
0.7
0.8
prediclive
(a) Civil-Comments (Race)
(b) Civil-Comments (Gender)
(c) Civil-Comments (Religion)
Figure 10: AutoACER and other baselines on Civil-Comments datasets: Different columns show the results on different subsets of Civil-Comments dataset i.c. race, gender and religion (see E.]] for details dataset). Different rows show different evaluation metrics we consider to evaluate the performance. The x-axis denotes predictive correlation (x) in the dataset. Unlike Twitter-AAE dataset (Fig. 8c and 7 where there was a significant gain in average group accuracy when using the Mouli+CAD, AutoACER performs comparably Mouli+CAD on all the subsets of Civil-Comments datasets. Even though the AProb metric is already small for all the methods (< 0.10), AutoACER further reduces it close to On all the individual group accuracy metries AutoACER performs better than ERM and is comparable to other baselines. See $122 for more discussions and refer to Eq. 34 for the model selection criteria used to select the best model.
37

---

Predicitve Correlation())-055
Predicivve Correlationl)-0...
Predicitve Corre Carrelation
0.64
0.07
0.64
Neliggs Grupp AcXUpe)
0.62
0.05
0.06
Reakd Pedo
Word Mruuee
0..92
0.60
0.04
0.58
0.03
0.56
VeJEACAD
0.01
0.02
0.56
Hiu
Asseciktee)
0.54
100
0.00
0.54
-0.
0.0
0.5
10
-05
0.0
0.5
1.0
-0.5
0.0
0.5
10
Predicitve -o
Predicit Correlation(a--007
Predicitve Coreelational--77
0.00
0.62
0.675
Aerraga Group Acuracy
0.655
0.60
0.625
0.05
DN
0.600
0.00
0.575
0.03
0.54
0.550
VEuEICAD
0.02
0.52
Hed
0.525
0.500
1080
0.00
0.48
Predicitve 00
Predicitve Correlation(e)-0.9
Predicitve 1a
0.650
Aw Acauney
0.70
Shuteus 1891C Gireb
0.625
0.15
0.575
0.10
Aeaeack 10
0.550
0.60
0.525
MaXSHCAD
0.05
0.500
0.59
42001600-00 106
correlat
Predicitve Correlationte
Correlaion(x)-000
0.50
0.65
0.75
Spartsu Topt: UPPc
200.60
0.70
0.55
Jeinge Groug
0.65
0.50
0.45
0.55
198
0.40
12H
0.35
-1.0
-0.5
0.0
1.0
0.0
Extimated Cacaal Cffect
Extimated Causal Effect
Estimatedd Caunal Effect
Figure 11: Robustness of AutoACER w.r.f estimated causal effect
Given a attribute, in Stage our method AutoACER estimates the causal effect of attribute on the task label continuous measure of spuriousness of the attribute. Then in Stage 2, it regularizes the classifier proportional to the estimated causal effect. Since our model relies heavily on the estimate of the causal effect of the attribute it is important analyze the robustness of AutoACER with noise in the estimation step. In this figure, we show the sensitivity of AutoACER with varying levels of noise in the causal effect estimate of the spurious attribute. The true causal effect of spurious attribute is O and the x-axis shows the value of the causal effect used in Stage 2. The different row shows the result for different levels of predictive correlation (x). Different columns show different evaluation metrics - average group accuracy, Arobb, and worst group accuracy. Different colored lines show different baselines or different regularization strengths (R) used by AutoACER. The dotted vertical black line in every plot shows the estimated causal effect using the Direct or Riesz estimator in Stage We observe that AutoACER less sensitive to the error in the estimated causal effect of spurious attribute. For example, for к 0.99 (last row), the green curve (AutoACER with I - 10) is almost constant for all values of causal effect used in Stage for spurious attribute, has better average and worst group accuracy than ERM and Mouli+CAD and has a very low value of AProb. Even when we regularize the classifier to have causal effect of Stage 2, the Prob remain close to zero demonstrating some form of self-correctton. Theorem 3.1 hints a possible reason for this robustness our method will always select the correct classifier (less reliant on spurious attribute) as long as the ranking of the causal effect of spurious and causal attribute is consistent up some constant factor. See $F.2 for detailed discussion, Fig. 12 and 13 for similar analysis on MNIST34 and Twitter-AAE dataset respectively and refer to Eq. 34 for the model selection criteria used to select the best model.
38

---

Predicitve 0.
Predicitve C.rrelation()
Predicitve Corre (at 0.5
0.70
Worst Crou Accursoy
Aesraga Groad G
0.85
Maul-CAD
0.60
0.04
0.5
Pecl-CAD
0.4
0.50
And
0.3
Aean 100
Asaacia p-100
0.45
-0.5
1.0
-10
-0.5
0.0
0.5
1.0
-0.5
0.0
0.5
1.0
Predicitve 0.
Prediritve Correlation(e)-077
Predicitve Correlatio(() -0.7
0.08
0.55
Melaaa Ge- Acuua43
0..50
0.08
Spuntous lopk
Moul+CAp
0.45
decar Lhet
Aeskrt Leaiee
0.35
0.02
0.30
Vest -540
0.50
0.00
Predicitve 0
Predicitve Correlation(x)-0.
Predicitve Correlation(e
0.12
Had
0.58
Wond Croup Accuracy
0..45
Asseca B-10
Auarage Group
Sputous Hikk
0.00
DN
0.40
0.54
0.06
0.52
0.30
0.02
0.25
0.00
1.0
Predicitve Coreelationel-d..9
Predicitve Correlationte)mo
Predicitve Coreelation())m..9
0.5
Sputious Lepit aline
Worst Grous Accurbsy
0.4
0.510
DAN
Had oi
0.305
0.10
Aetrage
0.500
0.2
0.495
0.1
0.00
-1.0
-0.5
0.0
0.5
1.0
-3.0
-0.5
0.0 0.5
1.0
-1.0
-0.5
0.0 0.5
1.0
Effect
Figure 12: Robustness of AutoACER w.r.f estimated causal effect on MNIST34: In this figure, show the sensitivity of AutoACER with varying levels of noise in the causal effect estimate of the spurious attribute. The true causal effect of spurious attribute (rotation) is and the x-axis shows the value of the causal effect for this attribute used for regularization in Stage 2. The different shows the result for different levels of predictive correlation (s). Different columns show different evaluation metrics average group accuracy, AProb, and worst group accuracy. Different colored lines every plot show different baselines or different regularization strengths (R) used by AutoACER. The dotted vertical black line shows the estimated causal effect using the Direct or Riesz estimator in Stage 1. Similar to Fig. 11 we observe that AutoACER is robust to eтrоr in the estimated causal effect of the spurious attribute. For example, when x 0.99, for all the settings of AutoACER (with different regularization strength R), the average group accuracy is almost constant and better than the ERM and Mouli+CAI for values of causal effect used for the spurious attribute. Similarly, the AProb is constant and lower than ERM and Mouli+CAD for all values of the estimated causal effect. For discussion on possible explanation see Fig. and F.2 and refer to Eq. 34 for the model selection criteria used to select the best model.
39

---

Predicitve Correlationn@mm..55
Predicitve Co
Predicitve Correlation(A)
0.8
10
0.30
Houl+Cop
0.8
0.7
Arorage Group
0.6
0.10
0.5-
Mac FCAp
0.05
0.5
0.4
1.00
00.5
0.0
0.5
1.0
-1.0
-0.5
0.0
0.5
1.0
-1.0
-0.3
0.0
0.5
1.0
Predicitve 00
Predicitve Correlationisl-0.7
Predic Correlltiio(x))007
1.0
CAR
0.4
Midi-cAn
Recogge ACUTOC
0.8
0.8
Adoltasa 100
Spaticus Teal:
0.7
0.7-
0.2
0.6
0.5
0.6
0.1
0.5
0.0
Predicitve 0.
Prediritve Correlationta)-00.8
Predicitve Correlation(a)m0
0.5
Aasemaain in
0.4
0.8
0.88
AssiceLio 1003
Sputfuu Tegk--PPor
UIN
0.7
0.7-
0.2
Avorage
6.6
0.1
0.5
0.0
0.4
0.0
0.5
-0.5
0.5
1.0
Predicitve Correlationell0..9
Predicitve Comeelationt))-0.9
Predicitve Correlation(s)-O.1
1.0
0.5
MM
Average Group Acouroy
0.9
0.4
Accurasy
0.8
Asskash-i100
0.8
0.3
Meck-CAp
0.6
0.7
APSeCi k-13
Aeca2t K-125
Sputfou
0.2
0.6
0.1
0.4
0.5
0.0
-1.0
-0.5
0.0
0.5
1.0
-0.5 0.0 0.5
1.0 -1.0
-0.5
0.0
0.5
1.0
Esimated Causal
Estimated Gausal Effect
Estmated Causal Effect
Figure 13: Robustness of AutoACER w.r.f estimated causal effect on Twitter-AAE: In this figure, show the sensitivity of AutoACER with varying levels of noise in the causal effect estimate of the spurious attribute. The expected true causal effect of spurious attribute (race) is 0 and the x-axis shows the value of the causal effect for this attribute used for regularization in Stage 2. The different row shows the result for different levels of predictive correlation (R)) Different columns show different evaluation metrics
average group accuracy, AProb, and worst group accuracy. Different colored lines in every plot show different baselines or different regularization strengths (R) used by AutoACER. The dotted vertical black line shows the estimated causal effect using the Direct or Riesz estimator in Stage 1. Similar to Fig. 11 and 12, we observe that AutoACER is not sensitive noise in the estimated causal effect of the spurious attribute. The average group accuracy and worst group accuracy remain almost constant with increasing noise in the estimate, though they are lower as compared to Mouli+CAD. But AutoACER is less sensitive to noise in estimated effect and is significantly lower than ERM and Mouli+CAD for all values of in AProb metric. For further discussions see Fig. and F22 and refer to Eq. 34 the model selection criteria used to select the best model.
40

---

1.2
AutoACER: AutoACfR(DD((cc))
Mouli+
Average Group Accuracy
1.1
AutnACTR+ Riesz(acc))
AutoACER DE(loss)
Moull AuttAAAA
ERM
1.0
0.9
0.8
0.7
0.6
0.5
0.5
0.6
0.7 predictive correlation (x)
0.8
0.9
0.99
AutoACER: DE(acc)
AutoACER-Rlisztioe *outoRAu
Mouli+
AutoACER+ DE(loss)
ERM
Spurious Topic dProb
0.5
AuloACER (tiesz(acc)
0.4
0.3
0.2
0.1
0.0
0.5
0.6
0.7
0.8
0.9
0.99
predictive correlation (x)
Figure 14: Performance of AutoACER using different causal effect estimators for Syn-Text- Unobs-Conf: AutoACER uses causal effect estimator to determine the spuriousness of given attribute Stage and then regularize classifier proportional to the estimated effect Stage In this work, we consider two different estimators Direct and Riesz each with two ways of selecting the best estimate (using validation loss or accuracy, see $E.4 for details). Fig. 7a we select the causal effect estimator that performs best in Stage 2. Thus is not clear from Fig. 7a if any particular estimator is more suitable to estimate the causal effect in particular dataset. In this figure, show the performance of AutoACER using all the different estimators separately. DE(-) is the Direct estimator and Riesz(-) is the Riesz estimator with their two different settings. The x-axis shows the predictive correlation (x) in the dataset and the y-axis shows average group accuracy and AProb in the top and bottom rows respectively. We observe that AutoACER performs equivalently when using any of the available estimators on both metrics. Compared to other baselines using any of the estimator AutoACER performs better in both average group accuracy and AProb. This demonstrates the robustness of the method in choosing different causal effect estimators and noise in the estimated causal effect for training classifier that generalizes to spurious attributes. For more discussion see $2 and Fig. 15 and 16 for results MNIST34 and Twitte-AAE dataset respectively. Refer to Eq. 34 for the model selection criteria used to select the best model.
41

---

1.2
AutoACFR+
AutoACER+ Riesz(loss)
Mouli+ CAD
Average Group Accuracy
1.1
+ DE(loss)
AutoACTR +Rie sz(arc)
1.0
0.9
0.8
0.7
0.6
0.5
0.5
0.6
0.7
0.8
0.9
0.99
predictive correlation (k)
0.6
AutoACEn+DE(ucc.
AutoACER-Riesz(lozg Mouli+CAD
A DE(loss)
AAutoACER
Spurious Topic AProb
0.5
AutoACER Riesz(acc)
0.4
0.3
0.2
0.1
0.0
0.5
0.6
0.7
0.8
0.9
0.99
predictive correlation (x)
Figure 15: Performance of AutoACER using different causal effect estimators for MNIST34: In this work, we have considered four different causal effect estimators to determine the spuriousness of a given attribute (see $E.4). Fig. 7b aggregates the performance of AutoACER by selecting the estimator that gives best performance. Thus we expand the results in Fig. 7b to demonstrate the performance of AutoACER when using the causal effect estimate from different estimators individually. DE(.) is the Direct estimator and Riesz(-) is the Riesz estimator with their two different settings. The x-axis shows the predictive correlation (x) in the dataset and the y-axis shows average group accuracy and AProb in the top and bottom rows respectively. We observe that AutoACER performs equivalently when using any of the available estimators both metrics. Compared to other baselines using any of the estimator AutoACER performs better in both average group accuracy and AProb. This demonstrates the robustness of the method in choosing different causal effect estimators and noise in the estimated causal effect for training classifier that generalizes to spurious attributes. For discussion see F22 and Fig. 14 and 16 for results on Syn-Text-Unobs-C Unobs-Conf and Twitter-AAF dataset respectively. Refer to Eq. 34 for the model selection criteria used to select the best model.
42

---

1.2
AutoACEn-+ DE(ccc)
AutoACER+ Riesz(loss)
Moull+ CAD ERM
Average Group Accuracy
1.1
AutoACER DE(loss)
Mouli AutloAAA
1.0
0.9
0.8
0.7
0.6
0.5
0.5
0.8 predictive correlation (x)
0.9
0.99
0.6
AutoACER+ DE(acc)
Riesz(loss)
Moull+ CAD
AutoACER+ DElloss)
Moull+ AutoACER
Spurious Topic &Prob
0.5
AutoACER+ Rieszlacc)
0.4
0.3
0.2
0.1
0.0
0.5
0.8 0.9
0.99
predictive correlation (x)
Figure 16: Performance of AutoACER using different causal effect estimators for Twitter-AAE: In this work, we have considered four different causal effect estimators to determine the spuriousness of a given attribute (see $E.4). Fig. 7c aggregates the performance of AutoACER by selecting the estimator that gives best performance. Thus we expand the results in Fig. 7c to demonstrate the performance of AutoACER when using the causal effect estimate from different estimators individually. DE(-) the Direct estimator and Riesz(-) is the Riesz estimator with their different settings. The x-axis shows the predictive correlation (x) in the dataset and the y-axis shows average group accuracy and AProb in the top and bottom rows respectively. Similar the trend in Fig. [4 and[1) AutoACER performs equivalently when using different causal effect estimators. For more discussions see F2 and refer to Eq. for the model selection criteria used select the best model.
43


Reviews:
[{"review_id": "Ami9BOHw15", "reviewer": "Reviewer_nk8U", "summary": "The authors study the problem of learning under the presence of spurious correlations, given multiple attributes, some of which may be spurious. They first propose three causal graphs to represent the data generating process, and show that two them allow for identification of the causal effect of the attributes on the label. They propose a method to identify spurious attributes by computing the causal effect of each attribute on the label, under two possible causal graphs, and then regularizing the model based on the magnitude of this treatment effect. They show that their method beats the baselines on three datasets.", "questions": "Please address the weaknesses above.", "limitations": "The authors have adequately addressed the limitations.", "rating": 5, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- The paper tackles an important and well-studied problem in machine learning.\n- The paper is generally well-written and easy to follow.\n- The paper is grounded in solid causality theory.", "weaknesses": "1. The authors demonstrate theoretical guarantees for two causal graphs shown (DGP-1 and DGP-2). In practice, assuming the causal structure seems like a fairly strong assumption, and the authors do not really examine what happens when the graph is mis-specified. For example, does the method still work if the true data generating process is anti-causal?\n\n2. In order to compute the regularization term, the authors require a sample from the counterfactual distribution. Learning a model that can generate such counterfactual samples seems difficult. In their real-world dataset example, the authors use GPT-3 to generate such counterfactuals. Having access to an LLM seems like it should be outside the scope of the problem, as the authors could have also just asked GPT-3 to predict the sentiment directly (and likely get decent performance). The authors should address (empirically) how to generate these counterfactuals for other text and image datasets, and how the quality of this model impacts their method.\n\n3. The empirical evaluations feel lacking to me. For example, the authors do not evaluate on typical spurious correlation datasets such as Waterbirds, CelebA, or MNLI. In particular, CelebA contains many attribute fields which would be ideal to demonstrate their method.\n\n4. The authors should empirically examine the case where there are multiple spurious attributes, which may be inter-correlated. Does computing the treatment effect of each attribute and then regularizing each one separately make some assumption about the independence of the spurious attributes? \n\n5. The authors should show the results of a few more baseline methods that are popular in the spurious correlation literature, such as JTT [1] (which also does not require knowledge of the attributes), or GroupDRO [2] as an upper bound.\n\n[1] https://arxiv.org/abs/2107.09044\n\n[2] https://arxiv.org/abs/1911.08731", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "> **W1: The authors demonstrate theoretical guarantees for two causal graphs shown (DGP-1 and DGP-2).** (part of the remark left out for brevity)\n\nA1: We politely disagree with the reviewer's comment. In summary, our method does not assume the knowledge of underlying DGP and thus is invariant to any misspecification in the graph. We consider certain illustrative DGPs (DGP1 and DGP2) to show that causal effects are only identifiable in certain causal graphs. In particular, DGP1 is fairly general and covers a wide range of real-world datasets where the labels are generated by manual annotation and the input contains all the attributes sufficient to allow for such labeling without any external knowledge. But in our empirical experiments, we use a general-purpose causal effect estimator (Direct and Riesz) that doesn’t assume the knowledge of the underlying DGP of the dataset. Next, we go on to show that even when the causal effect is not identifiable (eg. in DGP3 and experimentally simulated in the Syn-Text-Unobs-Conf dataset, see Section 4.1 and Appendix E.1) our method is able to perform significantly better than all the considered baselines (results in Section 4.3 and Appendix F). Please see the “Our method does not assume knowledge of the underlying DGP” discussion in the global comment (response to all reviewers) of the rebuttal for a detailed discussion.\n\nWill our method work in the anti-causal setting? In an anti-causal setting, the causal effect of all attributes is zero by definition. Since our method depends on computing the causal effect of different attributes, it is not guaranteed to work for an anti-causal setting.\n\n\n\n> **W2: In order to compute the regularization term, the authors require a sample from the counterfactual distribution.** (part of the remark left for brevity)\n\nA2:  We agree with the reviewer’s critique that our method requires access to the counterfactual distribution and the quality of these counterfactuals could impact our method. However, we have addressed this concern in the paper with experiments on datasets with and without access to Oracle counterfactual distributions like LLMs. For a summary, see the “Learning counterfactual distribution” discussion in the global comment of the rebuttal. \nIn addition, a common deployment goal is to build a model with efficient inference at test time. In such a case, it is reasonable to use an expensive model like GPT3 for generating counterfactuals during training and build a smaller, efficient prediction model for inference. Using GPT directly for real-world use cases will have scalability issues. \n\n\n\n\n> **W3: The empirical evaluations feel lacking to me. For example, the authors do not evaluate on typical spurious correlation datasets such as Waterbirds, CelebA, or MNLI.** (part of the remark left out for brevity)\n\nA3: In the appendix (E.1) we evaluated our method on three different attributes of the Civil-comments dataset, another real-world dataset considered in the spurious correlation literature [1], and part of the challenging WILDS benchmark [4] for out-of-distribution generalization. This dataset also has multiple spurious attributes out of which we subsample three – gender, race, and religion – and evaluate our method on all three attributes (see Section F.1, F.2, Table 10, and Fig 9 in the appendix for detailed discussion). These attributes are present in the sentence in a subtle way and thus cannot be easily removed by simply discarding a few words from the sentence. To summarize the result,\nCausal effect Estimation (Stage 1): Table 10 in the appendix summarizes the estimated causal effect for each of the attributes of this dataset. Since this is a real-world dataset, the true causal effect for each of the attributes is unknown but we expect them to be $0$ since these sensitive attributes should not affect the task label $y$ (toxicity of a sentence). We observe that both the causal effect estimators (Riesz and Direct) perform similarly and have a causal effect close to $0$. \nOverall Performance (Stage 2): Fig 9a, 9b, and 9c in the appendix show the overall performance on all different attributes of this dataset. Overall, we observe similar results as the TwitterAAE dataset where our method performs comparably to the baselines on the Average Group Accuracy but our method has close to optimum $Delta$Prob i.e. 0. \n\n\n\n> **W4: The authors should empirically examine the case where there are multiple spurious attributes, which may be inter-correlated.** (part of the remark left out for brevity)\n\nA4: We thank the reviewer for this suggestion. If multiple features are dependent it is possible that the regularization step might become difficult since the regularizer might need to satisfy the causal effect constraints among the features (which is unavailable). That said, given the limited time and computing resources, we plan to include this experiment in the camera-ready version of the paper if accepted. \n\n\n\n\n\n> **W5: The authors should show the results of a few more baseline methods that are popular in the spurious correlation literature, such as JTT [1], or GroupDRO [2] as an upper bound.**\n\nA5: We thank the reviewer for pointing this out. We have added results on three new baselines (JTT[1], EIIL[2], and IRM [3]) on two datasets – Syn-Text-Unobs-Conf and  MNIST34 dataset considered in this work. We find that our method outperforms all the baselines considered on both the metrics of interest – Average Group Accuracy and  $\\Delta$Prob. See the “Results on Additional Baselines” discussion in the global comment and Fig 1a and 1b in the uploaded rebuttal document for detailed discussion. \n\n\n\n\n\n**References**\n\n[1] Just Train Twice: Improving Group Robustness without Training Group Information, ICML 2021\n\n[2] Environment Inference for Invariant Learning, ICML 2021\n\n[3] Invariant Risk Minimization, 2020,\n\n[4] WILDS: A Benchmark of in-the-Wild Distribution Shifts"}, {"review_id": "PSGRvr8eaX", "reviewer": "Reviewer_pmkx", "summary": "The paper proposes a new method to detect and remove spurious attributes. First, the paper gives the sufficient conditions that are needed for estimating the causal effects with theoretical proof. To detect the spurious attribute, the proposed method estimates the causal effect based on a deep learning-based estimator [5]. To mitigate the identified spurious attributes, the method adds a regularization term that aims at matching the classifier’s output with the estimated causal effect of an attribute on the label (Eq. 2). The paper further proves that the proposed regularization term’s robustness to noise in causal effect estimation given that the ranking of estimated treatment effect is correct. The experiments are conducted on three datasets, demonstrating the effectiveness of the proposed method.", "questions": "In the rebuttal, I expect the authors to address my concerns (listed in the “weaknesses” section) by answering the following questions:\n\n1. Add discussion or comparison with other related works [31-34]\n2. Will the code be released for better reproducibility?\n", "limitations": "The paper has adequately addressed the limitations (Section 6). From my perspective, the paper does not have a potential negative societal impact.", "rating": 7, "confidence": 4, "soundness": 4, "presentation": 4, "contribution": 4, "strengths": "1. The paper is well-written and easy to follow.\n2. The paper presents insightful theoretical proof.\n3. The proposed method achieves comparable or better empirical results than other methods.\n", "weaknesses": "**[Discussion or Comparison with Other Methods]** The paper fails to discuss or compare with other methods of identifying spurious attributes. EIIL [31] maximizes the IRM objective to infer environments. DebiAN [32] uses the violation of the fairness criterion to partition data into spurious subgroups. Domino [33] proposes error-aware clustering to detect spurious correlations. JTT [34] regards incorrectly predicted samples to detect spurious correlation. \n\n**References**\n\n[31] Elliot Creager, Joern-Henrik Jacobsen, and Richard Zemel, “Environment Inference for Invariant Learning,” in ICML, 2021.\n\n[32] Zhiheng Li, Anthony Hoogs, and Chenliang Xu, “Discover and Mitigate Unknown Biases with Debiasing Alternate Networks,” in ECCV, 2022.\n\n[33] Sabri Eyuboglu, Maya Varma, Khaled Kamal Saab, Jean-Benoit Delbrouck, Christopher Lee-Messer, Jared Dunnmon, James Zou, and Christopher Re, “Domino: Discovering Systematic Errors with Cross-Modal Embeddings,” in ICLR, 2022.\n\n[34] Evan Z. Liu, Behzad Haghgoo, Annie S. Chen, Aditi Raghunathan, Pang Wei Koh, Shiori Sagawa, Percy Liang, and Chelsea Finn, “Just Train Twice: Improving Group Robustness without Training Group Information,” in ICML, 2021.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "> **Q1: Add discussion or comparison with other related works**\n\nA: We thank the reviewer for pointing this out. Given limited time and computation constraints, we have added results on three new baselines (JTT[34], EIIL[31], and IRM [35]) on two datasets – Syn-Text-Unobs-Conf and  MNIST34 dataset considered in this work. In summary, our method outperforms all the baselines considered on both the metrics of interest – Average Group Accuracy and  $\\Delta$Prob. See the “**Results on Additional Baselines**” discussion in the global comment and Fig 1a and 1b in the uploaded rebuttal document (in the global comment) for detailed discussion. \n\nDebiAN [32] proposes an alternating framework – Discoverer to find the biased subgroups and Classifier to train a model such that the bias discovered by Discoverer is fixed. This method bears similarity to the EIIL [31] framework (added as a baseline in our work) where they use IRMv1 penalty to automatically find the biased subgroup instead of group fairness violation metrics considered in this work. Though the EIIL framework doesn’t use the alternating strategy to further refine the model. In future work, it would be interesting to study the connection between these invariance or fairness constraints and the corresponding causal effect of attributes. Next, they use reweighting instead of regularization to mitigate the bias in the model. In future work, we can also explore reweighting-based techniques, such as inverse propensity weighing, for estimating the causal effect.\n\nDomino [33] mentioned by the reviewer only focuses on discovering the biases and provides no method to fix them or learn an unbiased model whereas our work aims to do both the task – discover and learn an unbiased model.\n\n\n\n\n> **Q2: Will the code be released for better reproducibility?**\n\nA: Yes, we will release the code with the camera-ready version of our paper. \n\n\n\n\n**References**\n\n\n[33] Discover and Mitigate Unknown Biases with Debiasing Alternate Networks, ECCV 2022\n\n[34] Just Train Twice: Improving Group Robustness without Training Group Information, ICML 2021\n\n[31] Environment Inference for Invariant Learning, ICML 2021\n\n[35] Invariant Risk Minimization, 2020"}, {"review_id": "zSeCvlDcVP", "reviewer": "Reviewer_quUc", "summary": "The authors propose to reduce the effect of spurious attributes on the classification of, say, images, by first estimating the true causal effects and then regularizing the effect of spurious attributes to be closer to the estimated effects. They show, in a theoretical scenario, that this approach is sound and robust to noisy estimates in the first stage.", "questions": "- Given that the entire point of using regularization instead of feature selection is to ensure that causal attributes are not accidentally discarded due to our uncertainty as to which attributes are spurious, is it reasonable to assume in Section 3.3 that the representation disentangles between the two categories of attributes?\n- In particular, is there a \"smart\" encoder architecture which would ensure that the representation correctly disentangles with \"high probability\"?\n- Similarly, since the penalty weights $\\lambda$ are specifically chosen to satisfy a certain inequality, then if our causal estimates are wrong, what would be the benefit of using regularisation?\n- Overall, what are the upsides and downsides of using regularization over feature selection?\n- Can the authors explain what prevents the desired classifier from being optimal in Theorem 3.1 when the representation is of higher dimension?\n- Perhaps relatedly, could a consistent estimator of causal feature effect for step 1 be combined with a consistent step 2 (e.g., in the setting of Theorem 3.1) to provide a consistent estimate in which the desired classifier is indeed the global optimum (also in the higher dimensional case)?\n\n", "limitations": "The authors do not discuss the limitations of their approach in detail.", "rating": 5, "confidence": 4, "soundness": 3, "presentation": 4, "contribution": 3, "strengths": "- The paper is clearly written, and tackles an important problem of reducing the effects of spuriously correlated variables on prediction tasks.\n- The theoretical results are interesting.\n", "weaknesses": "- The proof sketches do not currently give any intuition about the shape of the proofs, the simply restate what has to be proved.\n- It is unclear what the benefit of using the authors' approach is over doing the same first stage and discarding the spurious attributes.\n- If the causal effect estimation relies on knowledge about the causal graph (DGP-1, DGP-2), then why do we need to do all this? Should it not already be known which attributes are causal and which are spurious through graphical criteria?\n", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "> **W1: The proof sketches do not currently give any intuition about the shape of the proofs, they simply restate what has to be proved.**\n\nA: We thank the reviewer for pointing this out. We will update the paper to include a more technical proof sketch.\n\n\n\n\n> **W2: It is unclear what the benefit of using the authors' approach is over doing the same first stage and discarding the spurious attributes.**\n\n> **Q4: Overall, what are the upsides and downsides of using regularization over feature selection?**\n\nA: Compared to doing the first stage and discarding spurious attributes, there are two key benefits of using regularization over feature selection: \n1. **Noise in estimating the causal vs spurious attribute (Lines 38-39)**: The causal effect of attributes obtained in the first step could be noisy due to various reasons like non-identifiability of causal effect, etc. Thus it is possible that the causal effect for the spurious attribute could be non-zero. Simple thresholding techniques might lead to some false positive or false negative spurious attributes. As a result, this approach of estimating the causal effect and then discarding the spurious attribute may not work. See “**Robustness to noise in the estimated causal effect**” in the global comment of the rebuttal for discussion on the robustness of our method to noise. \n2. **Attributes could have a continuous range of causal effects**: An example to justify this is the MNLI dataset [1], a popular dataset used in the spurious correlation literature. Given a premise and a hypothesis, the task is to predict whether the hypothesis entails, contradicts, or is neutral with respect to the premise. It has been observed that the presence of negation words (“nobody”, “no”, “never”, and “nothing”) is correlated with the contradiction label. At the same time, these features are sometimes important for prediction since they change the meaning of the sentence and thus have an aggregate non-zero causal effect. Thus regularizing with the correct causal effect is important to learn a correct classifier. \n\n[1] Adina Williams, Nikita Nangia, Samuel R. Bowman, 2018\n\n\n\n\n> **W3: If the causal effect estimation relies on knowledge about the causal graph (DGP-1, DGP-2), then why do we need to do all this?** (part of the remark left out for brevity)\n\nA: We politely disagree with this comment. In summary, our method doesn’t assume the knowledge of underlying DGP. We consider two commonly occurring DGPs (DGP1 and DGP2) only to illustrate that causal effects are only identifiable in certain causal graphs.\nAlso, the DGP considered in our causal graph is general/has unknown edges. There are certain edges that are unknown (shown by the red color in the graph) and thus one cannot use the graphical criteria to find the causal and spurious attribute. Please see the “**Our method does not assume knowledge of the underlying DGP**” discussion in the global comment of the rebuttal. \n\n\n\n\n\n> **Q1 and Q2: Is it reasonable to assume in Section 3.3 that the representation disentangles between the two categories of attributes?** (part of the remark left out for brevity)\n\nA: We agree with the reviewer’s comment that it is not reasonable to assume that the latent space will always disentangle. But, we only make this assumption for creating a simple setup where we could theoretically study the effectiveness of our method in the presence of noisy estimates of the causal effects. But empirically, we don't make the assumption that the encoder disentangles the latent space into such attributes and show that our method is still effective and robust to noisy estimates of the causal effects.\n\n\n> **Q3: Similarly, since the penalty weights $\\lambda$ are specifically chosen to satisfy a certain inequality, then if our causal estimates are wrong, what would be the benefit of using regularisation?**\n\nA: We believe there is a slight misunderstanding in the interpretation of Theorem 3.1. The theorem states that we don’t need a precise estimate of the causal effect of the attributes for learning the correct classifier. Rather, as long as the penalty weights $\\lambda$ (inverse of the estimated causal effect of the attribute, Line 199) satisfy the specified inequality, our method will select the correct classifier. As long as the estimated ranking of causal effects is correct, our method will select the correct classifier (Remark on line 223). This shows that our method is robust to the error in the estimates of the causal effect of the attributes. \n\n\n \n\n\n> **Q5 and Q6: Can the authors explain what prevents the desired classifier from being optimal in Theorem 3.1 when the representation is of higher dimension?** (part of the remark left out for brevity)\n\nA: We believe there is a slight misunderstanding in the interpretation of Part 2 of Theorem 3.1. We only make the assumption that there is **one high-dimensional causal** and **one high-dimensional spurious** feature in the representation for ease of exposition. In case, there are multiple high-dimensional causal and spurious attributes, all the different causal attributes can be concatenated into a single bigger high-dimensional vector and similarly for multiple spurious attributes and the same proof will hold. We leave the extension of our current proof for the case with multiple high-dimensional causal and spurious attributes (each with different causal effect) for future work. \n\n\n\n\n> **Limitations: The authors do not discuss the limitations of their approach in detail.**\n\nA: We thank the reviewer for pointing this out and we will elaborate on them further in the camera-ready version. Here is the summary:\n1. Our method only works when the underlying dataset-generating process is causal. \n2. We can guarantee the identification of causal effects only in certain kinds of DGPs. For a general DGP, while we explore this limitation both theoretically (Theorem 3.1) and empirically (Syn-Text-Unobs-Conf), a more extensive study of robustness is needed. \n"}, {"review_id": "mv3E9MbJ9M", "reviewer": "Reviewer_zxmG", "summary": "In this paper, the authors proposed a causal effect regularization technique - CausalReg, which can effectively identify and remove the spurious but unknown attributes. CausalReg is robust to no-identifiable issues, finite sample error, and noise. The experimental results demonstrate the superior performance of CausalReg in identifying and exclude the spurious attributes. ", "questions": "1. The effect of CausalReg seems to rely on the ML model in stage 1 can learn a fairly good causal relationship. Is it true? If so, how much would the authors anticipate the performance change when adapting other deep learning models in Stage 1?\n\n2. How was the counterfactual distribution learned (mentioned in line 176, equation (2)) \n\n3. What would happen if some causal features were missing. \n\n\n\n ", "limitations": "As the authors have mentioned, one major limitation is that the theoretical guarantee of causal discovery works only under certain data generation procedures. ", "rating": 6, "confidence": 3, "soundness": 3, "presentation": 4, "contribution": 3, "strengths": "The paper is well-written, with a strong theoretical and experimental backend to justify the ability of the CausalReg to automatically remove the spurious correlated features.  Specifically, in theory, the authors have proved that under certain data generation structures, the causal effects are guaranteed to be identified. In practice,  the algorithm demonstrates significant control of the spurious correlated feature compared to other approaches (ERM, Mouli, CAD). ", "weaknesses": "Major:\n\n1. Precision and Recall experiment is missing: Some experiments should be done to reflect the precision and recall of the discovery of spurious and causal attributes. Specifically, the paper claims its advantage compared to other methods that require binning with thresholds to identify the spurious and causal effect; the authors then should compare with these algorithms and demonstrate comparable results even without binning techniques. \n\n2. The mathematical definition of spurious attributes is not completely clear. \n\n\n\nMinor:\n\n1. The figures seem to be twisted\n2. Legends in Fig 3 is not clear\n\n\n\n", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "> **W1: Precision and Recall experiment is missing: Some experiments should be done to reflect the precision and recall of the discovery of spurious and causal attributes.** (part of the remark left out for brevity)\n\nA: We thank the reviewer for suggesting this experiment. However, classifying an attribute as spurious or causal based on its causal effect will require some thresholding criteria. To the best of our knowledge, no such previous work exists that uses the causal effect of an attribute to classify them as causal or spurious. One exception is the Mouli+CAD baseline that defines a score for every attribute to classify them as spurious or not. We observe that for two datasets, Syn-Text-Unobs-Conf and MNIST34, Mouli+CAD is not able to detect the spurious attribute correctly. Comparatively, for our method even though the causal effect estimated for the spurious feature is not exactly zero, our method performs better than the Mouli+CAD baseline since we don't perform any hard thresholding for the spurious feature (see Section 4 for details). \n\n\nThat said, we have plotted the AUROC curve (see Fig 2 in the uploaded document in the global comment of rebuttal) for the identification of causal and spurious attributes by thresholding the causal effect estimated for a different feature. In the plot, the orange curve shows the AUROC curve for Riesz Estimator and the blue curve is for the Direct Estimator (see Section 3.2, Stage 1 and Appendix E.4 for details on the estimator). Riesz Estimator performs better than the Direct as shown by the higher area under the curve. The “star” marked in the plot shows the TPR (true positive rate) and FPR (false positive rate) of the identification of causal and spurious attributes by the Mouli+CAD method. \n\n\n\n\n\n\n> **W2: The mathematical definition of spurious attributes is not completely clear.**\n\nA: We thank the reviewer for pointing this out. We have defined the spurious attribute in Lines 94-96 stating “We use the fact that changing spurious attributes will not lead to a change in the task label i.e. they have zero causal effect on the task label y.” Thus a spurious attribute has zero true causal effect on the task label $y$. We will make this more precise in the camera-ready submission if accepted. \n\n\n\n> **W3: The figures seem to be twisted**\n\n> **W4: Legends in Fig 3 is not clear**\n\nA: We thank the reviewer for pointing this out. We will make the necessary changes in the camera-ready submission if accepted. \n\n\n\n\n> **Q1: The effect of CausalReg seems to rely on the ML model in stage 1 can learn a fairly good causal relationship. Is it true?** (part of the remark left out for brevity)\n\nA:  It is true that having a good estimate of the causal effect will definitely help the subsequent steps of our method. But since we use a continuous value of the causal effect of the attribute for regularization instead of hard thresholding, our method allows for error in the first step not to affect the later steps severely. Thus our method is robust to error in the estimation of causal effect in Stage 1. \n\nIn stage 1 of our experiments, we used two different deep-learning-based causal effect estimators, Direct and Reisz (see Section E.4 in the appendix for details). In practice, one can replace these estimators with any reasonable causal effect estimator of their choice based on the dataset considered. We observe that both estimators give a similar estimate on all the datasets whereas Riesz performs relatively better when the predictive correlation $\\kappa$ is high. At higher $\\kappa$, the causal effect of the spurious attribute is noisy i.e. have a non-zero value. In spite of this noise and slight difference in the causal effect estimate of both the estimators in the first step, in the second stage our method is able to perform equally well for both the estimators used (see Fig 13, 14, and 15 in the appendix for the individual performance of our method when using the Direct and Riesz estimator in stage 1). Given these observations, we conjecture that our method should be robust to the choice of causal effect estimator used in stage 1. Theorem 3.1 also states that we only need the ranking of the causal effect of causal and spurious attributes to be correct in order to learn an optimal classifier further demonstrating the robustness of our method to the noise in the causal effect estimation that could happen due to choice of the estimator. See “**Robustness to noise in the estimated causal effect**” in the global comment of the rebuttal for further discussion.\n\n\n\n> **Q2: How was the counterfactual distribution learned (mentioned in line 176, equation (2))**\n\nA: We have provided a detailed answer titled “**Learning counterfactual distribution**” in the global comment of the rebuttal.\n\n\n> **Q3: What would happen if some causal features were missing.**\n\nA: There are two potential problems that could happen:\n1. **Drop in the overall accuracy**: It is possible that since some causal features were missing, spurious attributes may have been providing the missing information/compensating for the drop in the accuracy of a learned classifier. Now, if we remove those spurious features, the overall accuracy might drop. \n2. **Identifiability of causal effect**: Given an attribute, we find the causal effect of the attribute on the task label $y$. For estimating the causal effect, we use a causal effect estimator that may need access to other covariates/attributes for correctly estimating the causal effect. In case some of the other attributes (causal or spurious) are missing, it might affect the performance of the causal effect estimator in Stage 1. That said, we have shown that our method is robust to the noise in the estimation of the causal effect in Stage 1 (see “**Robustness to Noise in the estimated causal effect**” discussion in the global comment of the rebuttal for further detail). \n\nWe will add a brief discussion on this in the camera-ready version if accepted.\n"}]

Author rebuttal:

> **Our method does not assume knowledge of the underlying DGP. We describe three commonly occurring DGPs only to illustrate identification properties** (Reviewer nk8u, quUc):


**Identifiability of causal effect**: We have listed different DGPs (data-generating processes) common in the real world and shown that causal effects are identifiable for some of them. However, our method doesn't require the knowledge of underlying DGP (see below). We agree that for different DGPs, there could be different correct causal effect estimators, but they don't require the knowledge of whether the attribute for which we are estimating the causal effect is causal or spurious. For example in DGP1, we don’t know beforehand whether A is causal or spurious (In Fig 2, the red arrow in DGP1 depicts that the edge is unknown) and we can use the causal effect estimator designed in the proof of Claim 1 of Proposition 3.1 to estimate the causal effect of A on X directly (equation 11 in appendix B). If the value of the estimated causal effect under an infinite sample limit is 0, then A is spurious otherwise not. 


**Our method doesn’t need knowledge of underlying DGP**:  In our empirical study, we consider different datasets with different underlying DGPs. For example, MNIST34 follows DGP2, real world-datasets TwitterAAE and CivilComments follow DGP1, and Syn-Text-Unobs-Conf follows DGP3 (see Section 4.1). However, our method does not use this knowledge. To demonstrate this, we have used the same causal effect estimator (Riesz and Direct) for all our experiments (see section 4.2).






> **Results on Additional Baselines** [Reviewer nk8u,pmkx]:

We have added additional baselines to compare our method. We have limited our evaluation to two datasets, Syn-Text-Unobs-Conf and MNIST34 due to time and computing resources constraints, and will add the comparison on other datasets in the camera-ready submission if accepted. See Fig 1(a) and Fig 1(b) in the rebuttal document in the global comment for the plots. In summary, 
1. **Syn-Text-Unobs-Conf dataset (1a in rebuttal doc)**: We have added three new baselines, JTT[1], EIIL[2], and IRM[3]. Unlike Mouli+CAD, JTT, EIIL, and IRM are able to considerably decrease the $\Delta$Prob (lower is better) while having better Average group accuracy compared to ERM. However, our method (CausalReg) is able to perform better than all the considered baselines on both metrics.
2. **MNIST34 dataset (1b in rebuttal doc)**: Due to time and compute constraints we have only been able to add a comparison to the JTT and IRM baseline for this dataset but plan to add other baselines in the camera-ready submission. Though JTT is able to lower the $\Delta$Prob (lower is better) compared to Mouli+CAD and ERM, our method is able to outperform all the baselines on both metrics.


[1] Just Train Twice: Improving Group Robustness without Training Group Information, ICML 2021

[2] Environment Inference for Invariant Learning, ICML 2021 

[3] Invariant Risk Minimization, 2020






> **Robustness to Noise in the estimated causal effect** (Reviewer nk8u, quUc, zxmG):

1. **Theoretical Analysis**: Theorem 3.1 states that we don’t need access to the precise causal effect estimate of an attribute to learn a model robust to spurious correlation. Our method only requires the ranking of the causal and spurious attributes to be correct to learn the desired classifier. 
2. **Empirical Analysis**: 
    1. **Robustness to varying predictive correlation $\kappa$**: Across datasets, as we increase the predictive correlation ($\kappa$), the causal effect estimate becomes worse (see Table 6-10). In spite of this error in stage 1, our method performs better than the other baselines (see Sections 4.1 and 4.2 in the main paper and Sections F.1 and F.2 in the appendix). 
    2. **Sensitivity to noise in estimated causal effect**: To evaluate the sensitivity to the noise, we regularize the model with our method using a spectrum of different causal effects for the spurious attribute to simulate the noise in the estimation step. We observe that for all the datasets, our method is able to perform better than the baselines even with a large noise. See Fig. 10, 11, and 12 in the appendix for a detailed discussion. 



> **Learning counterfactual distribution** (Reviewer nk8u, zxmG):

Our method assumes access to examples sampled from a counterfactual distribution (Eq. 2 and Line 176) to train an unbiased model. Empirically, we demonstrate the performance of our method on different types of datasets (synthetic, vision, and text) with access to different qualities of counterfactual distributions. More specifically, 
1. **Counterfactuals using GPT3 (Text)**: For the TwitterAAE dataset,  we use GPT3 as the oracle counterfactual distribution (see Table 4 and Section E.1 in the appendix). Given an input sentence, GPT3 is prompted to generate a new sentence where the race-specific attribute is changed from African-American (AAE) to Non-Hispanic White or vice-versa. 
2. **Counterfactual distribution using Topic Model (Text)**: In Appendix E.1, we evaluate our method on three different attributes of the real-world CivilComments dataset. For this dataset, instead of using generative models like GPT3, we use a handcrafted list of words to generate the counterfactual w.r.t. three different attributes — religion, race, and gender (Table 5). We remove the words corresponding to each attribute from the sentence to generate the noisy estimate of counterfactual (see Section E.1).
3. **Counterfactuals using deterministic transformation (Image)**: For certain simple attributes in the image dataset like rotation, background color e.t.c. a deterministic transformation could be used to generate the counterfactual images (as done in our experiment on the MNIST dataset, see Section 4 and E.1). For more complicated transformations like changing the subject in the image, it would be interesting to explore existing generative models in future work.

Meta-review: My recommendation is to accept the paper.

The reviewers reached consensus to accept the paper, although some points do require clarification, especially around the role of identification and disentanglement assumptions in the presentation and evaluation of the method. In cases where specific DGP's are assumed as examples, it should be stated explicitly. Further, the clarlfication about which DGP's apply to different real examples ([here](https://openreview.net/forum?id=V5Oh7Aqfft&noteId=Nxq7S5ANRQ)) should be included in the paper. Clearly, there are cases where the DGP would violate the assumptions of the causal effect estimation methods that are used, so _some_ knowledge of the DGP is necessary for the method to operate as expected; this is fine, but needs to be made very clear.

In the proof where disentanglement is assumed, it should be noted whether this assumption is made without loss of generality, or whether the theorem only covers a special case that is being used for motivation for the method, for which the justification is primarily empirical.

Please carefully review the reviewer comments about what aspects of the discussion should be further clarified in the main text of the paper at camera ready time.
Decision: Accept (poster)