arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.08590cs.CLcs.AIcs.LG
收藏

语言模型中的推理电路:三段论推理的机制性解释

Reasoning Circuits in Language Models: A Mechanistic Interpretation of Syllogistic Inference

Department of Computer Science, University of Manchester, UK(英国曼彻斯特大学计算机科学系);Idiap Research Institute, Switzerland(瑞士Idiap研究所);School of Computer Science, University of Sheffield, UK(英国谢菲尔德大学计算机科学学院);National Biomarker Centre, CRUK-MI, University of Manchester, UK(英国曼彻斯特大学国家生物标志物中心)

Geonhee Kim, Marco Valentino, André Freitas

AI总结:

本文通过电路发现方法,揭示语言模型在三段论推理中依赖中项抑制的充分必要电路,并发现其受世界知识污染,表明推理机制可迁移但非抽象逻辑原语。

摘要:

近期关于语言模型(LMs)推理能力的研究引发了争论:它们能否学习系统性的推理原则,抑或仅仅是利用了训练数据中的表面模式。为了理解并揭示语言模型在形式推理中所采用的机制,本文对三段论推理进行了机制性解释。具体而言,我们提出了一种电路发现方法,旨在解释与内容无关的形式推理机制。通过两种不同的干预方法,我们发现了一个涉及中项抑制的充分且必要的电路,该电路阐明了语言模型如何传递信息以从前提推导出有效结论。此外,我们研究了信念偏差在三段论推理中的表现,发现来自负责编码常识和情境化知识的额外注意力头存在部分污染的证据。最后,我们探讨了所发现机制在不同三段论格式、模型规模和架构中的泛化情况。所识别的电路对于模型达到高准确率(>60%)的三段论格式是充分且必要的,且在不同家族的模型中具有兼容的激活模式。总体而言,我们的研究结果表明,语言模型学习了可迁移的、与内容无关的推理机制,但同时,这些机制并不涉及可泛化的抽象逻辑原语,容易受到预训练期间获得的相同世界知识的污染。

英文摘要:

Recent studies on reasoning in language models (LMs) have sparked a debate on whether they can learn systematic inferential principles or merely exploit superficial patterns in the training data. To understand and uncover the mechanisms adopted for formal reasoning in LMs, this paper presents a mechanistic interpretation of syllogistic inference. Specifically, we present a methodology for circuit discovery aimed at interpreting content-independent and formal reasoning mechanisms. Through two distinct intervention methods, we uncover a sufficient and necessary circuit involving middle-term suppression that elucidates how LMs transfer information to derive valid conclusions from premises. Furthermore, we investigate how belief biases manifest in syllogistic inference, finding evidence of partial contamination from additional attention heads responsible for encoding commonsense and contextualized knowledge. Finally, we explore the generalization of the discovered mechanisms across various syllogistic schemes, model sizes and architectures. The identified circuit is sufficient and necessary for syllogistic schemes on which the models achieve high accuracy (>60%), with compatible activation patterns across models of different families. Overall, our findings suggest that LMs learn transferable content-independent reasoning mechanisms, but that, at the same time, such mechanisms do not involve generalizable and abstract logical primitives, being susceptible to contamination by the same world knowledge acquired during pre-training.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