揭示逻辑推理的算法演绎电路
Revealing Algorithmic Deductive Circuits for Logical Reasoning
May 27, 2026
作者: Phuong Minh Nguyen, Tien Huu Dang, Naoya Inoue
cs.AI
摘要
近期研究表明,大语言模型(LLMs)通过引入功能符号表征(如抽象描述图遍历算法和少样本学习中逐步推理的符号形式)能够展现出强大的推理能力。然而,目前尚不明确LLMs如何仅凭少量示例就能真正理解每个推理步骤的抽象含义及整体算法逻辑。本研究旨在定位负责各推理步骤的注意力头,并刻画这些头之间传递的信息类型。我们首先在符号增强型思维链(CoT)提示框架下,将构成推理的步骤与其对应的词元logits对齐。分析表明,引导推理过程的词元位置与低置信度分数相关,这种低置信度源于示例中推理行为模式需满足的约束条件。随后采用因果中介分析技术识别负责这些模式的注意力头。此外,研究结果显示:LLMs通过专用注意力头(约占全部注意力头的3%)为各子推理任务检索事实性和规则性信息,而高层网络层主要促进信息整合及全局推理策略(如图遍历算法)的涌现——这种策略协调多个中间推理步骤以完成整体任务。
English
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.