arXiv:2604.01094cs.CLcs.AI2026-04

发现语言模型靠特殊注意力头实现按序回忆上下文信息。

Temporal Dependencies in In-Context Learning: The Role of Induction Heads

  • 用序列回忆机制解释模型如何追踪上下文中的重复项。
  • 移除高诱导得分注意力头后,+1滞后偏好显著下降。
  • 适合研究模型推理机制或注意力设计的读者。

大型语言模型(LLMs)具备强大的上下文学习能力,但其如何跟踪和检索上下文信息仍不明确。受认知科学中自由回忆范式启发,我们发现多个开源LLM表现出类似序列回忆的模式:在输入序列中,当某个标记重复出现时,模型倾向于对紧随其后的下一个标记赋予最高概率。通过系统消融实验,我们证明诱导头(induction heads)——即关注当前标记前一次出现后紧接着的标记的特殊注意力头——在此现象中起关键作用。移除高诱导得分头显著降低+1滞后偏差,而随机消融则无此效果。此外,在少样本提示下执行序列回忆任务时,移除高诱导头导致性能下降更明显。结果表明,诱导头与时间上下文处理存在机制性关联,是有序检索与序列回忆行为的关键组件。

原文摘要 · Abstract (English)

Large language models (LLMs) exhibit strong in-context learning capabilities, but how they track and retrieve information from context remains underexplored. Drawing on the free recall paradigm in cognitive science (where participants recall list items in any order), we show that several open-source LLMs consistently display a serial-recall-like pattern, assigning peak probability to tokens that immediately follow a repeated token in the input sequence. Through systematic ablation experiments, we show that induction heads, specialized attention heads that attend to the token following a previous occurrence of the current token, play an important role in this phenomenon. Removing heads with a high induction score substantially reduces the +1 lag bias, whereas ablating random heads does not reproduce the same reduction. We also show that removing heads with high induction scores impairs the performance of models prompted to do serial recall using few-shot learning to a larger extent than removing random heads. Our findings highlight a mechanistically specific connection between induction heads and temporal context processing in transformers, suggesting that these heads are especially important for ordered retrieval and serial-recall-like behavior during in-context learning.

注意力机制上下文学习序列记忆

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