Late Attention Layers Alone Can Copy Entity Tokens, but Not Without Attending to Their Context

📄 arXiv: 2609.35663v1 📥 PDF

作者: Muyu He, Yuchen Liu, Ran Tao, Li Zhang

分类: cs.CL

发布日期: 2026-09-28


💡 一句话要点

提出新方法研究语言模型中的实体复制机制

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 实体复制 上下文标记 语言模型 注意力机制 深度学习

📋 核心要点

  1. 现有研究未系统探讨语言模型中哪些层负责实体复制及上下文标记的影响。
  2. 通过genie-in-a-bottle和attention lobotomy方法,研究了模型层与上下文标记对实体复制的作用。
  3. 实验结果表明,后半部分的特定层组对实体复制既必要又充分,上下文标记的注意力同样重要。

📝 摘要(中文)

大型语言模型(LLMs)在实体复制任务中表现出色,即从提示中复制指向实体的标记(实体标记)到输出中以回答问题。尽管大多数LLMs能够轻松完成实体复制,但现有研究未系统探讨哪些层专门负责此任务,以及同一序列中的其他标记(上下文标记)如何影响模型复制实体标记的能力。为了解决这些问题,本文在Qwen3-8B模型上进行实验,采用了两种新方法:genie-in-a-bottle和attention lobotomy。研究发现,模型后半部分的两个不同层组对实体复制既必要又充分。此外,上下文标记对实体标记的注意力同样对准确复制实体标记至关重要,尽管上下文标记本身并不存储实体信息。研究结果强调了后层在上下文引导下进行实体复制的重要性,呼吁未来研究如何传播和利用实体信息。

🔬 方法详解

问题定义:本文旨在探讨大型语言模型在实体复制任务中的层级作用及上下文标记的影响。现有方法未能系统分析哪些层负责此任务,以及上下文标记如何影响复制能力。

核心思路:通过设计两种新方法,genie-in-a-bottle和attention lobotomy,精确控制模型层的参与和上下文标记的注意力,从而分析其对实体复制的影响。

技术框架:研究采用Qwen3-8B模型,分为两部分:一是通过genie-in-a-bottle方法控制参与层,二是通过attention lobotomy方法切断特定标记对实体标记的注意力。

关键创新:提出了对模型层的细致分析,发现后半部分的特定层组对实体复制既必要又充分,同时强调上下文标记的注意力在复制过程中的重要性。

关键设计:在实验中,精确控制了模型层的参与,设置了不同的注意力机制,以确保上下文标记的影响被有效评估。

🖼️ 关键图片

fig_0
img_1
img_2

📊 实验亮点

实验结果显示,后半部分的特定层组对实体复制既必要又充分,且上下文标记的注意力对准确复制实体标记至关重要。这一发现为未来的模型设计提供了新的视角,强调了上下文信息在实体复制中的关键作用。

🎯 应用场景

该研究对大型语言模型在自然语言处理中的应用具有重要意义,尤其是在信息提取和问答系统中。通过深入理解实体复制机制,可以提升模型在复杂任务中的表现,推动更智能的对话系统和信息检索技术的发展。

📄 摘要(原文)

Large language models (LLMs) reliably perform entity copying, in which a model copies tokens referring to an entity, termed entity tokens, from the prompt into its output to answer a question. Although entity copying is straightforward for most LLMs, existing research does not provide a systematic account of which layers specialize in this fundamental task or how other tokens in the same sequence, termed context tokens, influence the model's ability to copy the entity tokens. To address these questions, we conduct experiments on Qwen3-8B using two novel methods: genie-in-a-bottle, which controls exactly which layers can participate in an entity-copying task, and attention lobotomy, which cuts off specific tokens' attention to entity tokens without affecting the remaining attention distribution. We find that two distinct groups of layers in the second half of the model are both necessary and sufficient for entity copying. Moreover, in addition to the decoding position's attention to entity tokens, context tokens' attention to entity tokens also proves necessary for copying the exact tokens, even though context tokens do not store entity information themselves unless they satisfy particular semantic properties. Our findings establish the critical role of late layers in entity copying under the guidance of context tokens, calling for future work on how models propagate and consume entity information.