arXiv:2409.05448cs.CL2024-09EMNLP被引 27

揭示语言模型绑定实体属性的内在机制,发现顺序编码是关键

Representational Analysis of Binding in Language Models

  • 通过降维发现激活中存在编码顺序的低秩子空间
  • 实验证明修改顺序编码方向可改变绑定结果
  • 为理解模型推理提供新视角,适合研究模型内部机制者

实体追踪对复杂推理至关重要。为实现上下文中的实体追踪,语言模型必须将实体与其属性绑定(如将箱子与内容绑定)。例如,在上下文“咖啡在Z箱,石头在M箱,地图在H箱”后,若要推断“Z箱包含咖啡”,模型需将“Z箱”与“咖啡”绑定。现有研究提出绑定标识(Binding ID, BI)机制,认为模型用抽象的BI标记实体-属性对。然而,未捕捉到直接影响绑定行为的顺序标识(Ordering ID, OI)。本文通过主成分分析(PCA)等降维方法,发现模型激活中存在一个主要编码实体与属性出现顺序的低秩子空间。进一步实验表明,沿该子空间方向修改激活表示,模型会相应地改变绑定关系:例如,通过替换此方向上的激活,可使模型推断出“Z箱包含石头”或“Z箱包含地图”。这证实了OI对绑定行为的因果影响。

原文摘要 · Abstract (English)

Entity tracking is essential for complex reasoning. To perform in-context entity tracking, language models (LMs) must bind an entity to its attribute (e.g., bind a container to its content) to recall attribute for a given entity. For example, given a context mentioning ``The coffee is in Box Z, the stone is in Box M, the map is in Box H'', to infer ``Box Z contains the coffee'' later, LMs must bind ``Box Z'' to ``coffee''. To explain the binding behaviour of LMs, existing research introduces a Binding ID mechanism and states that LMs use a abstract concept called Binding ID (BI) to internally mark entity-attribute pairs. However, they have not captured the Ordering ID (OI) from entity activations that directly determines the binding behaviour. In this work, we provide a novel view of the BI mechanism by localizing OI and proving the causality between OI and binding behaviour. Specifically, by leveraging dimension reduction methods (e.g., PCA), we discover that there exists a low-rank subspace in the activations of LMs, that primarily encodes the order (i.e., OI) of entity and attribute. Moreover, we also discover the causal effect of OI on binding that when editing representations along the OI encoding direction, LMs tend to bind a given entity to other attributes accordingly. For example, by patching activations along the OI encoding direction we can make the LM to infer ``Box Z contains the stone'' and ``Box Z contains the map''.

语言模型绑定机制表征分析顺序编码

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