让Transformer通过循环计算实现深层隐式推理,突破传统模型的组合泛化瓶颈。
Loop, Think, & Generalize: Implicit Reasoning in Recurrent-Depth Transformers
- 用循环深度结构让同一层Transformer反复迭代,实现多步推理
- 在未训练过的组合规则上实现系统泛化,且推理深度可扩展至训练深度两倍
- 揭示了从记忆到泛化再到系统性推理的三阶段演化过程
我们研究隐式推理,即在单次前向传播中整合知识或规则的能力。尽管基于Transformer的大语言模型存储了大量事实知识和规则,却常无法组合这些知识以进行隐式多跳推理,表明其参数化知识缺乏组合泛化能力。为解决此问题,我们研究循环深度Transformer,该结构允许在同一Transformer层间进行迭代计算。我们在隐式推理场景下考察两类组合泛化挑战:系统泛化(训练中从未使用过的知识组合)与深度外推(从有限推理深度如5跳推广至更深如10跳)。通过从零训练的受控实验,我们发现普通Transformer在两项挑战上均表现不佳,而循环深度Transformer能有效实现泛化。对于系统泛化,我们发现其能力通过三阶段‘领悟’过程出现:从记忆过渡到分布内泛化,最终达成系统泛化,机制分析支持此过程。对于深度外推,我们证明通过增加推理时的迭代次数可解锁更深推理能力。我们进一步研究训练策略对泛化的影响,提供训练指导,并识别关键限制——过度推理会降低预测性能,阻碍极深组合的泛化。
原文摘要 · Abstract (English)
We study implicit reasoning, i.e. the ability to combine knowledge or rules within a single forward pass. While transformer-based large language models store substantial factual knowledge and rules, they often fail to compose this knowledge for implicit multi-hop reasoning, suggesting a lack of compositional generalization over their parametric knowledge. To address this limitation, we study recurrent-depth transformers, which enables iterative computation over the same transformer layers. We investigate two compositional generalization challenges under the implicit reasoning scenario: systematic generalization, i.e. combining knowledge that is never used for compositions during training, and depth extrapolation, i.e. generalizing from limited reasoning depth (e.g. training on up to 5-hop) to deeper compositions (e.g. 10-hop). Through controlled studies with models trained from scratch, we show that while vanilla transformers struggle with both generalization challenges, recurrent-depth transformers can effectively make such generalization. For systematic generalization, we find that this ability emerges through a three-stage grokking process, transitioning from memorization to in-distribution generalization and finally to systematic generalization, supported by mechanistic analysis. For depth extrapolation, we show that generalization beyond training depth can be unlocked by scaling inference-time recurrence, with more iterations enabling deeper reasoning. We further study how training strategies affect extrapolation, providing guidance on training recurrent-depth transformers, and identify a key limitation, overthinking, where excessive recurrence degrades predictions and limits generalization to very deep compositions.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。