Counterfactual reasoning: Do language models need world knowledge for causal understanding?

Jiaxuan Li, Lang Yu, Allyson EttingerarXiv 2022 · DOI

Abstract

This paper investigates whether Large Language Models (LLMs) truly understand counterfactual reasoning or simply rely on statistical word associations. While most models can override real-world facts in hypothetical scenarios, the study reveals that this "reasoning" is largely driven by shallow lexical cues—with GPT-3 being the only model showing a nascent, though imperfect, sensitivity to the logical nuances of counterfactual language.

Introduction

Pre-trained language models (PLMs) have become remarkably good at predicting text, but researchers still struggle to determine if this success stems from "systematic logical reasoning" or just "statistical correlation." Counterfactual conditionals (e.g., "If cats were vegetarians, they would eat carrots") provide a perfect stress test for this. To answer correctly, a model must recognize the hypothetical premise (cats = vegetarians), suppress real-world knowledge (cats = carnivores), and infer the logical consequence (eating carrots). This study aims to determine if models are performing genuine mental gymnastics or simply gravitating toward statistical lexical associations.

Methods and Datasets

The researchers tested five popular models: GPT-2, GPT-3, BERT, RoBERTa, and MPNet. They evaluated these models by comparing the log-probabilities assigned to "factual" vs. "counterfactual" completions across several controlled conditions:

  • Counterfactual-World (CW): "If cats had liked vegetables... families would feed them [carrots/fish]."
  • Real-World (RW): "Because cats like meat... families would feed them [carrots/fish]."
  • Baseline Bias (BB): "Families would feed their cats [carrots/fish]."
  • Counterfactual-to-Reality (CR): A "trap" condition where the context shifts back to reality: "If cats liked vegetables... In reality, families feed them [fish/carrots]."

The study utilized three datasets: a small-scale set of 128 hand-designed items, a large-scale synthetic dataset of over 10,000 items varying in syntax and modal verbs, and a world-knowledge-neutral dataset (e.g., using "the pet" instead of "cats") to isolate linguistic cue processing.

Key Results

The evaluation showed that models with stronger world knowledge were generally better at overriding those facts in counterfactual scenarios. GPT-3 stood out significantly in its ability to prefer counterfactual completions in the CW condition.

Model performance across Counterfactual-World (CW), Real-World (RW), and Baseline Bias (BB) conditions.

As shown in the results table, GPT-3 preferred the counterfactual completion in 71.3% of cases in the large-scale CW condition, a marked improvement over BERT (34.2%) and GPT-2 (53.7%).

Sensitivity to Logic and Lexical "Cheating"

A critical finding was the prevalence of "lexical cue following." In the CR "trap" condition, most models continued to pick the word associated with the counterfactual premise (e.g., "carrots" for "vegetables") even when the sentence explicitly pivoted back to reality ("In reality...").

Comparison of model performance in Counterfactual-World (CW) versus the Counterfactual-to-Reality (CR) trap condition.

GPT-3 was the only model to demonstrate a substantial drop in counterfactual preference—from 71.3% to 28.0%—when the context shifted back to reality. This suggests it processes linguistic markers like "if/had" versus "in reality" rather than relying solely on keyword matching. For other models, this drop was negligible, indicating a reliance on simple word associations.

Discussion

While GPT-3 shows a nascent ability to handle counterfactual logic, it is not a perfect reasoner. Its performance degrades when lexical cues are placed closer to the target word, suggesting that linear distance and superficial associations still interfere with logical processing. The authors conclude that while GPT-3's success is impressive, it may result from learning how specific linguistic markers mediate associations within its massive training data, rather than a deep causal model of the world. Future research is required to distinguish between sophisticated linguistic cue knowledge and true causal understanding.

Summary updated

BibTeX
@misc{li2022counterfactual,
  author = {Jiaxuan Li and Lang Yu and Allyson Ettinger},
  title = {{Counterfactual reasoning: Do language models need world knowledge for causal understanding?}},
  year = {2022},
  eprint = {2212.03278},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.03278},
}
Figure