揭示大模型逻辑推理中关键注意力头的作用机制
Revealing Algorithmic Deductive Circuits for Logical Reasoning

- 通过符号化思维链定位每步推理对应的注意力头
- 约3%注意力头负责事实与规则信息,高层头整合全局策略
- 发现低置信度标记与推理路径选择相关,适合研究模型可解释性
近期研究表明,大型语言模型(LLMs)在少样本学习设置下,通过引入功能符号表示(如图遍历算法和逐步推理),可实现强大的推理性能。然而,模型如何从有限示范中真正理解每一步推理及整体算法的抽象含义仍不明确。本研究旨在定位负责各推理步骤的注意力头,并分析其间信息传递类型。首先,在符号辅助的思维链(CoT)提示框架下,将推理步骤与对应标记的概率分布对齐。分析显示,引导推理过程的标记位置通常伴随较低置信度,这是由于示范中对推理行为模式的约束所致。随后采用因果中介分析技术识别相关注意力头。结果表明,约3%的注意力头专门用于提取事实与规则信息以完成子推理任务;而更高层注意力头则主要促进信息整合,推动全局推理策略(如图遍历算法)的形成,协调多个中间步骤完成整体任务。
原文摘要 · Abstract (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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。