When Attention Closes: How LLMs Lose the Thread in Multi-Turn Interaction
作者: Vardhan Dongre, Joseph Hsieh, Viet Dac Lai, Seunghyun Yoon, Trung Bui, Dilek Hakkani-Tür
分类: cs.AI, cs.CL
发布日期: 2026-05-13
💡 一句话要点
提出Goal Accessibility Ratio (GAR)诊断LLM在多轮交互中丢失上下文的机制,揭示注意力机制失效后的信息残留。
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 多轮对话 注意力机制 残差连接 上下文丢失
📋 核心要点
- 大型语言模型在多轮对话中容易丢失上下文信息,例如指令、角色和规则,但缺乏对其失效机制的深入理解。
- 论文提出“通道转换”理论,认为目标定义token的注意力可访问性降低,但目标信息可能残留在残差表示中,并引入GAR指标进行量化。
- 实验表明,注意力机制失效后,不同模型架构表现出不同的失效模式,且残差表示中的目标信息可被线性探针有效恢复。
📝 摘要(中文)
大型语言模型(LLM)在单轮交互中能遵循复杂指令,但在多轮交互中常丢失指令、角色设定和规则。本文提出一种通道转换解释:定义目标的token通过注意力机制变得难以访问,但目标相关信息可能保留在残差表示中。引入目标可访问率(GAR),衡量生成token到任务定义目标token的注意力。结合滑动窗口消融和残差流探测,揭示了注意力失效后的架构特性。不同架构表现出不同的失效模式:一些模型在注意力消失时仍保持目标条件行为,另一些模型即使残差目标信息可解码也失效,且编码层从2到27不等。在Mistral模型中强制关闭注意力通道,导致20个事实保留任务的召回率从接近完美降至11%,并提高了角色约束违反率。线性探针从残差表示中恢复了每个episode的召回结果,AUC高达0.99。注意力损失和残差可解码性之间的差距预测了目标条件行为是否能在通道关闭后幸存。本文贡献了GAR作为诊断工具,通道转换框架作为受控的机制解释,以及窗口注意力关闭下失效时间的可参数化预测。
🔬 方法详解
问题定义:大型语言模型在多轮对话中表现出“丢失上下文”的现象,即无法持续遵循初始指令、角色设定或规则。现有的研究主要集中在行为层面进行测量,缺乏对这种现象的内在机制的解释,难以指导模型改进。
核心思路:论文的核心思路是将多轮对话中LLM的失效归因于“通道转换”,即从依赖注意力机制访问目标定义token,转变为依赖残差连接中残留的目标信息。当注意力通道关闭时,模型对目标的理解和遵循能力会受到影响。通过分析注意力权重和残差表示,可以揭示模型失效的内在机制。
技术框架:论文的技术框架主要包含以下几个部分:1) Goal Accessibility Ratio (GAR):定义GAR来量化生成token对任务定义目标token的注意力程度。2) 滑动窗口消融实验:通过限制注意力窗口大小,模拟注意力通道的逐渐关闭,观察模型行为的变化。3) 残差流探测:使用线性探针从残差表示中提取目标相关信息,评估目标信息在残差连接中的保留程度。4) 因果消融实验:在Mistral模型中,强制关闭注意力通道,观察对模型性能的影响。
关键创新:论文的关键创新在于提出了“通道转换”的视角来解释LLM在多轮对话中的失效现象,并设计了GAR指标来量化注意力机制的作用。此外,通过结合滑动窗口消融、残差流探测和因果消融实验,揭示了注意力机制失效后,目标信息在残差连接中的保留情况以及对模型行为的影响。
关键设计:GAR的计算方式为生成token到任务定义目标token的平均注意力权重。滑动窗口消融实验中,窗口大小逐渐减小,模拟注意力通道的关闭。残差流探测使用线性探针,训练目标是预测每个episode的召回结果。因果消融实验通过直接修改注意力权重,强制关闭注意力通道。
🖼️ 关键图片
📊 实验亮点
实验结果表明,注意力机制的失效与模型性能下降密切相关。在Mistral模型中,强制关闭注意力通道导致20个事实保留任务的召回率从接近完美降至11%。线性探针能够从残差表示中恢复每个episode的召回结果,AUC高达0.99,表明残差连接中保留了大量目标相关信息。注意力损失和残差可解码性之间的差距可以预测目标条件行为是否能在通道关闭后幸存。
🎯 应用场景
该研究成果可应用于提升对话系统的鲁棒性和一致性,尤其是在需要长时间交互和复杂指令遵循的场景下,例如智能客服、虚拟助手和游戏AI。通过理解LLM丢失上下文的机制,可以设计更有效的训练方法和模型架构,提高LLM在多轮对话中的表现。
📄 摘要(原文)
Large language models can follow complex instructions in a single turn, yet over long multi-turn interactions they often lose the thread of instructions, persona, and rules. This degradation has been measured behaviorally but not mechanistically explained. We propose a channel-transition account: goal-defining tokens become less accessible through attention, while goal-related information may persist in residual representations. We introduce the Goal Accessibility Ratio (GAR), measuring attention from generated tokens to task-defining goal tokens, and combine it with sliding-window ablations and residual-stream probes. When attention to instructions closes, what survives reveals architecture. Across architectures, the transition yields qualitatively distinct failure modes: some models preserve goal-conditioned behavior at vanishing attention, others fail despite decodable residual goal information, and the layer at which this encoding emerges varies from 2 to 27. A within-model causal ablation that force-closes the attention channel in Mistral collapses recall from near-perfect to 11% on a 20-fact retention task and raises persona-constraint violations above an adversarial-pressure baseline without user pressure, with both effects emerging at the predictable crossover turn. Linear probes recover per-episode recall outcomes from residual representations with AUC up to 0.99 across all four primary architectures, while input embeddings remain at chance. Across architectures and model scales, the gap between attention loss and residual decodability predicts whether goal-conditioned behavior survives channel closure. We contribute GAR as a diagnostic, the channel-transition framework as a controlled mechanistic account, and a parametric prediction of failure timing under windowed attention closure.