Title: Causal Effect Regularization: Automated Detection and Removal of Spurious Correlations
Venue: NeurIPS 2023
Accepted: yes
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

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 ( ∆ 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.

1 Introduction

When trained on 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, 11]. For example in a sentiment classification dataset that we evaluate (Twitter-AAE [4]), a demographic attribute like race could be spuriously correlated with the sentiment of a sentence [9]. Classifiers trained on such datasets are at risk of failure during deployment when the correlation between the task label and the spurious attribute changes [2, 22, 30, 10].

Assuming that a set of auxiliary attributes is available at training time (but not at test time), several methods have been proposed to mitigate the classifier's reliance on the spurious attributes. The first category of methods assumes that the spurious attributes are known a priori. They develop regularization [35, 15, 22], optimization [30] or data-augmentation [17, 16, 14] 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 (NeurIPS 2023).

STAGE 1 : Estimate Causal Effect

STAGE 2 : Causal Effect Regularization

Spuriousness

(ΔProb)

Acc

c 1

c 2

s 1

s 2

Spurious Attr.

Task Attr.

Low Spurious Correlation

c 1

c 2

s 1

s 2

True Causal Effect

c 1

c 2

s 1

,s

2

Effect Estimate(c

1

,c

2

) > Effect Estimate(s

1

,s

2

)

Our Method

ERM/Prior Method

Evaluation Metrics for Classifier

Regularize

Causal Effect

Spurious Attr.

Task Attr.

Spuriousness

(ΔProb)

Avg Group

Acc

(s 1

,s

2

)

(s 1

,s

2

)

(c 1

,c

2

)

(s 1

,s

2

)

Regularize

Causal Effect

(c 1

,c

2

)

(c 1

,c

2

)

Low Estimation

Error

High Estimation

Error

Estimated Effect

Estimated Effect

Effect Estimate(c

1

,c

2

) > Effect Estimate(s

1

,s

2

)

c 1

c 2

s 1

,s

2

regularizing the classifier to be invariant to 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 [25] or a group transformation [24], or the data-generating process follows a specific graph structure such as anti-causal [38]. However, all these methods assume a strict dichotomy-every attribute is either spurious or not-which makes them susceptible to imposing incorrect invariance whenever there is a 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 a two-step method that ( 1 ) uses an effect estimation algorithm to find the causal effect of a given attribute; ( 2 ) regularizes the classifier proportional to 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 to zero), while retaining the classifier's acccuracy. But in practice it is difficult to have good estimates of the causal effect due to issues like non-identifiability, noise in the labels [39], 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 to errors in effect estimation. Theoretically, on a simple classification setup with two sets of attributes-causal and spurious-we prove that only the correct ranking of the causal effect estimates is 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 baseline 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: a synthetic dataset that includes an unobserved confounding variable and violates the identifiability conditions of causal effect estimators; ( 2 ) MNIST34: a semi-synthetic dataset from [24], where we introduce noise in the image labels; ( 3 ) Twitter-AAE:, which is a 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

estimate of the causal effect of attributes, our method shows significant improvement over previous algorithms in reducing the dependence of a 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 OODGeneralization under Spurious Correlation: Problem Statement

For a classification task, let ( x i , y i , a i ) n i =1 ∼ P m be the set of example samples from the data distribution P , where x i ∈ X are the input features, y i ∈ Y are the task labels and a i = ( a i 1 , . . . , a i k ) , a i j ∈ A j are the auxiliary attributes, henceforth known as attributes for the example x i . We use ' x a j ' to denote an example ' x ' to have attribute a j ∈ A j . 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 i from the given input x i . The task classifier can be written as c ( h ( x )) where h : X → Z is an encoder mapping the input x to a latent representation z := h ( x ) and c : Z → Y is the classifier on top of the representation Z .

Generalization to shifts in spurious correlation. We are interested in the setting where the data-generating process is causal [31] i.e. 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-generating process (see Fig. 2 for examples). Aattribute c ∈ C is called spurious attribute if it is correlated with the task label in the training dataset and thus could be used by a classifier trained to predict the task label, as a shortcut [38, 22]. But their correlation could change at the time of deployment, affecting the classifier's accuracy.

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 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 . Hence, we use the estimated causal effect of an attribute to automatically identify its degree of spuriousness. For a 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 is also zero. More generally, we would like to regularize the effect of each attribute on the classifier'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 a classifier that generalizes to shift in attribute-label correlation by automatically identifying and imposing invariance w.r.t to spurious attributes. In §3.1, we provide sufficient conditions for identifying the causal effect, a crucial first step to detect the spurious attributes. Next, in §3.2 and §3.3, we present the AutoACER method and its theoretical analysis.

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-generating process (DGP). Below we present two illustrative DGPs (DGP-1 and DGP-2 from Fig. 2) under which the causal effect is identified. DGP-1 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-1 is common in many real-world datasets where the task labels are annotated based on the observed input X either automatically using some deterministic function or using human annotators [17, 29]. Thus DGP-1 is applicable for all

