Abstract
Large Language Models (LLMs) excel at statistical word prediction, yet their ability to perform genuine logical reasoning remains a subject of intense debate. This study investigates the capacity of five prominent models—GPT-2, GPT-3, BERT, RoBERTa, and MPNet—to navigate counterfactual scenarios where premises contradict real-world facts (e.g., "If cats were vegetarians"). Through a series of three experiments using both hand-crafted and synthetic datasets, we evaluate whether models can override learned world knowledge, resist simple lexical associations, and infer real-world states from hypothetical discourse. Our findings reveal that while most models are heavily reliant on shallow lexical cues, GPT-3 demonstrates a superior, albeit imperfect, ability to maintain logical consistency across shifting contexts.
Introduction
The rapid advancement of LLMs has sparked a debate: do these models possess a functional "world model" or are they merely "stochastic parrots"? Counterfactual reasoning serves as a critical litmus test for this question. Unlike standard tasks, counterfactuals require a model to deliberately ignore its training data about reality to follow a hypothetical logic. For instance, if a model is told "If cats were vegetarians...", it must suppress the high-probability association between "cats" and "meat" to correctly predict "cabbage." This paper probes whether models are performing systematic logical reasoning or simply following shallow "lexical cues."
Methods
The researchers evaluated five pre-trained models: GPT-2, GPT-3 (text-davinci-003), BERT, RoBERTa, and MPNet. They used a probing approach, comparing the log-probabilities assigned to different word completions across three experimental conditions:
- Overriding World Knowledge: Can models pick a counterfactual completion (e.g., cabbages) over a real-world one (e.g., fish) when prompted by a hypothetical "If..." statement?
- Impact of Cue Words: Are models reasoning, or just seeing the word "vegetarian" and picking "cabbage"? This was tested using a "Counterfactual-to-Reality" condition (e.g., "If cats were vegetarians... In reality, they eat [fish/cabbages]").
- Inferring Real-World State: Can models understand the implication of a counterfactual? Saying "If the pets were vegetarians..." implies they are not currently vegetarians.
The study utilized two datasets: a small-scale psycholinguistic set (128 items) adapted from human experiments and a large-scale synthetic dataset (over 10,000 items) to ensure robustness across various subjects, objects, and tenses.
Key Results
- Experiment 1: In the counterfactual condition, GPT-3 preferred the logical (but counter-factual) completion 71.3% of the time in the large-scale dataset. Other models hovered closer to or below 60%, struggling to override their training data.
- Experiment 2: When the prompt switched back to reality ("In reality, families feed cats..."), GPT-3's preference for the counterfactual word dropped from 71.3% to 28%. In contrast, BERT's preference actually increased slightly, indicating it was ignoring the "In reality" logic entirely in favor of simple word association.
- Experiment 3: When using neutral subjects (e.g., "the pets") to force reliance on linguistic cues, most models failed. Only GPT-3 showed a substantial difference between counterfactual and real-world contexts.
Discussion and Insights
A counterintuitive finding was the "World Knowledge Paradox": models with stronger real-world knowledge were often better at overriding it. This suggests that a robust internal model of reality provides a clearer baseline for understanding when a scenario has shifted into the hypothetical.
However, the study also identified a pervasive "Lexical Trap." Most models (especially the BERT family and GPT-2) act as "lexical cue junkies." If the word "vegetarian" appears, they pick "cabbage" regardless of the sentence's logical structure. Even for GPT-3, the physical distance between a cue word and the target affected performance; the closer the cue, the more the model relied on simple association rather than logic.
Conclusion
While GPT-3 shows a glimmer of sophisticated logical reasoning and sensitivity to discourse markers, the majority of tested LLMs remain heavily dependent on statistical breadcrumbs. The gap between lexical association and true logical inference remains a significant hurdle for current AI architectures. Future work may explore whether "Chain of Thought" prompting or specific architectural refinements can help models escape these lexical traps and achieve more robust counterfactual reasoning.
Summary updated