arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2304.14767cs.CL

解析自回归语言模型中事实关联的回忆机制

Dissecting Recall of Factual Associations in Auto-Regressive Language Models

Google DeepMind(谷歌DeepMind);Tel Aviv University(特拉维夫大学);Google Research(谷歌研究院)

Mor Geva, Jasmijn Bastings, Katja Filippova, Amir Globerson

AI总结:

本文通过信息流分析揭示自回归语言模型回忆事实关联的三步内部机制,即主体表征富集、关系信息传播及注意力头查询提取,为知识定位与编辑研究提供新视角。

摘要:

基于Transformer的语言模型(LMs)已知能够在其参数中捕获事实知识。虽然以往的研究关注了事实关联存储的位置,但对于它们在推理过程中如何在内部被检索却知之甚少。我们通过信息流的视角来研究这一问题。给定一个主体-关系查询,我们研究模型如何聚合关于主体和关系的信息以预测正确的属性。通过对注意力边的干预,我们首先确定了信息传播到预测的两个关键点:一个来自关系位置,随后另一个来自主体位置。接下来,通过分析这些点的信息,我们揭示了属性提取的三步内部机制。首先,最后一个主体位置的表征经历一个由早期MLP子层驱动的富集过程,以编码许多与主体相关的属性。其次,来自关系的信息传播到预测。第三,预测表征“查询”富集后的主体以提取属性。或许令人惊讶的是,这种提取通常通过注意力头完成,这些注意力头往往在其参数中编码主体-属性映射。总体而言,我们的发现引入了关于事实关联如何在语言模型内部存储和提取的全面视角,促进了未来关于知识定位和编辑的研究。

英文摘要:

Transformer-based language models (LMs) are known to capture factual knowledge in their parameters. While previous work looked into where factual associations are stored, only little is known about how they are retrieved internally during inference. We investigate this question through the lens of information flow. Given a subject-relation query, we study how the model aggregates information about the subject and relation to predict the correct attribute. With interventions on attention edges, we first identify two critical points where information propagates to the prediction: one from the relation positions followed by another from the subject positions. Next, by analyzing the information at these points, we unveil a three-step internal mechanism for attribute extraction. First, the representation at the last-subject position goes through an enrichment process, driven by the early MLP sublayers, to encode many subject-related attributes. Second, information from the relation propagates to the prediction. Third, the prediction representation "queries" the enriched subject to extract the attribute. Perhaps surprisingly, this extraction is typically done via attention heads, which often encode subject-attribute mappings in their parameters. Overall, our findings introduce a comprehensive view of how factual associations are stored and extracted internally in LMs, facilitating future research on knowledge localization and editing.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