the settings where the input X has all the sufficient information for creating the label. Mouli and Ribeiro [25] consider another DGP where a set of transformations (like rotation or vertical-flips in image) over a base (unobserved) image x generates the input X . We adapt their graph to our setting where we include each observed attribute as a 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 [5, 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 data-generating processes. Let A,C,S be different attributes, X be the observed input, Y be the observed task label and U be the unobserved confounding variable. In DGP-2, x is the (unobserved) core input feature that affects the label Y . Then:

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 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 = C ∪ 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 distribution P ( Y | do ( 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 | do ( A )) . (2) For both causal attribute C and spurious attribute S , we show that we can identify the interventional distribution P ( Y | do ( 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 as illustrative examples to show that there exist DGPs, corresponding to commonly occurring datasets, where the attributes' effect is identified. However, the effect is not identified in DGP-3 and possibly other DGPs. Moreover, in practice, the underlying DGP for a 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 §C 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.

Stage 1: Causal Effect Estimation. Given a set of attributes A = { a 1 , . . . , a k } , the goal of this step is to estimate the causal effect ( TE a i )) of every attribute a ∈ A . The causal effect of a 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). If the data-generating process of the task is one of DGP-1 or DGP-2, 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 a

U

A

X

Y

Y

x

X

A

U

Y

x

X

C

S

U

DGP-2

DGP-1

DGP-3

general method, we propose a technique that does not assume knowledge of the DGP. Specifically, we use a conditioning-based estimator (based on the backdoor criterion [27]) and assume the observed variables (X) as the backdoor variables. There is a rich literature on estimating causal effects for high dimensional data [12, 33, 6]. We use a 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 §E for details). Even if the causal effect in the relevant dataset is identifiable, we might get a noisy estimate of the effect due to finite sample error or noise in the labels. Later in §3.3 and §4 we will show that our method is robust to error in the causal effect estimate of attributes both theoretically and empirically. Finally, as a baseline effect estimator, we use the direct effect estimator (henceforth called Direct ) defined as E X ( E ( Y | X,a = 1) -E ( Y | X,a = 0)) for attribute a ∈ A that has limited identifiability guarantees (see §E for details).

Stage2: Regularization. Here our method regularizes the model prediction with the estimate of causal effect = { TE a 1 , . . . , T E a k } of each attribute A = { a 1 , . . . , a k } . The loss objective is,

where R is the regularization strength hyperparameter, P is the training data distribution (§2). The first term L task ( c ( h ( x )) , y ) can be any training objective e.g. cross-entropy or max-margin loss for training the encoder h and task classifier c jointly to predict the task label y given input x . Our regularization loss term L Reg 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 i on the label. Formally,

where x a ′ i ∼ Q ( x c i ) be a sample from counterfactual distribution Q := P ( x c ′ i | x c i ) and x c ′ i is the input had the attribute in input x c i been c ′ i .

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 c i to regularize the model. Thus, it becomes important to study the efficacy of 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 a better classifier than the standard ERM max-margin objective (following previous work [19, 13, 26]) in terms of generalization to the spurious correlations. Let A = { ca 1 , . . . , ca K , sp 1 , . . . , sp J } be the set of available attributes where ca k are causal attributes and sp j are the spurious attributes. For simplicity, we assume that the representation encoder mapping X to Z i.e h : X → Z is 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 a disentangled representation

w.r.t. the causal and spurious attributes, i.e., the representation vector z can be divided into two subsets, features corresponding to the causal and spurious attribute respectively. Thus the task classifier takes the form c ( z ) = ∑ K k =1 w ca k · z ca k + ∑ J j =1 w sp j · z sp j . Note that we make the disentanglement assumption only for creating a 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 L task ( θ ; ( x , y m )) be the max-margin objective (see §A for details) used to train the task classifier ' c ' to predict the task label y m given the frozen latent space representation z . Let the task label y and the attribute ' a ' where a ∈ A be binary taking value from { 0 , 1 } . The causal effect of an attribute a ∈ A on the task label Y is given by TE a = E ( Y | do ( a ) = 1) -E ( Y | do ( a ) = 0) = P ( y = 1 | do ( a ) = 1) -P ( y = 1 | do ( a ) = 0) (see §A for definition). Thus the value of the causal effect is bounded s.t. ˆ TE a ∈ [ -1 , 1] where the ground truth causal effect of spuriously correlated attribute ' sp ' is TE sp = 0 and for causal attribute ' ca ' is | TE ca | > 0 . Given that we assume a linear model, we instantiate a simpler form of the regularization term L Reg for the training objective given in Eq. 1:

where λ ca k := 1 / | TE ca k | and λ sp j := 1 / | TE sp j | are the regularization strength for the causal and spurious features z ca k and z sp j respectively, | · | is the absolute value operator and ∥ w ∥ p is the L p norm of the vector w . Since | TE ( · ) | ∈ [0 , 1] , we have λ ( · ) = 1 / | TE ( · ) | ≥ 1 . In practice, we only have access to the empirical estimate of the causal effect TE ( · ) denoted as ˆ TE ( · ) and the regularization coefficient becomes λ ( · ) = 1 / | ˆ TE ( · ) | . Now we are 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 { 1 , . . . , S } .

̸

̸

Theorem 3.1. Let the latent space be frozen and disentangled such that z = [ z ca 1 , . . . , z ca K , z sp 1 , . . . , z sp J ] (Assm D.1). Let the desired classifier c des ( z ) = ∑ K k =1 w des ca k · z ca k be the max-margin classifier among all linear classifiers that use only the causal features z ca k 's for prediction. Let c mm ( z ) = ∑ K k =1 w mm ca k · z ca k + ∑ J j =1 w mm sp j · z sp j be the max-margin classifier that uses both the causal and the spurious features, and let w mm sp j = 0 , ∀ j ∈ [ J ] . We assume w mm sp j = 0 , ∀ j ∈ [ J ] , without loss of generality because otherwise, we can restrict our attention only to those j ∈ [ J ] that have w mm sp j = 0 . Let the norm of the parameters of both the classifier be set to 1 i.e ∑ K k =1 ∥ w mm ca k ∥ 2 p =2 + ∑ J j =1 ∥ w mm sp j ∥ 2 p =2 = ∑ K k =1 ∥ w des ca k ∥ 2 p =2 = 1 . Then if regularization coefficients are related s.t. mean ( { λ ca k λ sp j · η k,j } k ∈ [ K ] ,j ∈ [ J ] ) < J K where η k,j = ∥ w des ca k ∥-∥ w mm ca k ∥ p ∥ w mm sp j ∥ p , then

̸

Preference: L AutoACER ( c des ( z ) ) < L AutoACER ( c mm ( z ) ) . Thus, our causal effect regularization objective (Def 3) will choose the c des ( z ) classifier over the max-margin classifier c mm ( z ) which uses the spuriously correlated feature.

Global Optimum: The desired classifier c des ( z ) is the global optimum of our loss function L AutoACER when J = 1 , K = 1 , p = 2 , the regularization strength are related s.t. λ ca 1 < λ sp 1 = ⇒ | ˆ TE ca 1 | > | ˆ TE sp 1 | and search space of linear classifiers c ( z ) are restricted to have the norm of parameters equal to 1.

Remark. The result of Theorem 3.1 holds under a more intuitive but stricter constraint on the regularization coefficient λ which states that λ sp j > ( K J η k,j ) λ ca k = ⇒ | ˆ TE sp j | < ( K J η k,j ) | ˆ TE ca k | ∀ k ∈ [ K ] and j ∈ [ J ] . The above constraint states that if the treatment effect of the causal feature is more than that of the spurious feature by a constant factor then the claims in Theorem 3.1 hold.

Proof Sketch. (1) We compare both the classifier c des ( z ) and c mm ( z ) using our overall training objective to our training objective L AutoACER (Eq. 1). Given the relation between the regularization strength mentioned in the above theorem is satisfied, we then show that one can always choose a regularization strength ' R ' greater than a constant value s.t classifier c mm ( z ) incurs a greater

regularization penalty than c des ( z ) (Eq. 3) which is not compensated by the gain in the max-margin objective of c mm ( z ) over c des ( z ) . Thus, the desired classifier c des ( z ) has lower overall loss than the c mm ( z ) in terms of our training objective L AutoACER . (2) We use the result from the first claim to show that c des ( z ) has a lower loss than any other classifier that uses the spurious feature z sp 1 . Then, among the classifier that only uses the causal feature z ca 1 , we show that again c des ( z ) has the lower loss w.r.t. L AutoACER . Thus the desired classifier has a lower loss than all other classifiers w.r.t L AutoACER with parameter norm 1 hence a global optimum. Refer §D for proof.

4 Empirical Results

4.1 Datasets

Theorem 3.1 showed that our method can find the desired classifier in a simple linear setup. We now evaluate the method on a synthetic, semi-synthetic and real-world dataset. Details are in §E.

Syn-Text. We introduce a 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 y 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 Syn-Text-Obs-Conf- a version of the Syn-Text dataset where all three variables/attributes are observed. Next, to increase difficulty, we create a version of this dataset - Syn-Text-Unobs-Conf- where the confound attribute is not observed in the training dataset, corresponding to DGP-3 from Fig. 2.

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 x is an empty set.

Twitter-AAE [4]. This is a real-world dataset where the main task is to 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 a real-world dataset where we have not artificially introduced the spurious attribute we don't have a ground truth causal effect of race on the sentiment label. But we expect it to be zero since changing race of a 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 §F 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 a model that doesn't rely on the spuriously correlated attribute, we create multiple settings for every dataset with different levels of correlations between the main task labels y m and spurious attribute y c sp . Following [19], we use a predictive correlation metric to define the label-attribute correlation that we vary in our experiments. The predictive correlation ( κ ) measures how informative one label or attribute ( s ) is for predicting the other ( t ), κ := Pr ( s = t ) = ∑ N i =1 1 [ 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 0 . Without loss of generality, assuming s = 1 is correlated with t = 1 and similarly, s = 0 is correlated with t = 0 ; predictive correlation lies in κ ∈ [0 . 5 , 1] where κ = 0 . 5 indicates no correlation and κ = 1 indicates that the attributes are fully 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-AAE, between the task label and the spurious attribute (race). See §E 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

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

200

150

100

50

0

Attribute Score (Mouli+CAD)

()

spurious

(a) Syn-Text-Unobs-Conf dataset

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

1500

1400

1300

1200

1100

1000

Attribute Score (Mouli+CAD)

()

rotation

(b) MNIST34 dataset

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

3500

3000

2500

2000

1500

1000

500

0

Attribute Score (Mouli+CAD)

()

race

train a model invariant to those attributes. Given a set of attributes, this method computes a score for every subset of attributes, selects the subset with a minimum score as the spurious subset, and finally enforces invariance with respect to those subsets using counterfactual data augmentation (CAD) [32, 16]. (iii) Mouli+AutoACER : Empirically, we observe that CAD does not correctly impose invariance for a given attribute (see §F for discussion). Thus we add a variant of Mouli+CAD's method where instead of using CAD it uses our regularization objective (Eq. 2) to impose invariance using the causal effect TE a = 0 for some attribute ' a ' . (iv) Just Train Twice [21] ( JTT ): Given a known spurious attribute, JTT aims to train a model that performs well on all subgroups of the dataset, where subgroups are defined based on 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 [2] ( 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 a classifier that only uses the attributes with stable correlations across environments (see E for experimental setup).

Metrics. We use two metrics for evaluation. Since all datasets have binary task labels and attributes, we define a group-based metric ( average group accuracy ) to measure generalization under distribution shift. Specifically, given binary task label y ∈ { 0 , 1 } and spurious attribute a ∈ { 0 , 1 } . Following Kumar et al. [19] we define 2 × 2 groups, one for each combination of ( y, a ) . The subset of the dataset with ( y = 1 , a = 1) and ( y = 0 , a = 0) are the majority group S maj while groups ( y = 1 , a = 0) and ( y = 0 , a = 1) make up the minority group S min . We expect the main classifier to exploit this correlation and hence perform better on S maj but badly on S min where the correlation breaks. Thus we want a method that performs better on the average accuracy on both the groups i.e Acc ( S min )+ Acc ( S maj ) 2 , where Acc ( S maj ) and Acc ( S min ) are the accuracy on majority and minority group respectively. The second metric ( ∆ Prob) measures the reliance of a classifier on the spurious feature. For every given input x a we have access to the counterfactual distribution ( x a ′ ) ∼ Q ( x a ) (§2) where the attribute A = a is changed to A = a ′ . ∆ Prob is defined as the change in the prediction probability of the model on changing the spurious attribute a in the input, thus directly measuring the reliance of the model on the spurious attribute. For background on baselines refer §A a detailed description of our experiment setup refer §E.

4.3 Evaluating Stage 1: Automatic Detection of Spurious Attributes

Failure of Mouli+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 ( κ ). In Syn-Text dataset, at low correlations ( κ < 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). In MNIST34 dataset, Mouli+CAD does not detect any attributes as spurious (shown by blue line for all κ ). For Twitter-AAE 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.

Predictive Correlation

(

κ

)

Dataset

True

Method

0.5

0.6

0.7

0.8

0.9

0.99

Syn-Text-Obs-Conf

0

Direct

0.00

0.00

0.01

0.08

0.16

0.22

Riesz

0.00

0.03

0.03

0.03

0.05

0.15

Syn-Text-Unobs-Conf

0

Direct

-0.01

0.13

0.24

0.37

0.49

0.67

Riesz

0.06

0.19

0.31

0.42

0.58

0.70

MNIST34

0

Direct

0.02

0.03

0.05

0.06

0.15

0.27

Riesz

-0.01

0.06

0.05

0.04

0.2

0.31

Twitter-AAE

-

Direct

0.01

0.07

0.12

0.20

0.27

0.31

Riesz

0.02

0.07

0.12

0.17

0.27

0.37

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

IRM

JTT

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

Spurious Topic

Prob

AutoACER

IRM

JTT

Mouli+

AutoACER

Mouli+CAD

ERM

(a) Syn-Text-Unobs-Conf

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

IRM

JTT

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

Spurious Topic

Prob

Mouli+

AutoACER

Mouli+CAD

ERM

AutoACER

IRM

JTT

(b) MNIST34

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

IRM

JTT

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

Spurious Topic

Prob

Mouli+

AutoACER

Mouli+CAD

ERM

AutoACER

IRM

JTT

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 a fine-grained measure of whether an attribute is spurious or not. Table 1 summarizes the estimated treatment effect of spurious attributes in every dataset for different levels of predictive correlation ( κ ). We use two different causal effect estimators named Direct and Riesz with the best estimate selected using validation loss (see §E). Overall, the Riesz estimator gives a better or comparable estimate of the causal effect of spurious attribute than Direct, except in the Syn-TextUnobs-Conf dataset where the causal effect is not identified. At high predictive correlation( > = 0 . 9 ), as 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. 4 compares the efficacy of our method with other baselines in removing the model's reliance on spurious attributes. On Syn-Text-Unobs-Conf dataset, our method (AutoACER) performs better than all the other baselines for all levels of predictive correlation ( κ ) on average group accuracy

(first row in Fig. 4a). In addition, ∆ Prob (the sensitivity of model on changing spurious attribute in input, see 4.1) for our method is the lowest compared to other baselines (see bottom row of Fig. 4a). For κ ≥ 0 . 8 , Mouli+CAD is the same as ERM since it fails to detect the spurious attribute and thus doesn'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 κ . 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.t 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 ∆ Prob, 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 ∆ Prob among all while obtaining comparable accuracy to ERM, JTT and IRM. To summarize, in all datasets, AutoACER ensures a higher or comparable accuracy to ERM while yielding the lowest ∆ 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 a fair comparison to JTT and IRM, in §F.2 (Fig. 7) we show results under the setting where all the methods (including AutoACER) assume that the spurious attribute is known. Even with access to this additional information, we observe a similar trend as in Fig. 4. AutoACER performs equivalent to all other baselines on average group accuracy with the lowest ∆ Prob among all. Finally, in §F we provide an in-depth analysis of our results, provide recommendations for selecting among different causal effect estimators used by our method (§F.1) and evaluate AutoACER and other baselines on an additional dataset -Civil-Comments [18]-a popular dataset for studying generalization under spurious correlation (§F.2).

5 Related Work

Known spurious attributes. When the spuriously correlated attributes are known a priori, three major types of methods have been proposed, based on worst-group optimization [30], conditional independence constraints [35, 15, 22], or data augmentation [16, 17]. 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 [7] 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 [35, 15, 22]. Methods based on data augmentation add counterfactual training data where only the spurious attribute is changed (and label remains the same) [16, 14, 17].

Automatically discovering spurious attributes. The problem becomes harder if spurious attributes are not known. Mouli and Ribeiro's work [24, 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 to be correlated with the task label (at different strengths). Using conditional independencies derived from a causal graph, Zheng and Makar [38] propose a method to 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 is that our method is not guaranteed to work on datasets with an anti-causal data-generating process, wherein the observed input x and other attributes are generated from the task label y .

References

Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization, 2019. URL https://arxiv.org/abs/1907.02893 .

Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization, 2020.

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.org/p/cwl/cwldpp/2115.html .

Su Lin Blodgett, Lisa Green, and Brendan O'Connor. Demographic Dialectal Variation in Social Media: A Case Study of African-American English. In Proceedings of EMNLP , 2016.

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.

Victor Chernozhukov, Whitney Newey, Victor Quintas-Martinez, and Vasilis Syrgkanis. Riesznet and forestriesz: Automatic debiased machine learning with neural nets and random forests. In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvári, Gang Niu, and Sivan Sabato, editors, International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA , volume 162 of Proceedings of Machine Learning Research , pages 3901-3914. PMLR, 2022. URL https://proceedings.mlr.press/v162/ chernozhukov22a.html .

Elliot Creager, Jörn-Henrik Jacobsen, and Richard S. Zemel. Environment inference for invariant learning. In International Conference on Machine Learning , 2020. URL https: //api.semanticscholar.org/CorpusID:232097557 .

Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) , pages 4171-4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi:10.18653/v1/N19-1423. URL https://aclanthology.org/N19-1423 .

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:10.18653/v1/D18-1002. URL https://aclanthology.org/D18-1002 .

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 , ICML'15, page 1180-1189. JMLR.org, 2015.

Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel Bowman, and Noah A. Smith. Annotation artifacts in natural language inference data. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers) , pages 107-112, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi:10.18653/v1/N18-2017. URL https://aclanthology.org/N18-2017 .

