arXiv:2608.07261cs.CL2026-08

发现大模型两跳推理失败根源,提出新训练法提升泛化能力

Why Knowing Both Hops Is Not Enough: Understanding Two-Hop Generalization in Language Models

论文配图:Why Knowing Both Hops Is Not Enough: Understanding Two-Hop Generalization in Language Models
图 1 · 摘自论文原文
  • 在符号环境中训练模型,分析两跳推理机制
  • 分布外第二跳推理总是失败,因层间表征不匹配
  • 设计循环式训练策略,显著提升跨输入形式泛化

大型语言模型虽能解决复杂多跳问题,但在简单两跳查询上却出现奇怪的失败:尽管模型正确存储了每个独立步骤的信息,却难以将其整合。为理解这一现象的内部机制,我们在受控符号环境中从头训练Transformer模型。实验发现,当第二跳符合训练分布时模型可可靠泛化,但一旦偏离则必然失败。通过机制分析,我们揭示了两种不同泛化行为的原因:成功时,模型在不同上下文中对同一实体产生一致的中间表征;失败时,低层正确构建表征,而高层虽学习原子事实对应输出,却未学会对表征进行推理,导致层间不匹配。基于此洞察,我们提出一种循环式训练策略,使Transformer能复用推理电路处理不同输入形式,显著提升分布外两跳查询的泛化性能。数据与代码已开源。

原文摘要 · Abstract (English)

Large language models (LLMs) can solve complex multi-hop problems yet exhibit puzzling failures on simple two-hop queries: although a model may correctly store each individual hop, it often fails to combine them. To understand the internal mechanisms of this phenomenon, we train transformers from scratch in a controlled symbolic environment. Our experiments reveal a pattern in two-hop generalization: models generalize reliably when the second hop follows the training distribution, but always fail when it deviates. Through mechanistic analysis, we provide a complete explanation for these distinct generalization behaviors: in settings where models generalize successfully, performance is driven by the emergence of consistent intermediate representations for the same entities across contexts, whereas failures on settings where the second hop is out-of-distribution arise from a mismatch across layers: lower layers correctly construct these intermediate representations, but upper layers, while trained on corresponding atomic facts, primarily learn to map them to outputs rather than to reason over them. Driven by this insight, we propose a recurrent-style training strategy, which enables transformers to reuse their reasoning circuitry across input forms and substantially improves generalization on out-of-distribution two-hop queries. Our data and code are available at https://github.com/zzl-strong/two_hop .

语言模型推理机制泛化能力训练策略

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