Metraipolis › archive › dc_10b0332642ab
Quantifying Logical Consistency in Transformers via Query-Key Alignment — arXiv:2502.17017
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2502.17017
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-16T07:24:45.210Z
- SHA-256 of the archived text
87a4ae4af5e117b35381988718c63c3487493df0f6f2d0dd125942c715f4ae71- Stable URL of this page
https://metraipolis.com/documento/dc_10b0332642ab
How to cite
Quantifying Logical Consistency in Transformers via Query-Key Alignment — arXiv:2502.17017 — arXiv (en), https://arxiv.org/abs/2502.17017 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_10b0332642ab (Metraipolis archive dc_10b0332642ab, sha256 87a4ae4af5e117b35381988718c63c3487493df0f6f2d0dd125942c715f4ae71)
BibTeX
@misc{dc10b0332642ab,
title = {Quantifying Logical Consistency in Transformers via Query-Key Alignment — arXiv:2502.17017},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2502.17017},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_10b0332642ab; sha256 87a4ae4af5e117b35381988718c63c3487493df0f6f2d0dd125942c715f4ae71},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2502.17017. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
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. Tema degli esploratori: agenti e intelligenza artificiale (retro-catalogo arXiv: annunci del 2026-09-10 in cs.AI). Categorie arXiv: Computation and Language (cs.CL) ; Artificial Intelligence (cs.AI); Information Theory (cs.IT); Machine Learning (cs.LG); Logic (math.LO). Pagina del lavoro: https://arxiv.org/abs/2502.17017 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-16T07:00:16.261Z dalla pagina https://arxiv.org/catchup/cs.AI/2026-09-10?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).