Guido W Imbens and Donald B Rubin. Causal inference in statistics, social, and biomedical sciences . Cambridge University Press, 2015.

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. URL https://proceedings.mlr.press/v99/ji19a.html .

Nitish Joshi and He He. An investigation of the (in)effectiveness of counterfactually augmented data. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , pages 3668-3681, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi:10.18653/v1/2022.acl-long.256. URL https://aclanthology.org/2022.acl-long.256 .

Jivat Neet Kaur, Emre Kiciman, and Amit Sharma. Modeling the data-generating process is necessary for out-of-distribution generalization. In ICML 2022: Workshop on Spurious Correlations, Invariance and Stability , 2022. URL https://openreview.net/forum?id= KfB7QnuseT9 .

Divyansh Kaushik, Amrith Setlur, Eduard Hovy, and Zachary C Lipton. Explaining the efficacy of counterfactually augmented data. International Conference on Learning Representations (ICLR) , 2021.

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://openreview.net/forum?id=HHiiQKWsOcV .

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 on Machine Learning , volume 139 of Proceedings of Machine Learning Research , pages 5637-5664. PMLR, 18-24 Jul 2021. URL https://proceedings.mlr.press/v139/koh21a.html .

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://proceedings.neurips.cc/paper_files/ paper/2022/file/725f5e8036cc08adeba4a7c3bcbc6f2c-Paper-Conference.pdf .

Yann LeCun, Corinna Cortes, and CJ Burges. Mnist handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist , 2, 2010.

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 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-24 Jul 2021. URL https://proceedings. mlr.press/v139/liu21f.html .

Maggie Makar, Ben Packer, Dan I. Moldovan, Davis W. Blalock, Yoni Halpern, and Alexander D'Amour. Causally-motivated shortcut removal using auxiliary labels. In International Conference on Artificial Intelligence and Statistics , 2021.

Tom McCoy, Ellie Pavlick, and Tal Linzen. Right for the wrong reasons: Diagnosing syntactic heuristics in natural language inference. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics , pages 3428-3448, Florence, Italy, July 2019. Association for Computational Linguistics. doi:10.18653/v1/P19-1334. URL https://aclanthology.org/P19-1334 .

S Chandra Mouli and Bruno Ribeiro. Neural networks for learning counterfactual g-invariances from single environments. In International Conference on Learning Representations , 2021. URL https://openreview.net/forum?id=7t1FcJUWhi3 .

S Chandra Mouli and Bruno Ribeiro. Asymmetry learning for counterfactually-invariant classification in OOD tasks. In International Conference on Learning Representations , 2022. URL https://openreview.net/forum?id=avgclFZ221l .

Vaishnavh Nagarajan, Anders Andreassen, and Behnam Neyshabur. Understanding the failure modes of out-of-distribution generalization. In International Conference on Learning Representations , 2021. URL https://openreview.net/forum?id=fSTD6NFIW_b .

Judea Pearl. Causality . Cambridge University Press, 2 edition, 2009. doi:10.1017/CBO9780511803161.

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://www.aclweb.org/anthology/D14-1162 .

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, November 2016. Association for Computational Linguistics. doi:10.18653/v1/D16-1264. URL https://aclanthology.org/D16-1264 .

Shiori Sagawa, Pang Wei Koh, Tatsunori B 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.

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 on Machine Learning , ICML'12, page 459-466, Madison, WI, USA, 2012. Omnipress. ISBN 9781450312851.

