How Language Models Process Negation

Zhejian Zhou, Tianyi Zhou, Robin Jia, Jonathan May
5/4/2026
cs.CL
transformer-attention

No confident code implementation found for this paper.

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhou2026language,
  title  = {How Language Models Process Negation},
  author = {Zhejian Zhou and Tianyi Zhou and Robin Jia and Jonathan May},
  year   = {2026},
  eprint = {2605.03052},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.03052v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.03052.svg)](https://codeofpaper.com/paper/2605.03052)

Discussion