Revealing Algorithmic Deductive Circuits for Logical Reasoning
揭示逻辑推理的算法演绎电路
Phuong Minh Nguyen, Tien Huu Dang, Naoya Inoue
AI总结 本研究通过因果中介分析定位大语言模型中负责逻辑推理步骤的注意力头,发现少量专用头处理事实和规则信息,而高层头促进信息整合和全局推理策略的出现。
详情
最近的研究表明,通过在少样本学习设置中引入抽象描述图遍历算法和逐步推理的功能性符号表示,大型语言模型(LLMs)能够实现强大的推理性能。然而,目前尚不清楚LLMs如何仅从有限的示例中真正理解每个推理步骤的抽象含义以及整体算法。本文旨在定位负责单个推理步骤的注意力头,并刻画它们之间传输的信息类型。我们首先在符号辅助的思维链(CoT)提示框架下,将组成推理步骤与其对应的token logits对齐。我们的分析表明,引导推理过程的token位置与低置信度分数相关,这些低置信度分数是由满足演示中推理行为模式的约束引起的。然后,我们采用因果中介分析技术来识别负责这些模式的注意力头。此外,我们的发现表明,LLMs通过专门的注意力头(约占全部头的3%)为各个子推理任务检索事实和基于规则的信息,而较高层主要促进信息整合和全局推理策略(例如图遍历算法)的出现,这些策略协调多个中间推理步骤以解决整体任务。
Recent studies have shown that Large Language Models (LLMs) can achieve strong reasoning performance by incorporating functional symbolic representations that abstractly describe graph traversal algorithms and step-by-step reasoning in few-shot learning settings. However, it remains unclear how LLMs genuinely understand the abstract meaning of each reasoning step and the overall algorithm from only a limited number of demonstrations. This work aims to localize the attention heads responsible for individual reasoning steps and characterize the types of information transferred among them. We first align constituent reasoning steps with their corresponding token logits under a symbolic-aided Chain-of-Thought (CoT) prompting framework. Our analysis shows that token positions that steer the reasoning process are associated with low confidence scores caused by constraints on satisfying reasoning behavior patterns in demonstrations. We then adopt causal mediation analysis techniques to identify the attention heads responsible for these patterns. In addition, our findings indicate that LLMs retrieve factual and rule-based information for individual sub-reasoning tasks through specialized attention heads (approximately 3% total heads), whereas higher layers predominantly facilitate information integration and the emergence of global reasoning strategies (e.g., graph traversal algorithms) that coordinate multiple intermediate reasoning steps to solve the overall task.