Indira Sen, Mattia Samory, Claudia Wagner, and Isabelle Augenstein. Counterfactually augmented 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 2022. Association for Computational Linguistics. doi:10.18653/v1/2022.naacl-main.347. URL https://aclanthology.org/2022.naacl-main.347 .

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 Neural Information Processing Systems , volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper_files/paper/ 2019/file/8fb5f8be2aa9d6c64a04e3ab9f63feee-Paper.pdf .

E. C. T. Inequalities. by g.h. hardy, j.e. littlewood and g. pólya. 2nd edition. pp. xii, 324. 27s. 6d. 1952. (cambridge university press). The Mathematical Gazette , 37(321):236-236, 1953. doi:10.1017/S0025557200027455.

Victor Veitch, Alexander D'Amour, Steve Yadlowsky, and Jacob Eisenstein. Counterfactual invariance to spurious correlations in text classification. In Marc'Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wortman Vaughan, editors, Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual , pages 16196-16208, 2021. URL https://proceedings.neurips.cc/paper/2021/hash/ 8710ef761bbb29a6f9d12e4ef8e4379c-Abstract.html .

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 transformers: State-of-the-art natural language processing, 2019. URL https://arxiv.org/abs/1910. 03771 .

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 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers) , pages 6707-6723, Online, August 2021. Association for Computational Linguistics. doi:10.18653/v1/2021.acllong.523. URL https://aclanthology.org/2021.acl-long.523 .

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 https://proceedings.neurips.cc/paper_files/paper/2022/file/ 536d643875321d6c3282ee8c7ea5eb6a-Paper-Conference.pdf .

Yuchen Zhu, Limor Gultchin, Arthur Gretton, Matt J. Kusner, and Ricardo Silva. Causal inference with treatment measurement error: a nonparametric instrumental variable approach. In James Cussens and Kun Zhang, editors, Proceedings of the Thirty-Eighth Conference on Uncertainty in Artificial Intelligence , volume 180 of Proceedings of Machine Learning Research , pages 2414-2424. PMLR, 01-05 Aug 2022. URL https://proceedings.mlr.press/ v180/zhu22a.html .

A Mathematical Preliminaries

A.1 Causal Effect Estimation and RieszNet Estimator

Let ( X,Y,A ) denote a random input point from the data distribution, where A is the auxiliary attribute label and X is the input covariate and Y 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]):

Given X satisfies sufficient backdoor adjustment the causal effect can be estimated using (see Chapter 3 in Pearl [27] for details):

Henceforth, we will refer to 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 [6, 33]. In this paper, we use one of the recently proposed methods [6], henceforth denoted by Riesz , that uses insights from the Riesz representation theorem to create a multitasking neural network-based method to get a 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 good representation of the input. Let g ( X,A ) := E [ Y | X,A ] , then the estimator used by Riesz is given by:

