Skip to main content
QUICK REVIEW

[Paper Review] Robustness to Spurious Correlations in Text Classification via Automatically Generated Counterfactuals

Zhao Wang, Aron Culotta|arXiv (Cornell University)|Dec 18, 2020
Text and Document Classification TechnologiesComputer Science31 references12 citations
TL;DR

This paper proposes a method to improve text classifier robustness by automatically generating counterfactual training samples using causal feature identification and antonym substitution. By augmenting training data with these counterfactuals—where causal features are replaced with antonyms and labels flipped—the resulting classifier achieves 12%–25% higher accuracy on human-generated counterfactual test sets while maintaining performance on original data, demonstrating improved generalization by emphasizing causal features and de-emphasizing spurious correlations.

ABSTRACT

Spurious correlations threaten the validity of statistical classifiers. While model accuracy may appear high when the test data is from the same distribution as the training data, it can quickly degrade when the test distribution changes. For example, it has been shown that classifiers perform poorly when humans make minor modifications to change the label of an example. One solution to increase model reliability and generalizability is to identify causal associations between features and classes. In this paper, we propose to train a robust text classifier by augmenting the training data with automatically generated counterfactual data. We first identify likely causal features using a statistical matching approach. Next, we generate counterfactual samples for the original training data by substituting causal features with their antonyms and then assigning opposite labels to the counterfactual samples. Finally, we combine the original data and counterfactual data to train a robust classifier. Experiments on two classification tasks show that a traditional classifier trained on the original data does very poorly on human-generated counterfactual samples (e.g., 10%-37% drop in accuracy). However, the classifier trained on the combined data is more robust and performs well on both the original test data and the counterfactual test data (e.g., 12%-25% increase in accuracy compared with the traditional classifier). Detailed analysis shows that the robust classifier makes meaningful and trustworthy predictions by emphasizing causal features and de-emphasizing non-causal features.

Motivation & Objective

  • To address the problem of spurious correlations in text classification that degrade model performance under distribution shift or minor input perturbations.
  • To reduce reliance on costly human-annotated counterfactuals by automatically generating high-quality counterfactual training samples.
  • To improve model robustness by emphasizing causal features and de-emphasizing non-causal features through data augmentation.
  • To evaluate whether a small set of human-provided causal features can yield robustness comparable to large-scale human-annotated counterfactuals.

Proposed method

  • Identify likely causal features using a statistical closest opposite matching approach to find antonyms for key terms.
  • Generate counterfactual samples by substituting causal features with their antonyms and assigning the opposite label to the new sample.
  • Combine original training data with automatically generated counterfactual data to train a robust classifier.
  • Use logistic regression with L2 regularization to train the final classifier on the combined dataset.
  • Perform coefficient analysis to compare feature importance changes between original and robust classifiers.
  • Conduct ablation studies using limited human-provided causal features to evaluate scalability and performance trade-offs.

Experimental results

Research questions

  • RQ1Can automatically generated counterfactuals improve model robustness on distribution-shifted and adversarial test data?
  • RQ2How does the robust classifier’s performance compare to a baseline classifier on both original and counterfactual test sets?
  • RQ3To what extent can a small number of human-provided causal features achieve robustness comparable to large-scale human-annotated counterfactuals?
  • RQ4How do coefficient changes for causal versus non-causal terms contribute to improved generalization?
  • RQ5Does document length influence the relative impact of increasing causal term weights versus decreasing non-causal term weights?

Key findings

  • The baseline classifier trained on original data alone suffered a 10%–37% drop in accuracy on human-generated counterfactual test sets, indicating high sensitivity to spurious correlations.
  • The robust classifier trained on combined original and automatically generated counterfactual data achieved a 12%–25% absolute accuracy improvement over the baseline on counterfactual test sets.
  • The robust classifier learned to emphasize causal terms (e.g., 'awesome', 'awful') and de-emphasize non-causal terms (e.g., 'free', 'movie') by adjusting feature coefficients, leading to more trustworthy predictions.
  • Using only 50 human-provided causal features, the model achieved performance comparable to a model trained on 1,700 human-generated counterfactual samples from prior work.
  • For IMDB-L, increasing coefficients of causal terms had a greater impact on correction than decreasing non-causal terms, while the reverse was true for smaller datasets, suggesting document length affects the relative importance of coefficient adjustments.
  • Error analysis confirmed that the robust classifier corrected misclassifications by increasing the weight of causal terms and reducing the influence of non-causal terms, especially in cases where spurious features misled the original model.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.