arXiv:2506.04289cs.LGq-bio.NC2025-06被引 1

揭示Transformer模型在传递推理中的机制差异与可塑性。

Relational reasoning and inductive bias in transformers and large language models

  • 对比IWL与ICL在传递推理中的不同学习模式
  • IWL模型能自发实现传递推理,而ICL仅在必要时才做到
  • 预训练线性回归任务可显著提升ICL的推理能力

基于Transformer的模型展现出卓越的推理能力,但其关系推理机制仍不清晰。本文研究了Transformer在传递推理(如若A>B且B>C,则A>C)任务中的表现,比较了权重内学习(IWL)与上下文内学习(ICL)的行为与机制。结果发现,IWL模型学习到线性嵌入,从而产生类似人类和动物的传递推理及其他行为效应;而ICL模型仅在训练数据强制要求时才具备传递泛化能力,否则采用匹配复制策略。有趣的是,对ICL模型进行线性回归任务的预训练,使其内部表示和行为模式在定性和定量上更接近IWL。为验证大语言模型中是否存在类似模式,我们采用一致性范式,无需访问训练数据即可区分IWL与ICL的泛化特性。结果显示,IWL推理比ICL更倾向于传递泛化;此外,引导ICL模型使用线性心理地图后,其在不同几何提示下的传递推理能力显著提升。这些结果表明,训练方式与诱导表征的几何结构共同决定Transformer在传递推理上的能力。

原文摘要 · Abstract (English)

Transformer-based models have demonstrated remarkable reasoning abilities, but the mechanisms underlying relational reasoning remain poorly understood. We investigate how transformers perform \textit{transitive inference}, a classic relational reasoning behavior from psychology which elicits inference about indirectly related items (e.g., if $A > B$ and $B > C$, then $A > C$). We compare in-weights learning (IWL) and in-context learning (ICL) behaviors and mechanisms on these tasks, and fine profoundly different patterns of generalization. IWL models learn a linear embedding, which leads to transitive inference as well as other behavioral effects present in humans and animals. ICL models, in contrast, are capable of learning to generalize transitively, but only do so when it is necessitated by the training data, otherwise learning a match-and-copy strategy. Interestingly, pre-training ICL models on in-context linear regression tasks that provide them with a latent linear representation is sufficient to make the ICL behaviors and internal representations qualitatively and quantitatively more like IWL. In order to test whether the same inference patterns are present across in large language models, we leverage a congruency paradigm which allows us to differentially probe IWL and ICL generalization patterns without access to their training data. We indeed see IWL reasoning leads to more transitive generalization than ICL. Moreover, we find that prompting the ICL models to use a linear mental map led to increased transitive inference over different geometric prompts. Together, these results reveal that both the training regime and the geometric structure of induced representations critically determine transformers capacity for transitive inference.

关系推理Transformer推理机制大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。