where α 0 ( 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 [ Y | X,A ] , it suffices to estimate g ( X,A ) = E ( Y | α 0 ( X,A )) . Since α 0 ( X,A ) is a scalar quantity, it is more efficient to estimate E ( Y | α 0 ( X,A )) than to condition on high dimensional ( X,A ) . Thus, Riesz uses a multi-tasking objective to learn both α 0 ( X,A ) and g ( X,A ) jointly. First, a neural network is used to encode the input ( X,A ) to a latent representation Z . Then, the architecture branches out into two heads; the first head trains the Riesz representer α 0 ( X,A ) and the second branch is used to train g ( X,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 l2 regularization loss (see Section 3 in [6] for the exact form of loss). Therefore, the final loss can be written as

with R 1 and R 2 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:

Chernozhukov et al. [6] also proposes another debiased measure of the causal effect given by:

We observe that this measure gives a worse estimate than Riesz on Syn-Text dataset where the ground truth causal effect is known. Thus, in all our experiments we only use the Riesz estimator and leave the exploration of DebiasedRiesz as future work. Please see §E.4 for the setup we use in our 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 a brief introduction to the max-margin training objective that is used to train the classifier we consider in Theorem 3.1. Consider an encoder h : X → Z mapping

the input x to latent space representation z , and a classifier c : Z → Y that uses the latent space representation Z to predict the task label y as c ( z ) = w · z . The hyperplane c ( z ) = 0 is called the decision boundary of the classifier. Let the task label be binary, taking values 1 or -1 , without loss of generality (otherwise, the labels could be relabelled to conform to this notation). Then the points falling on one side of decision boundary c ( z < 0 are assigned one predicted label (say -1 ) and the ones falling on the other side the other predicted label (say +1 ). Then the distance of a point z , having task label y , from the decision boundary is given by:

where ∥ w ∥ 2 is the L2 norm of the classifier. The margin of a classifier is the distance of the closest latent representation z from the decision boundary. Thus, the goal of the max-margin objective is then to train a classifier that has the maximum margin. Equivalently, we want to minimize the following loss for training a classifier that has the largest margin.

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-generating processes. Let A,C,S be different attributes, X be the observed input, Y be the observed task label and U be the unobserved confounding variable. In DGP-2, x is the (unobserved) core input feature that affects the label Y . Then:

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 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 = C ∪ 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. First Claim: To identify the causal effect of attribute A 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 TE A = E [ Y | do ( A ) = 1] -E [ Y | do ( A ) = 0] . We can write P ( Y | do ( A )) as:

Since we have access to the interventional distribution P ( X | do ( A )) and access to observational distribution P ( Y, X, A ) , we can also estimate P ( Y | do ( A )) 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 beforehand. We will show that we can identify the interventional

distribution P ( Y | do ( A )) where A ∈ V . If A = C , then we have:

Then, when we have A = S , we have:

Thus, P ( Y | do ( A )) = ∑ V\ A P ( V \ A ) P ( Y |V ) for all A ∈ V and could be estimated from pure observational data.

C Failure of Mouli on DGP-2 and DGP3

Mouli and Ribeiro [25] define a particular DGP for their task and propose a score that identifies the invariant transformations. DGP-2 and DGP-3 in Fig. 2 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. In addition, we add an additional level of complexity to the DGP by introducing the unobserved confounding variable U that introduces a spurious correlation between different attributes in DGP-2 and between an attribute and task label in DGP-3. The graph in DGP-1 is different from their setting and thus cannot use their method. This shows that the method proposed in their work doesn't generalize to different DGPs. Below, we show that their method will be able to identify the spurious attribute in the DGP-2 but fail to do so in DGP-3.

Corollary C.0.1. Let the observed input X be defined as the concatenation of the C, S and x in DGP-2 i.e. X = [ C, S, x ] and A and x in DGP-3 i.e. X = [ A,x ] . Then, Theorem 1 in Mouli and Ribeiro [25] will correctly identify the spurious attribute in DGP-2. For DGP-3, it will incorrectly claim that there is an edge between A and Y even if it is non-existent in the original graph.

Proof Sketch. For a attribute A to be spurious, the score proposed in Theorem 1 in Mouli and Ribeiro [25] requires conditional independence of the A 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 S correctly satisfy that condition whereas the causal attribute C 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 Y given x due to unblocked path A → U → Y in the graph. See the complete proof below.

Proof. Theorem 1 in Mouli and Ribeiro [25] defines a score, henceforth called mouli's score , to identify whether there is an edge between any node N in the graph and the main task label Y . There is no edge between N and Y iff for all X :

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 = [ x, C, S ] , Γ C ( X ) = [ x, S ] and U Y = ϕ . Thus, the mouli's score becomes:

̸

̸

since for at least one combination of x, C, S we have P ( Y | x, S ) = P ( Y | x, C, S ) since C ̸⊥ Y | S, x in DGP-2. Thus, mouli's score doesn't incorrectly mark causal node C as spurious. Next for a spurious node S , we have Γ S ( X ) = [ x, C ] ; thus the mouli's score becomes:

̸

for all x, C, S we have P ( Y | x, C ) = P ( Y | x, C, S ) since S ⊥ Y | C, x . Thus the mouli's score correctly identifies the spurious node S .

Case 2 - DGP-3: For DGP-3, when the node N = A , we have X = [ x, A ] , Γ A ( X ) = [ x ] , and if is spurious i.e. there is no edge from A to Y in the actual graph then the mouli's score becomes:

̸

̸

for all x, A since A ̸⊥ Y | x = ⇒ P ( Y | x ) = P ( Y | x, A ) for atleast one setting of ( x, A, Y ) . Thus the mouli's score will be non-zero and will fail to identify A as a spurious node.

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 = { ca 1 , . . . , ca K , sp 1 , . . . , sp J } be the set of attribute given to us. The latent representation z is disentangled and is of form [ z ca 1 , . . . , z ca K , z sp 1 , . . . , z sp J ] , where z ca k ∈ R d k is the features corresponding to causal attribute ' ca k ' and z sp j ∈ R d j are the features corresponding to spurious attribute ' sp j ' . Here d k and d j are the dimensions of z ca k and z sp j respectively.

Now we are ready to formally state the main theorem and its proof that shows that it is sufficient to have the correct ranking of the causal effect of causal and spurious attributes to learn a classifier invariant to the spurious attributes using one instantiation of our regularization objective (3). Our proof goes in two steps:

First Claim : To prove that the desired classifier will be preferred by our 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 a regularization strength when the desired classifier has a 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 a 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 z = [ z ca 1 , . . . , z ca K , z sp 1 , . . . , z sp J ] (Assm D.1). Let the desired classifier c des ( z ) = ∑ K k =1 w des ca k · z ca k be the max-margin classifier among all linear classifiers that use only the causal features z ca k 's for prediction. Let c mm ( z ) = ∑ K k =1 w mm ca k · z ca k + ∑ J j =1 w mm sp j · z sp j be the max-margin classifier that uses both the causal and the spurious features, and let w mm sp j = 0 , ∀ j ∈ [ J ] . We assume w mm sp j = 0 , ∀ j ∈ [ J ] , without loss of generality because otherwise, we can restrict our attention only to those j ∈ [ J ] that have w mm sp j = 0 . Let the norm of the parameters of both the classifier be set to 1 i.e ∑ K k =1 ∥ w mm ca k ∥ 2 p =2 + ∑ J j =1 ∥ w mm sp j ∥ 2 p =2 = ∑ K k =1 ∥ w des ca k ∥ 2 p =2 = 1 . Then if regularization coefficients are related s.t. mean ( { λ ca k λ sp j · η k,j } k ∈ [ K ] ,j ∈ [ J ] ) < J K where η k,j = ∥ w des ca k ∥-∥ w mm ca k ∥ p ∥ w mm sp j ∥ p , then

Preference: L AutoACER ( c des ( z ) ) < L AutoACER ( c mm ( z ) ) . Thus, our causal effect regularization objective (Def 3) will choose the c des ( z ) classifier over the max-margin classifier c mm ( z ) which uses the spuriously correlated feature.

Global Optimum: The desired classifier c des ( z ) is the global optimum of our loss function L AutoACER when J = 1 , K = 1 , p = 2 , the regularization strength are related s.t. λ ca 1 < λ sp 1 = ⇒ | ˆ TE ca 1 | > | ˆ TE sp 1 | and search space of linear classifiers c ( z ) are restricted to have the norm of parameters equal to 1.

Proof. Proof of Part 1: Since we are training our task classifier using the max-margin objective (Eq. 11) thus over training objective becomes:

where ∥·∥ p is the L p norm. For ease of exposition, we will denote c ( h ( x )) as c ( z ) where z is the latent space representation of x given by z = h ( x ) . Next, we will show that there always exists a regularization strength R ≥ 0 s.t. L AutoACER ( c des ( z ) ) < L AutoACER ( c mm ( z ) ) given mean ( { λ ca k λ sp j · η k,j } k ∈ [ K ] ,j ∈ [ J ] ) < J K (from the main statement of Theorem 3.1). To have L AutoACER ( c des ( z ) ) < L AutoACER ( c mm ( z ) ) we need to select the regularization strength R ≥ 0 s.t:

The max-margin objective (see §A.2 for background) given is given by L mm ( c ( z ) , y ) = ( -1) · min i { y i c ( z i )) ∥ c ( z ) ∥ 2 } where z i is the latent space representation of the input x i with label y i and ∥ c ( z ) ∥ 2 is the L2-norm of the weight vector of the classifier c ( z ) . The norm of both the classifier c des ( z ) and c mm ( z ) is 1 (from the statement of this Theorem 3.1). Substituting the max-margin loss for both the classifier in Eq. 20 we get:

Rearranging the above equation we get:

If the LHS-term 1 in the above equation is greater than 0 , then we can always select a regularization strength R > 0 s.t. the above inequality is always satisfied, whenever

Next we will show that given mean ( { λ ca k λ sp j · η k,j } k ∈ [ K ] ,j ∈ [ J ] ) < J K , the LHS-term1 in Eq. 22 is always greater than 0. For LHS-term1 to be greater than 0 we need:

̸

Since λ ( · ) = 1 / | ˆ TE ( · ) | and | ˆ TE ( · ) | ∈ [0 , 1] we have λ ( · ) > 0 (see §3.3 for discussion). From the main statement of this theorem we have w mm sp j = 0 = ⇒ ∥ w mm sp j ∥ p > 0 for all value of ' p '. Next, we have the following two cases:

Case 1 ( ∑ K k =1 λ ca k [ ∥ w des ca k ∥ p -∥ w mm ca k ∥ p ] ≤ 0 ) : For this case the above Eq. 24 is trivially satisfied since ∑ J j =1 λ sp j ∥ w mm sp j ∥ p > 0 as ∀ j ∈ [ J ] , λ sp j > 0 and ∥ w mm sp j ∥ p > 0 .

Case 2 ( ∑ K k =1 λ ca k [ ∥ w des ca k ∥ p - ∥ w mm ca k ∥ p ] > 0 ) : Since for all j ∈ [ J ] we have λ sp j > 0 and ∥ w mm sp j ∥ p > 0 , rearranging we get:

The above equation is the harmonic mean of the LHS-term 3 and LHS-term 3 is > 0 for all values of j . We know that the harmonic mean is always less than or equal to the arithmetic mean for a set of positive numbers (Inequalities book by GH Hardy [34]). Thus the above inequality is satisfied if the following inequality is satisfied:

Since the above condition on regularization strength of features is satisfied (given in the main statement of this theorem), we have L AutoACER ( c des ( z ) ) < L AutoACER ( c mm ( z ) ) thus completing the proof.

λ ∥ w des ∥ p -∥ w mm ∥ p

The above Eq. 26 states that the mean of ( ca k λ sp j )( ca k ca k ∥ w mm sp j ∥ p ) should be less than J/K . Thus the above equation is also satisfied if individually all the terms considered when taking the mean are individually less than J/K . Thus, a stricter but more intuitive condition on λ 's s.t Eq. 26 is satisfied is given by:

where η k,j = ( ∥ w des ca k ∥ p -∥ w mm ca k ∥ p ∥ w mm sp j ∥ p ) .

Proof of Part 2: Given p = 2 and since K = 1 and J = 1 , the desired classifier takes form c des ( z ) = w des ca, 1 · z ca, 1 = w des ca · z ca . For ease of exposition, we will drop '1' from the subscript which denotes

̸

the feature number. Let c s ( z ) = w s ca · z ca + w s sp · z sp be any classifier which uses spurious feature z sp for its prediction s.t. w s sp = 0 . From statement 1 of this theorem, when the regularization strength are related such that λ ca · η < λ sp , we have L AutoACER ( c des ( z )) < L AutoACER ( c s ( z )) where η = ∥ w des ca ∥ 2 -∥ w s ca ∥ 2 ∥ w s sp ∥ 2 . Since the search space of the linear classifiers is constrained to have the norm of parameters equal to 1 we have ∥ w s ca ∥ 2 2 + ∥ w s sp ∥ 2 2 = 1 and ∥ w des ca ∥ 2 = 1 . Let ∥ w s ca ∥ = θ ∈ [0 , 1) , then we have ∥ w s sp ∥ = √ 1 -θ 2 . Substituting these values in η we get:

̸

̸

Thus η ( θ ) is a decreasing function for θ ∈ [0 , 1) and has its maximum value η max = 1 at θ = 0 . Thus, if the regularization strengths are related such that λ ca · η max < λ sp = ⇒ λ ca < λ sp we have L AutoACER ( c des ( z )) < L AutoACER ( c s ( z )) for all possible c s ( z ) . Since we are given that λ ca < λ sp in the second statement of the theorem c des ( z ) is preferred by our regularization objective among all possible c s ( z ) . Next, among the classifier c ψ ( z ) = c des ( z ) which only uses the causal feature for prediction, we have:

Since the desired classifier has maximum margin when using only causal feature for prediction (by definition), we have L mm ( c des ( z )) < L mm ( c ψ ( z )) for all other classifiers ( c ψ ( z ) ) which only uses the causal feature for prediction. Thus the desired classifier is the global optimum for our loss function L AutoACER when the classifiers are constrained to have parameters with a norm equal to 1 thereby completing the proof.

E Experimental Setup

E.1 Datasets

We perform extensive experiments on 6 datasets spanning synthetic, semi-synthetic, and real-world datasets. In §4 we give results for 3 such datasets - Syn-Text which is a synthetic dataset, MNIST34 which is a semi-synthetic dataset and Twitter-AAE which is a real-world dataset. In §F, we further evaluate our methods and other baselines on one additional real-world dataset (Civil-Comments) which has three different subsets. Below we give a detailed description of all the datasets.

Syn-Text Dataset. To create this Syn-Text dataset we first create a tabular dataset with three binary attributescausal, 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 = 1) = 0 . 5 and P ( confound = 0) = P ( confound = 1) =

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.e 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 two versions of this dataset (1) Syn-Text-Obs-Conf and (2) Syn-Text-Unobs-Conf. In the Syn-Text-Obs-Conf dataset, we keep all the attributes in the dataset but for Syn-Text-Obs-Conf to simulate the real-world setting where there is an unobserved confounding variable we 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 a fixed set of words (separate for each value of attribute) that we append together to form the final sentence (see Table 3 for the set of words corresponding to every attribute). The Syn-Text-Unobs-Conf dataset corresponds to the DGP-3 in the Fig. 2 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 1k 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-Text dataset is between the confound and spurious attribute given by κ = P ( spurious | confound ) . Our experiments require access to the counterfactual example x a ′ ∼ Q ( x a ) where the attribute A = a is changed to A = a ′ in the input. To generate this counterfactual example we flip the value of

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 a grayscale image (with digit attribute either 3 or 4 ). Then we add background color - red labeled as 1 or green labeled as 0 - to the image uniformly randomly i.e. P ( color | digit ) = 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 1 or 90 ◦ labelled as 0. We vary the correlation between the causal attributes (color and digit) and spurious attribute (rotation) by varying the CPD P ( rotation | color, 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 κ = P ( rotation | color, digit ) which is vary in all our experiments. The above data-generating process resembles DGP-2 in the Fig. 2 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 in 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 x a ′ ∼ Q ( x a ) where the attribute A = a is changed to A = a ′ in the input. To generate this counterfactual example we flip the value of the relevant attribute the attribute label and generate the counterfactual image.

Twitter-AAE Dataset. This is a real-world dataset where given a sentence the task is to predict the sentiment of the sentence. Following Elazar and Goldberg [9], 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 [9], Kumar et al. [19] and considering that changing the race of the person in the tweet should not affect the sentiment, we 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 (African-American English) and SAE (Standard American English) as a proxy for race. This data-generating process of this dataset resembles DGP-1 in Fig. 2 since the sentiment (task) labels are annotated using a deterministic function given the input tweet ([9]). The dataset 1 and code 2 to create the dataset are available online. We subsample 10k examples and use an 80-20 split for the train and test set. See §E.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 example x a ′ ∼ Q ( x a ) where the attribute A = a is changed to A = a ′ in the input. Since this is a real-world dataset where we don't have access to the data-generating process. Thus we take help from GPT3.5 (text-davinci-003 model) [5] to automatically generate the counterfactual tweet where the race attribute is changed. See Table 4 for a sample of generated counterfactual tweets.

Civil-Comments Datasets. To further evaluate our result on another real-world dataset we conduct use another dataset Civil-Comments 3 (WILDS dataset, [18]). Given a sentence, the task is to predict the toxicity of the sentence which is a continuous value in the original dataset. In our experiment,

we binarize this task to predict whether the sentence is toxic or not by labeling the sentence with toxicity score ≥ 0 . 5 as toxic or otherwise non-toxic. We use a subset of the original dataset (CivilCommentsIdentities) 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 on the task label since changing a person's race, gender, or religion in the sentence should not change the toxicity of the sentence. For each considered identity label, we create a corresponding different subset of the dataset named Civil-Comments (Race), Civil-Comments (Gender), and Civil-Comments (Religion). This data-generating process of this dataset also follows DGP-1 since toxicity (task) labels were generated from human annotators. 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 an 80-20 split to create a 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 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 a 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 5 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 ( κ ) 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 0 and 1 . Following Kumar et al. [19], 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 , a = 0) is defined as majority group S maj where the task labels y are correlated with the attribute. The remaining subset of the dataset where the correlation break is named S min 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 κ = Pr ( y = a ) i.e. the number of examples with the same task label and attribute. Following Kumar et al. [19], we can reformulate κ in terms of the size of the majority and minority groups:

For both Twitter-AAE and Civil-Comments dataset, we consider 6 different settings of κ from the set { 0 . 5 , 0 . 6 , 0 . 7 , 0 . 8 , 0 . 9 , 0 . 99 } by artificially varying the size of S maj and S min . To do so, we keep the size of S maj fixed, and then based on the desired value of κ we determine the number of samples to take in S min using the above equation. Thus for different values of κ the overall training dataset size ( | S maj | + | S min | ) changes in Twitter-AAE and Civil-Comments datasets. Thus it is important to only draw an independent conclusion from the different settings of κ 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.5 and E.6.

Syn-Text Dataset. Wetokenize the sentence into a 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 §E.4, E.5 and E.6).

MNIST34 Dataset. We directly take the image as input and normalize it by dividing it with a 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.

2D convolution layer, activation = relu, filter size = (3,3), channels = 32

2D max pooling layer, with filter size (2,2)

2D convolution layer, activation = relu, filter size = (3,3), channels = 64

2D max pooling layer, with filter size (2,2)

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-AAE and Civil-Comments Datasets. We use Hugging Face [36] transformer implementation 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 Direct (Eq. 5) and Riesz (Eq. 8) - to estimate the causal effect of a attribute on the task label Y (see §A.1 for details of the individual estimators).

Direct estimator in practice. For Direct estimator we use a neural network to estimate E [ Y | X,A ] . To get the causal effect we select the best model based either based on validation loss or validation accuracy in the prediction of the task label Y given ( X,A ) . We refer to these two versions of Direct estimators as Direct(loss) and Direct(acc) for the setting when validation loss and validation accuracy are used for selection respectively. To estimate E [ Y | X,A ] we use the following loss objective:

where g ( X,A ) is the neural network predicting the task label Y given input ( X,A ) , L2loss is the L2 regularization loss and R is the regularization strength hyperparameter. For Syn-Text dataset, we don't apply L2loss, for MNIST34 dataset we do a hyperparameter search over R ∈ { 0 . 0 , 0 . 1 , 1 . 0 , 10 . 0 , 100 . 0 , 200 . 0 , 1000 . 0 } , for Twitter-AAE we use R ∈ { 0 . 0 , 10 . 0 , 100 . 0 , 1000 . 0 } and Civil-Comments dataset we use R ∈ { 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 R 1 for RRloss to a fixed value 1 in all the experiments and search over the L2loss regularization hyperparameter ( R 2 ). For Syn-Text dataset, we don't use the L2loss at all, for MNIST34 dataset we search over R 2 ∈ { 0 . 0 , 0 . 1 , 1 . 0 , 10 . 0 , 100 . 0 , 200 . 0 , 1000 . 0 } , for Twitter-AAE dataset we use R 2 ∈ { 0 . 0 , 10 . 0 , 100 . 0 , 200 . 0 , 1000 . 0 } and for Civil-Comments dataset we use R 2 ∈ { 0 . 0 , 1 . 0 , 10 . 0 , 100 . 0 , 200 . 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,A ) for predicting 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 in Syn-Text 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. 1 and 2 to train the classifier using our method AutoACER. For each dataset, first, we encode the inputs to get a vector representation using the procedure described in §E.3. We use cross-entropy objectives to train the task prediction ( L task ). Next, we take the causal effect estimated from Stage 1 and map it to the closest value in set {-1 . 0 , -0 . 5 , -0 . 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 1 to the closest value in set {-1 . 0 , -0 . 7 , -0 . 5 , -0 . 3 , -0 . 1 , 0 . 0 , 0 . 1 , 0 . 3 , 0 . 5 , 0 . 7 , 1 . 0 } . The mapped causal effect is then used to regularize the model using the regularization term L Reg (see Eq. 1 and 2). Also, we search over the regularization strength R (Eq. 1) to select the best model. For all the datasets we choose the

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:

where 1 ( · ) is the indicator function that is equal to 1 if the argument is true and 0 otherwise, ' f ' is the model, x i is the input to the model and y i 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 §F.2 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.2 for the definition of the individual metrics):

E.6 Setup: Mouli+CAD and other related baselines

As mentioned in Mouli and Ribeiro [25], given a set of attributes ( A ), we train two models for each subset ( α ) of the attributes ( α ⊂ A ) (1) model trained to predict the task label Y while being invariant to the attributes in α , (2) a model trained to predict the random label while being invariant to the attributes in α . 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 to 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 AutoACER to impose instead of CAD by using a causal effect equal to 0 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 et al. [21] and train the model in two steps. First, we train a model with cross-entropy loss over all the examples (ERM). For Syn-Text-Unobs-Conf dataset, we tune the number epoch to train the model from set { 4 , 8 } using the model selection criteria defined later in step 2 of this method. For MNIST34 and Twitter-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 dataset that the ERM model predicted wrong in the first step by a factor of λ up . We tuned the hyperparameter λ up over the set { 2 , 4 , 8 } for Syn-Text-Unobs-Conf 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-Text-Unobs-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.

E.8 Setup: IRM baseline

We implement the IRMv1 to train the model using IRM objective as described in Arjovsky et al. [1]. We use the cross-entropy loss for estimating the prediction error ( R e in the IRMv1 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 { 1 e 15 , 5 e 15 } for Syn-Text-Unobs-Conf dataset, { 1 e 14 } for MNIST34 dataset and { 1 e 14 , 5 e 14 , 1 e 15 } 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 select the best model using the validation dataset as described in Eq. 33.

E.9 Computing Resources

We use an internal cluster of P40, P100, and V100 Nvidia GPUs to 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 metrics in our experiment of Stage 2 and other baselines and report the mean over 3 random runs for all the experiments in Stage 1 (Causal Effect Estimation).

F Additional Empirical Results

F.1 Extended Evaluation of Stage 1: 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 or accuracy (see §E.4 for details) on 6 different datasets.

Table 6 (Syn-Text-Obs-Conf), Table 7, 8 (Syn-Text-Unobs-Conf), Table 9(MNIST34) and Table 10 (Twitter-AAE and Civil-Comments) summarizes the performance of different causal effect estimator on these datasets. Different datasets bring different data-generating processes which bring different challenges for these estimators since the causal effect may or may not be identifiable (see individual tables for each dataset for discussion). We observe that one particular setting of the Riesz estimator i.e. Riesz(loss) performs consistently better or comparable to other estimators across the dataset. There are certain setting, especially at the high predictive correlation ( κ ) where even Riesz(loss) doesn't perform well and have a large error in the estimation of treatment effect. But we will show in §F.2 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 a 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 as spurious. Fig. 5a demonstrate on such failure in Syn-Text-Unobs-Conf dataset. When both the attribute- causal and spurious - is given to Mouli+CAD, it incorrectly identifies both the attributes as spurious for κ ≤ 0 . 7 (shown by the red curve having the lowest score).

For κ > 0 . 7 , again it incorrectly detects the true causal attribute as spurious. If we 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 a lower score than the subset with no attribute (blue curve) for all values of κ . But if we look at the causal effect estimate of causal attribute in Syn-Text-Unobs-Conf dataset it is close to the correct value 0.29 for all values of κ even though the identifiability of causal effect for this dataset is not guaranteed (see Table 8). Thus using a continuous measure of the spuriousness of a 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.

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

250

200

150

100

50

0

Attribute Score (Mouli+CAD)

()

causal

spurious

causal,spurious

(a) Syn-Text-Unobs-Conf

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

2500

2000

1500

1000

500

0

Attribute Score (Mouli+CAD)

()

color

rotation

color,rotation

(b) MNIST34

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

3500

3000

2500

2000

1500

1000

500

0

Attribute Score (Mouli+CAD)

()

race

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

1200

1000

800

600

400

200

0

Attribute Score (Mouli+CAD)

()

race

(d) Civil-Comments (Race)

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

1400

1200

1000

800

600

400

200

0

Attribute Score (Mouli+CAD)

()

gender

(e) Civil-Comments (Gender)

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

1200

1000

800

600

400

200

0

Attribute Score (Mouli+CAD)

()

religion

(f) Civil-Comments (Religion)

Spuriousness Score used by Mouli+CAD can be misleading. Given a 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 a 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. 6 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 ∆ Prob 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. As a result, we observe that the score for the spurious attribute (shown by the orange curve in the first row of Fig. 6f), is higher than blue. Thus enforcing the correct invariance Mouli+CAD 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 .

F.2 Extended Evaluation of Stage 2: AutoACER and other baselines assuming the Spurious attribute is known

In §4.4 and Fig. 4 we compared AutoACER with other baselines where we used overall accuracy as the selection criteria to select the best model (see Eq. 33). 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. 34 for details on how we select the best model with this information. Fig. 7 summarizes the result for AutoACER and other baseline with this selection criteria.

Other evaluation metrics for Syn-Text-Unobs-Conf, MNIST34 and Twitter-AAE 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-Unobs-Conf, MNIST34, and Twitter-AAE datasets in Fig. 8. Overall, AutoACER performs comparable or better than other baselines for Syn-Text-Unobs-Conf 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 ∆ Prob compared to other baselines signifying that the learned classifier is invariant to the spurious attribute.

Evaluation of AutoACER on Civil-Comments dataset. We evaluate our method on CivilComments 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), CivilComments (Gender), and Civil-Comments (Religion) where the attribute race , gender and religion are the spuriously correlated with task label (see §E.1 for details). Fig. 10 compares AutoACER with other baselines over a number of different metrics. Unlike Twitter-AAE dataset where Mouli+CAD gave significant gains in the average group accuracy, AutoACER performs comparably to Mouli+CAD and improves over ERM over this metric on all the subsets. Although, ∆ Prob is low for all the baseline methods, AutoACER again gives a classifier with much lower ∆ Prob, especially for high values of predictive correlation ( κ ). 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].

