2025-10-08 · 专家 · 自然语言处理 · 机器学习

Mixing Mechanisms: How Language Models Retrieve Bound Entities In-Context

本研究揭示了语言模型在上下文中绑定和检索实体时所采用的混合机制,包括位置、词汇和反身机制,并构建了一个因果模型来模拟实体检索过程。

更新于 2025-10-08。作者:Yoav Gur-Arieh、Mor Geva、Atticus Geiger。

中文摘要

情境推理的一个关键组成部分是语言模型(LMs)对实体进行绑定以便后续检索的能力。例如,一个LM可能会通过将“Ann”绑定到“pie”来表示“Ann loves pie”,这样当被问及“Who loves pie?”时,它就能检索到“Ann”。先前关于绑定实体短列表的研究发现,LMs通过位置机制实现这种检索,其中“Ann”的检索基于其在语境中的位置。在这项工作中,我们发现这种机制在更复杂的设置中泛化效果不佳;随着语境中绑定实体的数量增加,位置机制在中部位置变得嘈杂且不可靠。为了弥补这一点,我们发现LMs通过词汇机制(使用其绑定的对应词“pie”检索“Ann”)和反身机制(通过直接指针检索“Ann”)补充了位置机制。通过在九个模型和十个绑定任务上进行的大量实验,我们揭示了LMs混合这些机制以驱动模型行为的持续模式。我们利用这些见解开发了一个因果模型,该模型结合了所有三种机制,并估计了具有95%一致性的下一个标记分布。最后,我们表明我们的模型可以泛化到包含实体组的开放式文本的更长的输入,进一步证明了我们的发现在更自然的环境中的鲁棒性。总体而言,我们的研究建立了一个更全面的图景,描述了LMs如何绑定和检索情境中的实体。

英文摘要

A key component of in-context reasoning is the ability of language models (LMs) to bind entities for later retrieval. For example, an LM might represent "Ann loves pie" by binding "Ann" to "pie", allowing it to later retrieve "Ann" when asked "Who loves pie?" Prior research on short lists of bound entities found strong evidence that LMs implement such retrieval via a positional mechanism, where "Ann" is retrieved based on its position in context. In this work, we find that this mechanism generalizes poorly to more complex settings; as the number of bound entities in context increases, the positional mechanism becomes noisy and unreliable in middle positions. To compensate for this, we find that LMs supplement the positional mechanism with a lexical mechanism (retrieving "Ann" using its bound counterpart "pie") and a reflexive mechanism (retrieving "Ann" through a direct pointer). Through extensive experiments on nine models and ten binding tasks, we uncover a consistent pattern in how LMs mix these mechanisms to drive model behavior. We leverage these insights to develop a causal model combining all three mechanisms that estimates next token distributions with 95% agreement. Finally, we show that our model generalizes to substantially longer inputs of open-ended text interleaved with entity groups, further demonstrating the robustness of our findings in more natural settings. Overall, our study establishes a more complete picture of how LMs bind and retrieve entities in-context.

解读

一句话总结

本研究揭示了语言模型在上下文中绑定和检索实体时所采用的混合机制,包括位置、词汇和反身机制,并构建了一个因果模型来模拟实体检索过程。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源