Attention Satisfies: A Constraint-Satisfaction Lens on Factual Errors of Language Models

Mert Yuksekgonul, Varun Chandrasekaran, Erik Jones, Suriya Gunasekar, Ranjita Naik +3 more
2/12/2026

No official code found. Best implementation: microsoft/mechanistic-error-probe (50 stars, last commit 2024-07-06).

Abstract

We investigate the internal behavior of Transformer-based Large Language Models (LLMs) when they generate factually incorrect text. We propose modeling factual queries as constraint satisfaction problems and use this framework to investigate how the LLM interacts internally with factual constraints. We find a strong positive relationship between the LLM's attention to constraint tokens and the factual accuracy of generations. We curate a suite of 10 datasets containing over 40,000 prompts to study the task of predicting factual errors with the Llama-2 family across all scales (7B, 13B, 70B). We propose SAT Probe, a method probing attention patterns, that can predict factual errors and fine-grained constraint satisfaction, and allow early error identification. The approach and findings take another step towards using the mechanistic understanding of LLMs to enhance their reliability.

View on arXivView PDF

Code Implementations(1)

A mechanistic approach for understanding and detecting factual errors of large language models.

503Python, Jupyter NotebookSep 26, 20232 years agoNOASSERTION

Similar Papers

Cite this paper

@article{yuksekgonul2026attention,
  title  = {Attention Satisfies: A Constraint-Satisfaction Lens on Factual Errors of Language Models},
  author = {Mert Yuksekgonul and Varun Chandrasekaran and Erik Jones and Suriya Gunasekar and Ranjita Naik and Hamid Palangi and Ece Kamar and Besmira Nushi},
  year   = {2026},
  eprint = {2309.15098},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2309.15098},
  journal = {ICLR 2023 2023}
}

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/2309.15098.svg)](https://codeofpaper.com/paper/2309.15098)

Discussion