Counterfactual Data Augmentation is not sufficient for imposing correct invariance. Fig. 7 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. 7c) and Civil-Comments dataset (see Fig. 10), AutoACER has comparable or slightly lower average group accuracy than Mouli+CAD. But AutoACER has a significantly lower value of ∆ Prob 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 invariance w.r.t to spurious attribute. In Fig. 9 we combine Mouli+CAD and AutoACER to get the best out of both worlds (denoted as Mouli+AutoACER +CAD ). As expected we observed that the final classifier has a significant gain in the average group accuracy and has ∆ Prob 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 on error in detection of spurious attributes. AutoACER follows a 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 to 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 need a correct causal effect estimate to learn a classifier invariant to spurious correlation. For the case when we have two high dimensional variables - one causal and another spurious - as long as the ranking of the causal effect of causal and spurious attribute is correct AutoACER will learn a classifier completely invariant to spurious attribute. This result on a simpler classification task hinted that we don't need a completely correct

estimate of attribute to learn a more complicated invariant classifier trained on a real-world 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 in the causal effect ( > 0 . 5 ) on the metrics like average group accuracy and ∆ Prob for a large range of regularization strength (R). Even with a large error in the causal effect AutoACER trains a classifier with high average group accuracy and low ∆ Prob. Fig. 11, 12 and 13 summarizes the result for Syn-Text-Unobs-Conf, 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 16 for these datasets.

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

