SlowGuess/NeurIPS_2023_OCR huggingface dataset:
(f) Twitter-AAE, Mouli+AutoACER (R=100)
Figure 6: Counterfactual Data Augmentation doesn't impose complete invariance: The x-axis in every plot denotes the predictive correlation in the dataset, and the y-axis in the first row of every plot shows the score computed by the previous Mouli's method for a different subset of attributes. Different methods could be used to impose invariance w.r.t to a certain subset of attribute in the classifier and compute a score to quantify the spuriousness of the classifier. In (a), (b) and (c) counterfactual data augmentation (CAD) is used to impose invariance whereas in (d), (e) and (f) AutoACER is used to impose invariance. The empty subset “()” denotes that no attribute is considered spurious. Then the attribute with the lowest score is detected as spurious attribute. The y-axis in the second row of every plot measures the reliance of the classifier on spurious attributes on imposing invariance w.r.t to labeled attribute using  $\Delta$ Prob. The blue curve shows reliance on the spurious attribute when no invariance is imposed and the orange curve shows reliance on spurious attribute when we impose invariance w.r.t to spurious attribute. Sometimes CAD doesn’t impose correct invariance in the classifier which may create mistakes in detecting the spurious attribute. For Civil-Comments (Race) and Twitter-AAE dataset the second row of (b) and (c) respectively shows that CAD is not able to impose correct invariance with respect to the spurious attribute shown by high  $\Delta$ Prob of spurious attribute in the classifier which is supposed to be invariant to spurious attribute (orange curve). AutoACER to impose the required invariance (second row in (e) and (f)) shown by  $\Delta$ Prob close to 0 for the orange curve. After the correct invariance is imposed using AutoACER, Mouli’s score fails to determine the race attribute (which is actually spurious) as spurious for  $\kappa \leq 0.9$  shown by a blue curve having a lower score in the first row of (f). The relative ordering of score (first row) remains the same for MNIST34 and Civil-Comments (Race) after imposing invariance using either CAD (in (a),(b)) or AutoACER (in (d), (e)).
(c) Twitter-AAE
Figure 7: Average group accuracy (top row) and  $\Delta$  Prob (bottom row) for different methods when the spurious attribute is known. x-axis denotes predictive correlation  $(\kappa)$  in the dataset. We observe a similar trend as in Fig. 4 where none of the methods assumed that the spurious attribute is known. Compared to other baselines, (a) and (b) show that AutoACER performs better or comparable in average group accuracy and trains a classifier significantly less reliant to spurious attribute as measured by  $\Delta$  Prob. Mouli+CAD performs better in average group accuracy in (c) but relies heavily on spurious prop shown by high  $\Delta$  Prob whereas AutoACER performs equivalent to ERM on average group accuracy with lowest  $\Delta$  Prob among all. Refer to Eq. 34 for the model selection criteria used to select the best model and for further discussion see §F.2.
(c) Twitter-AAE
Figure 8: Additional evaluation metrics. We include three additional metrics used in the past work [30] to evaluate the generalization of a classifier to spurious correlation in addition to Average group accuracy and  $\Delta$ Prob as used in Fig. 7 — Majority group accuracy (third row), Minority Group Accuracy (fourth row), and Worst group accuracy (bottom row). x-axis denotes predictive correlation ( $\kappa$ ) in the dataset. Compared to other baselines, (a) and (b) show that AutoACER performs better in minority group accuracy, comparable or better in the worst group accuracy, and trains a classifier significantly less reliant on spurious attribute as measured by  $\Delta$ Prob. The majority group's accuracy is expected to increase as the predictive correlation ( $\kappa$ ) increases since the classifier could start using the spurious attribute for making predictions. In (a), the majority group accuracy remains almost similar even as the  $\kappa$  increases whereas it increases for other baselines. This shows that AutoACER trains a classifier that doesn't rely on spurious attribute even at high values of  $\kappa$ . Similarly, in (b), the majority group accuracy of a classifier trained by other baselines is higher than AutoACER at higher values of  $\kappa$  implying a higher reliance on spurious attribute. Mouli+CAD performs better in all group-wise accuracy in (c) but relies heavily on spurious prop shown by high  $\Delta$ Prob whereas AutoACER performs equivalent to ERM on all group-wise accuracy with lowest  $\Delta$ Prob among all. See §F.2 for further discussions and refer to Eq. 34 for the model selection criteria used to select the best model.
Figure 9: Combining AutoACER and Mouli+CAD gives good trade-off in Accuracy and  $\Delta$  Prob: The x-axis denotes predictive correlation ( $\kappa$ ) in the dataset and the y-axis shows different evaluation metrics. Mouli+CAD performs better in average group accuracy whereas AutoACER performs better in  $\Delta$  Prob (see §F.2 and Fig. 7 for more discussion). Thus counterfactual data augmentation (CAD) might not be the best method to impose invariance with respect to a spurious attribute. Thus we augment Mouli+CAD with AutoACER (denoted as Mouli+AutoACER +CAD and shown by the green bar) to get the best out of both worlds. Mouli+AutoACER +CAD show similar increase in average group accuracy as Mouli+CAD and at the same time have lower  $\Delta$  Prob than Mouli+CAD and ERM. We experiment with two different settings where we halve the number of samples used to train the task classifier to test whether this gain in average group accuracy is due to increased sample size and thus the number of gradient updates when we perform CAD. Mouli+CAD (hardhalf) shows the setting when we reduce the initial dataset before augmentation to half and thus the effective dataset size and thus the number of gradient updates becomes the same after augmentation as used in other baselines. In this setting, we observe that the average group accuracy becomes equal to other baselines where we don't perform CAD. In the second setting, Mouli+CAD (samplehalf), we randomly subsample half of the counterfactually augmented dataset in every training iteration. Thus the effective number of gradient updates is the same as other baselines. In this setting, we observe similar behavior as Mouli+CAD in both average group accuracy and  $\Delta$  Prob metrics. These two experiments thus suggest that the number of gradient updates (better training) is not the main reason behind the gain of the average group accuracy when using counterfactual data augmentation. We leave the question for future work of understanding the mechanism behind how CAD is able to perform better on average group accuracy without completely imposing invariance with respect to spurious attributes. See §F.2 for further discussions and refer to Eq. 34 for the model selection criteria used to select the best model.
(a) Civil-Comments (Race)
(b) Civil-Comments (Gender)
(c) Civil-Comments (Religion)
Figure 10: AutoACER and other baselines on Civil-Comments datasets: Different columns show the results on different subsets of Civil-Comments dataset i.e. race, gender and religion (see E.1 for details dataset). Different rows show different evaluation metrics we consider to evaluate the performance. The x-axis denotes predictive correlation  $(\kappa)$  in the dataset. Unlike Twitter-AAE dataset (Fig. 8c and 7 where there was a significant gain in average group accuracy when using the Mouli+CAD, AutoACER performs comparably to Mouli+CAD on all the subsets of Civil-Comments datasets. Even though the  $\Delta$  Prob metric is already small for all the methods  $(\leq 0.10)$ , AutoACER further reduces it close to 0. On all the individual group accuracy metrics AutoACER performs better than ERM and is comparable to other baselines. See §F.2 for more discussions and refer to Eq. 34 for the model selection criteria used to select the best model.
Figure 11: Robustness of AutoACER w.r.t estimated causal effect on Syn-Text-Unobs-Conf: Given a attribute, in Stage 1 our method AutoACER estimates the causal effect of attribute on the task label as a continuous measure of spuriousness of the attribute. Then in Stage 2, it regularizes the classifier proportional to the estimated causal effect. Since our model relies heavily on the estimate of the causal effect of the attribute it is important to analyze the robustness of AutoACER with noise in the estimation step. In this figure, we show the sensitivity of AutoACER with varying levels of noise in the causal effect estimate of the spurious attribute. The true causal effect of spurious attribute is 0 and the x-axis shows the value of the causal effect used in Stage 2. The different row shows the result for different levels of predictive correlation  $(\kappa)$ . Different columns show different evaluation metrics — average group accuracy,  $\Delta$ Prob, and worst group accuracy. Different colored lines show different baselines or different regularization strengths  $(R)$  used by AutoACER. The dotted vertical black line in every plot shows the estimated causal effect using the Direct or Riesz estimator in Stage 1. We observe that AutoACER is less sensitive to the error in the estimated causal effect of spurious attribute. For example, for  $\kappa = 0.99$  (last row), the green curve (AutoACER with  $R = 10$ ) is almost constant for all values of causal effect used in Stage 2 for spurious attribute, has better average and worst group accuracy than ERM and Mouli+CAD and has a very low value of  $\Delta$ Prob. Even when we regularize the classifier to have a causal effect of 1 in Stage 2, the  $\Delta$ Prob remain close to zero demonstrating some form of self-correction. Theorem 3.1 hints a possible reason for this robustness — our method will always select the correct classifier (less reliant on spurious attribute) as long as the ranking of the causal effect of spurious and causal attribute is consistent up to some constant factor. See §F.2 for detailed discussion, Fig. 12 and 13 for similar analysis on MNIST34 and Twitter-AAE dataset respectively and refer to Eq. 34 for the model selection criteria used to select the best model.
Figure 12: Robustness of AutoACER w.r.t estimated causal effect on MNIST34: In this figure, we show the sensitivity of AutoACER with varying levels of noise in the causal effect estimate of the spurious attribute. The true causal effect of spurious attribute (rotation) is 0 and the x-axis shows the value of the causal effect for this attribute used for regularization in Stage 2. The different row shows the result for different levels of predictive correlation  $(\kappa)$ . Different columns show different evaluation metrics — average group accuracy,  $\Delta$ Prob, and worst group accuracy. Different colored lines in every plot show different baselines or different regularization strengths  $(R)$  used by AutoACER. The dotted vertical black line shows the estimated causal effect using the Direct or Riesz estimator in Stage 1. Similar to Fig. 11 we observe that AutoACER is robust to error in the estimated causal effect of the spurious attribute. For example, when  $\kappa = 0.99$ , for all the settings of AutoACER (with different regularization strength  $R$ ), the average group accuracy is almost constant and better than the ERM and Mouli+CAD for all values of causal effect used for the spurious attribute. Similarly, the  $\Delta$ Prob is constant and lower than ERM and Mouli+CAD for all values of the estimated causal effect. For discussion on possible explanation see Fig. 11 and §F.2, and refer to Eq. 34 for the model selection criteria used to select the best model.
Figure 13: Robustness of AutoACER w.r.t estimated causal effect on Twitter-AAE: In this figure, we show the sensitivity of AutoACER with varying levels of noise in the causal effect estimate of the spurious attribute. The expected true causal effect of spurious attribute (race) is 0 and the  $x$ -axis shows the value of the causal effect for this attribute used for regularization in Stage 2. The different row shows the result for different levels of predictive correlation ( $\kappa$ ). Different columns show different evaluation metrics — average group accuracy,  $\Delta \mathrm{Prob}$ , and worst group accuracy. Different colored lines in every plot show different baselines or different regularization strengths ( $R$ ) used by AutoACER. The dotted vertical black line shows the estimated causal effect using the Direct or Riesz estimator in Stage 1. Similar to Fig. 11 and 12, we observe that AutoACER is not sensitive to noise in the estimated causal effect of the spurious attribute. The average group accuracy and worst group accuracy remain almost constant with increasing noise in the estimate, though they are lower as compared to Mouli+CAD. But AutoACER is less sensitive to noise in estimated effect and is significantly lower than ERM and Mouli+CAD for all values of  $\kappa$  in  $\Delta \mathrm{Prob}$  metric. For further discussions see Fig. 11, 12 and §F.2, and refer to Eq. 34 for the model selection criteria used to select the best model.
Figure 14: Performance of AutoACER using different causal effect estimators for Syn-Text-Unobs-Conf: AutoACER uses causal effect estimator to determine the spuriousness of a given attribute in Stage 1 and then regularize the classifier proportional to the estimated effect in Stage 2. In this work, we consider two different estimators — Direct and Riesz — each with two ways of selecting the best estimate (using validation loss or accuracy, see §E.4 for details). In Fig. 7a, we select the causal effect estimator that performs best in Stage 2. Thus it is not clear from Fig. 7a if any particular estimator is more suitable to estimate the causal effect in a particular dataset. In this figure, we show the performance of AutoACER using all the different estimators separately. DE( $\cdot$ ) is the Direct estimator and Riesz( $\cdot$ ) is the Riesz estimator with their two different settings. The x-axis shows the predictive correlation ( $\kappa$ ) in the dataset and the y-axis shows average group accuracy and  $\Delta$ Prob in the top and bottom rows respectively. We observe that AutoACER performs equivalently when using any of the available estimators on both metrics. Compared to other baselines using any of the estimator AutoACER performs better in both average group accuracy and  $\Delta$ Prob. This demonstrates the robustness of the method in choosing different causal effect estimators and noise in the estimated causal effect for training a classifier that generalizes to spurious attributes. For more discussion see §F.2 and Fig. 15 and 16 for results on MNIST34 and Twitter-AAE dataset respectively. Refer to Eq. 34 for the model selection criteria used to select the best model.
Figure 15: Performance of AutoACER using different causal effect estimators for MNIST34: In this work, we have considered four different causal effect estimators to determine the spuriousness of a given attribute (see §E.4). Fig. 7b aggregates the performance of AutoACER by selecting the estimator that gives best performance. Thus we expand the results in Fig. 7b to demonstrate the performance of AutoACER when using the causal effect estimate from different estimators individually. DE( $\cdot$ ) is the Direct estimator and Riesz( $\cdot$ ) is the Riesz estimator with their two different settings. The x-axis shows the predictive correlation ( $\kappa$ ) in the dataset and the y-axis shows average group accuracy and  $\Delta$ Prob in the top and bottom rows respectively. We observe that AutoACER performs equivalently when using any of the available estimators on both metrics. Compared to other baselines using any of the estimator AutoACER performs better in both average group accuracy and  $\Delta$ Prob. This demonstrates the robustness of the method in choosing different causal effect estimators and noise in the estimated causal effect for training a classifier that generalizes to spurious attributes. For more discussion see §F.2 and Fig. 14 and 16 for results on Syn-Text-Unobs-Conf and Twitter-AAE dataset respectively. Refer to Eq. 34 for the model selection criteria used to select the best model.
Figure 16: Performance of AutoACER using different causal effect estimators for Twitter-AAE: In this work, we have considered four different causal effect estimators to determine the spuriousness of a given attribute (see §E.4). Fig. 7c aggregates the performance of AutoACER by selecting the estimator that gives best performance. Thus we expand the results in Fig. 7c to demonstrate the performance of AutoACER when using the causal effect estimate from different estimators individually. DE(·) is the Direct estimator and Riesz(·) is the Riesz estimator with their two different settings. The x-axis shows the predictive correlation (κ) in the dataset and the y-axis shows average group accuracy and ΔProb in the top and bottom rows respectively. Similar to the trend in Fig. 14 and 15, AutoACER performs equivalently when using different causal effect estimators. For more discussions see §F.2 and refer to Eq. 34 for the model selection criteria used to select the best model.