mlsanityData to 14 Oct 2026

Quantifying Logical Consistency in Transformers via Query-Key Alignment

arXiv 2502.17017 ↗First posted 24 Feb 2025cs.CL cs.AI cs.ITcited by 0

On the map: LLM reasoning → Reasoning benchmarks and evaluation

Abstract (arXiv)

Large language models (LLMs) have demonstrated impressive performance in various natural language processing tasks, yet their ability to perform multi-step logical reasoning remains an open challenge. Although Chain-of-Thought prompting has improved logical reasoning by enabling models to generate intermediate steps, it lacks mechanisms to assess the coherence of these logical transitions. In this paper, we propose a novel, lightweight evaluation strategy for logical reasoning that uses query-key alignments inside transformer attention heads. By computing a single forward pass and extracting a "QK-score" from carefully chosen heads, our method reveals latent representations that reliably separate valid from invalid inferences, offering a scalable alternative to traditional ablation-based techniques. We also provide an empirical validation on multiple logical reasoning benchmarks, demonstrating improved robustness of our evaluation method against distractors and increased reasoning depth. The experiments were conducted on a diverse set of models, ranging from 1.5B to 70B parameters.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Reasoning benchmarks and evaluation, one of 17 directions in LLM reasoning. Builds on 11 of its 23 references that are in the map. First posted on arXiv 24 Feb 2025.

Builds on

11 of 23 references.

Closest ancestors · 4

Same direction, newest first

  1. 2024Enhancing Reasoning Capabilities of LLMs via Principled Synthetic Logic Corpus19 Nov
  2. 2023Testing the General Deductive Reasoning Capacity of Large Language Models Using OOD Examples24 May
  3. 2022Language Models Are Greedy Reasoners: A Systematic Formal Analysis of Chain-of-Thought3 Oct
  4. 2022Multi-Step Deductive Reasoning Over Natural Language: An Empirical Study on Out-of-Distribution Generalisation28 Jul

Other references · 7

  1. 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
  2. 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,165
  3. 2023Towards Best Practices of Activation Patching in Language Models: Metrics and Methodscited by 359
  4. 2024Do Large Language Models Latently Perform Multi-Hop Reasoning?cited by 169
  5. 2023Does Circuit Analysis Interpretability Scale? Evidence from Multiple Choice Capabilities in Chinchillacited by 149
  6. 2024Knowledge Circuits in Pretrained Transformerscited by 60
  7. 2024Correcting Negative Bias in Large Language Models through Negative Attention Score Alignmentcited by 12

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2023Transformers in the Service of Description Logic-based Contexts
  2. 2024Calibrating Reasoning in Language Models with Internal Consistency
  3. 2024Transformer-based Language Models for Reasoning in the Description Logic ALCQ
  4. 2025Advancing Reasoning in Large Language Models: Promising Methods and Approaches
  5. 2025Dissecting Logical Reasoning in LLMs: A Fine-Grained Evaluation and Supervision Study
  6. 2025Hierarchical Reasoning Models: Perspectives and Misconceptions
  7. 2026Discovering a Shared Logical Subspace: Steering LLM Logical Reasoning via Alignment of Natural-Language and Symbolic Views
  8. 2025Leveraging Parameter Space Symmetries for Reasoning Skill Transfer in LLMs