1500

1400

1300

1200

1100

1000

Attribute Score (Mouli+CAD)

()

rotation

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

0.150

0.175

0.200

0.225

0.250

0.275

0.300

0.325

Spurious Attribute

Prob

()

rotation

(a) MNIST34, Mouli+CAD

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

1200

1000

800

600

400

200

0

Attribute Score (Mouli+CAD)

()

race

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

0.02

0.04

0.06

0.08

0.10

Spurious Attribute

Prob

()

race

(b) Civil-Comments (Race),

Mouli+CAD

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

3000

2000

1000

0

Attribute Score (Mouli+CAD)

()

race

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

0.20

0.25

0.30

0.35

0.40

0.45

0.50

Spurious Attribute

Prob

()

race

(c) Twitter-AAE, Mouli+CAD

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

1600

1400

1200

1000

800

600

400

Attribute Score (Mouli+CAD)

()

rotation

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

0.00

0.05

0.10

0.15

0.20

0.25

0.30

Spurious Attribute

Prob

()

rotation

(d) MNIST34,

Mouli+AutoACER (R=100)

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

1500

1250

1000

750

500

250

0

Attribute Score (Mouli+CAD)

()

race

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

0.00

0.02

0.04

0.06

0.08

Spurious Attribute

Prob

()

race

(e) Civil-Comments (Race),

Mouli+AutoACER (R=1000)

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

3500

3000

2500

2000

1500

1000

500

0

Attribute Score (Mouli+CAD)

()

race

0.5

0.6

0.7

0.8

0.9

1.0

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

Spurious Attribute

Prob

()

race

(f) Twitter-AAE,

Mouli+AutoACER (R=100)

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

IRM

JTT

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

Spurious Topic

Prob

Mouli+

AutoACER

Mouli+CAD

ERM

AutoACER

IRM

JTT

(a) Syn-Text-Unobs-Conf

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

IRM

JTT

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

Spurious Topic

Prob

Mouli+

AutoACER

Mouli+CAD

ERM

AutoACER

IRM

JTT

(b) MNIST34

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

IRM

JTT

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

Spurious Topic

Prob

Mouli+

AutoACER

Mouli+CAD

ERM

AutoACER

IRM

JTT

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

Moul

i+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

Spurious Topic

Prob

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Majority Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Minority Group Accuracy)

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Worst Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

(a) Syn-Text-Unobs-Conf

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.00

0.05

0.10

0.15

0.20

0.25

Spurious Topic

Prob

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Majority Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Minority Group Accuracy)

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Worst Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

(b) MNIST34

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

Spurious Topic

Prob

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Majority Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Minority Group Accuracy)

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Worst Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

Mouli

i+

AutoACER

Mouli

+

AutoACER + CAD

Mouli+CAD(hardhalf)

Mouli+CAD(samplehalf)

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

Spurious Topic

Prob

Mouli+CAD(hardhalf)

Mouli+CAD(samplehalf)

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Worst Group Accuracy

Mouli+CAD(hardhalf)

Mouli+CAD(samplehalf)

Mouli+CAD

ERM

AutoACER

Mouli

i+

AutoACER

Mouli

+

AutoACER + CAD

AutoACER

Mouli

i+

AutoACER

Mouli

+

AutoACER + CAD

predictive correlation (

)

Prob

Spurious Topic

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.00

0.05

0.10

0.15

