Explore Spurious Correlations at the Concept Level in Language Models for Text Classification

Yuhang Zhou, Paiheng Xu, Xiaoyu Liu, Bang An, Wei Ai, Furong Huang

Abstract

Language models (LMs) have achieved notable success in numerous NLP tasks, employing both fine-tuning and in-context learning (ICL) methods. While language models demonstrate exceptional performance, they face robustness challenges due to spurious correlations arising from imbalanced label distributions in training data or ICL exemplars. Previous research has primarily concentrated on word, phrase, and syntax features, neglecting the concept level, often due to the absence of concept labels and difficulty in identifying conceptual content in input texts. This paper introduces two main contributions. First, we employ ChatGPT to assign concept labels to texts, assessing concept bias in models during fine-tuning or ICL on test data. We find that LMs, when encountering spurious correlations between a concept and a label in training or prompts, resort to shortcuts for predictions. Second, we introduce a data rebalancing technique that incorporates ChatGPT-generated counterfactual data, thereby balancing label distribution and mitigating spurious correlations. Our method’s efficacy, surpassing traditional token removal approaches, is validated through extensive testing.

Introduction

Machine learning models are notorious for finding the "path of least resistance." If a significant majority of restaurant reviews in a training set that mention "food" happen to be positive, a model might learn a spurious correlation: If "food" is mentioned, the label is likely positive.

While previous research has focused on token-level (specific words like "salsa") or syntactic shortcuts, this paper investigates concept-level shortcuts. These are significantly harder to detect because a concept like "food" can be expressed through thousands of different tokens (e.g., "steak," "burrito," "menu"). Because most datasets lack explicit concept labels, researchers have historically lacked the tools to measure or mitigate this abstract form of bias.

Methodology

The authors propose a three-stage framework to address concept-level bias:

  1. Concept Annotation via LLM: Since standard datasets do not include concept labels, the authors utilize ChatGPT (GPT-3.5) to identify and label the presence of specific concepts (such as "service," "price," or "style") across thousands of sentences.
  2. Measuring Bias (Bias@C): A new metric, Bias@C, is introduced to quantify the discrepancy in a model's accuracy when a concept is present versus when it is absent. A high Bias@C indicates the model is relying on the concept as a shortcut rather than performing genuine semantic understanding.
  3. Mitigation via Counterfactual Upsampling: To rectify bias without losing valuable information through data deletion, the authors use ChatGPT to "inject" specific concepts into sentences while preserving their original sentiment. For instance, a negative review about a zoo might be modified to include a sentence about "bad food," creating a balanced training sample that decouples the concept from a specific label.

The Embedding Trap

Why do models learn concept-level shortcuts? The study demonstrates that tokens belonging to the same concept (e.g., "royal," "maroon," and "teal" for the concept "Color") cluster together in the model's embedding space. If the model identifies a correlation between one part of that cluster and a label, it easily generalizes that shortcut to the entire conceptual cluster.

Mapping of conceptual tokens to clusters in the embedding space, leading to label shortcuts.

This vulnerability extends beyond fine-tuning to In-Context Learning (ICL). Even in few-shot prompting, if the examples provided in the prompt are conceptually biased, the model will immediately adopt that shortcut for the test instance.

Experimental Results

The study evaluates five diverse text classification benchmarks, including Yelp, IMDB, Amazon Shoe (AS), CeBaB, and BoolQ. Validation using the CeBaB dataset showed that ChatGPT's concept annotations matched human labels with approximately 90% accuracy.

Distribution of concepts across labels in various datasets, highlighting the imbalances that lead to spurious correlations.

Key findings include:

  • Ubiquity of Bias: In the IMDB dataset, the concept "Music" exhibited a high Bias@C, indicating models were significantly more likely to predict a positive label simply because music was mentioned.
  • Superiority of Upsampling: On the Amazon Shoe dataset, the proposed upsampling method reduced the Bias@C for the "Size" concept from 2.11 to 1.20. This method maintained higher "robust accuracy" than traditional token-removal or downsampling techniques, which often degrade performance by reducing the total volume of training data.
  • Generalizability: These findings were consistent across different model architectures, including DistilBERT and Llama 2 (7B), suggesting that concept-level bias is a fundamental challenge for transformer-based LMs.

Conclusion and Future Work

While the proposed LLM-based annotation and counterfactual upsampling are highly effective, the authors acknowledge that using high-end LLMs for annotation can be costly for massive datasets. Furthermore, while balanced prompts in ICL help, they do not entirely eliminate the "inner" spurious correlations a model may have acquired during its original pre-training. Future research should explore how concept-level shortcuts affect more complex tasks like Natural Language Inference (NLI) or Vision-Language models.

Summary updated

BibTeX
@inproceedings{zhou2024explore,
  author = {Yuhang Zhou and Paiheng Xu and Xiaoyu Liu and Bang An and Wei Ai and Furong Huang},
  title = {{Explore Spurious Correlations at the Concept Level in Language Models for Text Classification}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=pKXzYVOG7Y},
}
Figure