How Language Models Compute Negation: A Mechanistic Study of Factual Negation
Abstract
Large language models (LLMs) often fail to handle negation, predicting the original object of a factual statement even when a negation cue gets inserted. We study how LLMs mechanistically compute factual negation through causal interventions and logit-space analyses on pairs of original and negated factual prompts. Our analysis on Gemma-3 and Qwen3 suggests that negation is not computed as a standalone late switch that flips the original object at the final prediction position. Instead, negation is first integrated into relation information and then propagated to the final position in middle-to-late layers. In later layers, this information shifts the model away from the original object, with a notable mechanism being reducing the model's attention to subject tokens. Together, these findings suggest that LLMs' negation handling is fragile not because they have limited access to negation signals, but more likely because negation must be integrated through multi-stage modifications within a factual recall pathway.