0.20

0.25

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Majority Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Minority Group Accuracy)

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Worst Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

(a) Civil-Comments (Race)

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.00

0.05

0.10

0.15

0.20

0.25

Spurious Topic

Prob

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Majority Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Minority Group Accuracy)

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Worst Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

(b) Civil-Comments (Gender)

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.00

0.05

0.10

0.15

0.20

0.25

Spurious Topic

Prob

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Majority Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Minority Group Accuracy)

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Worst Group Accuracy

AutoACER

Mouli+

AutoACER

Mouli+CAD

ERM

(c) Civil-Comments (Religion)

1.0

0.5

0.0

0.5

1.0

0.54

0.56

0.58

0.60

0.62

0.64

Average Group Accuracy

Predicitve Correlation(

)=0.5

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.00

0.01

0.02

0.03

0.04

0.05

0.06

0.07

Spurious Topic

Prob

Predicitve Correlation(

)=0.5

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.54

0.56

0.58

0.60

0.62

0.64

Worst Group Accuracy

Predicitve Correlation(

)=0.5

ERM

Mouli

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.500

0.525

0.550

0.575

0.600

0.625

0.650

0.675

Average Group Accuracy

Predicitve Correlation(

)=0.7

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.00

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

Spurious Topic

Prob

Predicitve Correlation(

)=0.7

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.48

0.50

0.52

0.54

0.56

0.58

0.60

0.62

Worst Group Accuracy

Predicitve Correlation(

)=0.7

ERM

Mouli

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.55

0.60

0.65

0.70

0.75

Average Group Accuracy

Predicitve Correlation(

)=0.9

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.00

0.05

0.10

0.15

0.20

Spurious Topic

Prob

Predicitve Correlation(

)=0.9

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.475

0.500

0.525

0.550

0.575

0.600

0.625

0.650

Worst Group Accuracy

Predicitve Correlation(

)=0.9

ERM

Mouli

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

Estimated Causal Effect

0.50

0.55

0.60

0.65

0.70

0.75

0.80

Average Group Accuracy

Predicitve Correlation(

)=0.99

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

Estimated Causal Effect

0.0

0.1

0.2

0.3

0.4

Spurious Topic

Prob

Predicitve Correlation(

)=0.99

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

Estimated Causal Effect

0.30

0.35

0.40

0.45

0.50

0.55

0.60

0.65

Worst Group Accuracy

Predicitve Correlation(

)=0.99

ERM

Mouli

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.45

0.50

0.55

0.60

0.65

0.70

0.75

Average Group Accuracy

Predicitve Correlation(

)=0.5

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.00

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

Spurious Topic

Prob

Predicitve Correlation(

)=0.5

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutOACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.3

0.4

0.5

0.6

0.7

Worst Group Accuracy

Predicitve Correlation(

)=0.5

ERM

Mouli

+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.50

0.55

0.60

0.65

0.70

Average Group Accuracy

Predicitve Correlation(

)=0.7

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.00

0.02

0.04

0.06

0.08

Spurious Topic

Prob

Predicitve Correlation(

)=0.7

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0.60

Worst Group Accuracy

Predicitve Correlation(

)=0.7

ERM

Mouli

+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.50

0.52

0.54

0.56

0.58

0.60

Average Group Accuracy

Predicitve Correlation(

)=0.9

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.00

0.02

0.04

0.06

0.08

0.10

0.12

Spurious Topic

Prob

Predicitve Correlation(

)=0.9

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.20

0.25

0.30

0.35

0.40

0.45

0.50

Worst Group Accuracy

Predicitve Correlation(

)=0.9

ERM

Mouli

+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

Estimated Causal Effect

0.490

0.495

0.500

0.505

0.510

0.515

0.520

Average Group Accuracy

Predicitve Correlation(

)=0.99

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

Estimated Causal Effect

0.00

0.05

0.10

0.15

0.20

Spurious Topic

Prob

Predicitve Correlation(

)=0.99

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

Estimated Causal Effect

0.0

0.1

0.2

0.3

0.4

0.5

Worst Group Accuracy

Predicitve Correlation(

)=0.99

ERM

Mouli

+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.5

0.6

0.7

0.8

Average Group Accuracy

Predicitve Correlation(

)=0.5

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

1.0

0.5

0.0

0.5

1.0

0.00

0.05

0.10

0.15

0.20

0.25

0.30

0.35

Spurious Topic

Prob

Predicitve Correlation(

)=0.5

1.0

0.5

0.0

0.5

1.0

0.4

0.5

0.6

0.7

0.8

Worst Group Accuracy

Predicitve Correlation(

)=0.5

1.0

0.5

0.0

0.5

1.0

0.5

0.6

0.7

0.8

0.9

1.0

Average Group Accuracy

Predicitve Correlation(

)=0.7

ERM

Mouli+CAD

AutoACER,R=1

AutoACER,R=10

AutoACER,R=100

AutoACER,R=1000

1.0

0.5

0.0

0.5

1.0

0.0

0.1

0.2

0.3

0.4

Spurious Topic

Prob

Predicitve Correlation(

)=0.7

1.0

0.5

0.0

0.5

1.0

0.3

0.4

0.5

0.6

0.9

Worst Group Accuracy

Predicitve Correlation(

)=0.7

1.0

0.5

0.0

0.5

1.0

0.5

0.6

0.7

0.8

0.9

Average Group Accuracy

Predicitve Correlation(

)=0.9

1.0

0.5

0.0

0.5

1.0

0.0

0.1

0.2

0.3

0.4

0.5

Spurious Topic

Prob

Predicitve Correlation(

)=0.9

1.0

0.5

0.0

0.5

1.0

0.4

0.5

0.6

0.7

0.8

0.9

Worst Group Accuracy

Predicitve Correlation(

)=0.9

1.0

0.5

0.0

0.5

1.0

Estimated Causal Effect

0.5

0.6

0.7

0.8

0.9

1.0

Average Group Accuracy

Predicitve Correlation(

)=0.99

1.0

0.5

0.0

0.5

1.0

Estimated Causal Effect

0.0

0.1

0.2

0.3

0.4

0.5

Spurious Topic

Prob

Predicitve Correlation(

)=0.99

1.0

0.5

0.0

0.5

1.0

Estimated Causal Effect

0.2

0.4

0.6

0.8

1.0

Worst Group Accuracy

Predicitve Correlation(

)=0.99

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

0.7

0.8

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

ERM

Mouli+CAD

AutoACER

,R=1

AutoACER

,R=10

AutoACER

,R=100

AutoACER

,R=1000

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

+DE(acc)

AutoACER

+DE(loss)

AutoACER

+Riesz(acc)

AutoACER

+Riesz(loss)

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

Spurious Topic

Prob

Mouli+CAD

ERM

AutoACER

+DE(acc)

AutoACER

+DE(loss)

AutoACER

+Riesz(acc)

AutoACER

+Riesz(loss)

Mouli+

AutoACER

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

+DE(acc)

AutoACER

+DE(loss)

AutoACER

+Riesz(acc)

AutoACER

+Riesz(loss)

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

Spurious Topic

Prob

Mouli+CAD

ERM

AutoACER

+DE(acc)

AutoACER

+DE(loss)

AutoACER

+Riesz(acc)

AutoACER

+Riesz(loss)

Mouli+

AutoACER

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.5

0.6

0.7

0.8

0.9

1.0

1.1

1.2

Average Group Accuracy

AutoACER

+DE(acc)

AutoACER

+DE(loss)

AutoACER

+Riesz(acc)

AutoACER

+Riesz(loss)

Mouli+

AutoACER

Mouli+CAD

ERM

0.5

0.6

0.7

0.8

0.9

0.99

predictive correlation (

)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

Spurious Topic

Prob

Mouli+CAD

ERM

AutoACER

+DE(acc)

AutoACER

+DE(loss)

AutoACER

+Riesz(acc)

AutoACER

+Riesz(loss)

Mouli+

AutoACER

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nIn 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.\n\nSTRENGTHS:\nThe 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).\n\nWEAKNESSES:\nMajor:\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\nQUESTIONS:\n1. 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\nLIMITATIONS:\nAs the authors have mentioned, one major limitation is that the theoretical guarantee of causal discovery works only under certain data generation procedures.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-02"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe 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.\n\nSTRENGTHS:\n- 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\nWEAKNESSES:\n- 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\nQUESTIONS:\n- 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\nLIMITATIONS:\nThe authors do not discuss the limitations of their approach in detail.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-04"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe 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.\n\nSTRENGTHS:\n1. 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\nWEAKNESSES:\n**[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.\n\nQUESTIONS:\nIn 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\nLIMITATIONS:\nThe paper has adequately addressed the limitations (Section 6). From my perspective, the paper does not have a potential negative societal impact.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2023-07-06"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe 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.\n\nSTRENGTHS:\n- 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.\n\nWEAKNESSES:\n1. 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\n\nQUESTIONS:\nPlease address the weaknesses above.\n\nLIMITATIONS:\nThe authors have adequately addressed the limitations.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-08"}