arXiv:2511.01033cs.AIcs.CL2025-11被引 2

揭示了Transformer中上下文学习的诱导头如何形成及其数学机制。

On the Emergence of Induction Heads for In-Context Learning

  • 发现诱导头由简单可解释的权重结构实现,源于最小化任务设定。
  • 训练过程被约束在19维参数子空间,仅3维决定诱导头出现。
  • 诱导头出现时间与上下文长度平方成正比,有严格渐近边界。

Transformer已成为自然语言处理的主流架构,其成功部分归功于一种称为上下文学习(ICL)的能力:模型能仅通过输入上下文习得并应用新关联,无需更新权重。本文研究了两层Transformer中已知的诱导头机制,该机制对上下文学习至关重要。我们发现实现诱导头的权重矩阵具有相对简单且可解释的结构。通过一个最小化ICL任务形式和改进的Transformer架构,我们从理论上解释了该结构的来源。我们给出形式化证明,训练动态始终被限制在参数空间的19维子空间内。实验验证了这一约束,并观察到仅有3个维度驱动诱导头的出现。进一步分析该3维子空间内的训练动态,发现诱导头出现时间遵循紧致渐近上界,且与输入上下文长度的平方成正比。

原文摘要 · Abstract (English)

Transformers have become the dominant architecture for natural language processing. Part of their success is owed to a remarkable capability known as in-context learning (ICL): they can acquire and apply novel associations solely from their input context, without any updates to their weights. In this work, we study the emergence of induction heads, a previously identified mechanism in two-layer transformers that is particularly important for in-context learning. We uncover a relatively simple and interpretable structure of the weight matrices implementing the induction head. We theoretically explain the origin of this structure using a minimal ICL task formulation and a modified transformer architecture. We give a formal proof that the training dynamics remain constrained to a 19-dimensional subspace of the parameter space. Empirically, we validate this constraint while observing that only 3 dimensions account for the emergence of an induction head. By further studying the training dynamics inside this 3-dimensional subspace, we find that the time until the emergence of an induction head follows a tight asymptotic bound that is quadratic in the input context length.

Transformer上下文学习诱导头可解释性

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