Negation remains a persistent challenge for modern language models, often causing reversed meanings or factual errors. In this work, we conduct a causal analysis of how GPT-2 Small internally processes such linguistic transformations. We examine its hidden representations at both the layer and head level. Our analysis is based on a self-curated 12,000-pair dataset of matched affirmative and negated sentences, covering multiple linguistic templates and forms of negation. To quantify this behavior, we define a metric, the Negation Effect Score (NES), which measures the model's sensitivity in distinguishing between affirmative statements and their negations. We carried out two key interventions to probe causal structure. In activation patching, internal activations from affirmative sentences were inserted into their negated counterparts to see how meaning shifted. In ablation, specific attention heads were temporarily disabled to observe how logical polarity changed. Together, these steps revealed how negation signals move and evolve through GPT-2's layers. Our findings indicate that this capability is not widespread; instead, it is highly concentrated within a limited number of mid-layer attention heads, primarily within layers 4 to 6. Ablating these specific components directly disrupts the model's negation sensitivity: on our in-domain, ablation increased NES (indicating weaker negation sensitivity), and re-introducing cached affirmative activations (rescue) increased NES further, confirming that these heads carry affirmative signal rather than restoring baseline behavior. On xNot360, ablation slightly decreased NES and rescue restored performance above baseline. This pattern demonstrates that these causal patterns are consistent across various negation forms and remain detectable on the external xNot360 benchmark, though with smaller magnitude.
Figures & tables
Fig. 1: End-to-end methodology showing the pipeline from behavioral scoring to causal validation. Starting from aligned affirmative and negated prefixes, the process computes the Negation Effect Score (NES), performs activation patching at layer and head levels, ranks top- k influential heads, and conducts ablation–rescue and generalization analyses to identify and verify the negation circuit.
Template
Mean NES
Median NES
Failure (%)
capital_of
2.04
1.93
100.0
can_ability
0.96
0.33
60.28
likes
3.76
3.75
100.0
is_a_job
1.30
0.94
83.74
color_is
0.99
1.02
86.28
has_object
0.08
0.01
50.76
TABLE I: Summary of Negation Effect Scores across eight linguistic templates. Failure rate denotes the percentage of examples with NES>0 .
Fig. 2: Localization of negation representation within GPT-2 Small. (a) Layer-wise activation patching identifies strongest causal shifts in mid-layer (4–5). (b) Head-level analysis highlights a compact set of attention heads, most notably L5H11 and L4H4, as principal carriers of polarity information.
Fig. 3: Causal verification through ablation and rescue. (a) Removing top heads increases NES (indicating weaker negation sensitivity), confirming their causal importance. (b) Restoring those heads via activation patching increases NES further relative to the ablated state in-domain — confirming sufficiency under affirmative re-injection — while on xNot360, rescue restores toward baseline.
Fig. 4: Cross-form and external validation of the identified negation circuit. (a) Positive ΔNES (ablated - baseline) across all morphological variants indicates that removing the key heads increases NES (affirmative drift; weaker negation sensitivity). (b) External validation on the xNot360 dataset ( k=8 ). Ablating the discovered heads slightly decreases mean NES, while rescue restores it above baseline, revealing a smaller but consistent effect size on natural text. The y –axis in (b) is zoomed to make these differences visible.
We study how Large Language Models (LLMs) process negation mechanistically. First, we establish that even though open-weight models often provide wrong answers to questions involving negation, they do possess internal components that process negation correctly. Their poor accuracy is due to late-layer attention behavior that promotes simple shortcuts; ablating those attention modules greatly improves accuracy on negation-related questions. Second, we uncover how models process negation. We consider two hypotheses: models could use attention heads that attend to the phrase being negated and suppress related concepts, or they could directly construct a representation of the entire negative phrase (e.g., representing "not gas" as a vector that promotes liquids and solids). We apply a range of observational and causal interpretability techniques on Mistral-7B and Llama-3.1-8B to show that models implement both mechanisms, with the "constructive" mechanism being more prominent. Combined, our work deepens the understanding of LLMs' internals, highlighting construction-dominant computations and the coexistence of competing mechanisms within LLMs.
Zhejian Zhou, Tianyi Zhou, Robin Jia +1
Information Sciences Institute, University of Southern California · Thomas Lord Department of Computer Science, University of Southern California
Negation is an essential feature of human language, yet large language models (LLMs) remain unreliable in processing it. We evaluate recent open-source and closed-source LLMs on our negation benchmark and find that, in 37-71% of cases, they repeat the same answer under negation (e.g., "Madrid" for "What is not the capital of Spain?"). To understand and address this brittleness, we mechanistically examine how models operate under negation. Our main finding is that specialized attention heads and MLP neurons jointly implement negation by (1) suppressing retrieval of the original answer (e.g., "Madrid") while (2) promoting a favored candidate within the answer category (e.g., "Paris"). This contrasts with accounts of human negation processing, in which information about the original answer helps to determine what should be excluded. Furthermore, we find that this difference from human processing is a key source of negation failures: the model's mechanism relies on suppressing the original answer rather than using it to determine what to exclude, so the model can repeat the original answer when suppression is too weak or when a bias toward particular answers prevents it from selecting an alternative. To address this weakness in the model's negation mechanism, we propose a training objective that requires larger shifts in answer preference for more confident original predictions, and show that it reduces negation failures with less degradation of general capabilities than standard fine-tuning baselines. Together, our results demonstrate how mechanistic analysis can reveal why a linguistic capability fails and guide training that targets the underlying limitation.
Jongwook Yoon, Jongwon Lim, Sungjib Lim +2
Graduate School of Data Science, Seoul National University · Department of Computer Science and Engineering, Seoul National University
Negation remains a longstanding challenge for both language models (LMs) and large language models (LLMs). Prior work mainly focuses on a small set of high-frequency single-word negation cues, such as not and never, with limited exploration of broader negation types and modern LLMs. To address this gap, we construct NegCue, a large-scale dataset containing over 1.8M samples spanning single-word, multi-word, and affixal negation with more than 200 unique cues. We further pre-train both encoder-only LMs and LLMs on NegCue to investigate how different negation types affect negation understanding. Experiments on five downstream benchmarks show that negation types contribute unevenly to performance gains under the same training scale. In particular, affixal negation yields the largest improvements, while the gains from the commonly studied single-word negation remain modest. Moreover, our results demonstrate that further pre-training improves negation understanding for both LMs and LLMs.
Tian Tan, Eduardo Blanco
Department of Computer Science, University of Arizona