通过注意力对齐量化大模型逻辑推理一致性,无需复杂测试即可评估推理质量。
Quantifying Logical Consistency in Transformers via Query-Key Alignment

- 利用变压器注意力头中的查询-键对齐生成评分,快速检测推理链条是否合理。
- 在1.5B到70B参数模型上验证,该方法能有效区分正确与错误推理,抗干扰能力强。
- 适合关注模型推理可信度的研究者或开发者,尤其适用于大规模模型评估。
大型语言模型在自然语言处理任务中表现优异,但在多步逻辑推理方面仍面临挑战。尽管思维链提示(Chain-of-Thought prompting)通过生成中间步骤提升了推理能力,但缺乏评估这些推理过程连贯性的机制。本文提出一种轻量级的逻辑推理评估策略,基于Transformer注意力头中的查询-键对齐计算单一前向传播的「QK得分」,揭示可区分有效与无效推理的潜在表示,为传统消融法提供可扩展替代方案。我们在多个逻辑推理基准上进行了实证验证,结果表明该方法对干扰项具有更强鲁棒性,并能支持更深层次推理。实验涵盖从1.5B到70B参数的多种模型。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。