arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2502.14010cs.LGcs.AIcs.CL
收藏

哪些注意力头对上下文学习(ICL)至关重要?

Which Attention Heads Matter for In-Context Learning?

UC Berkeley(加州大学伯克利分校)

Kayo Yin, Jacob Steinhardt

AI总结:

本研究比较了12个语言模型中的归纳头和函数向量(FV)头,发现少样本ICL性能主要依赖FV头,且FV头在训练中多由归纳头转变而来,表明归纳机制促进了驱动ICL的复杂FV机制的学习。

摘要:

大型语言模型(LLM)展现出令人印象深刻的上下文学习(ICL)能力,使其仅凭提示中的几个示例就能执行新任务。目前有两种不同的机制被提出来解释ICL:归纳头负责查找并复制相关词元,以及函数向量(FV)头,其激活计算ICL任务的潜在编码。为了更好地理解这两种截然不同的机制中哪一种驱动了ICL,我们研究并比较了12个语言模型中的归纳头和FV头。通过详细的消融实验,我们发现少样本ICL性能主要依赖于FV头,在较大的模型中尤为明显。此外,我们发现FV头和归纳头之间存在联系:许多FV头在训练初期是归纳头,随后才转变为FV机制。这使我们推测,归纳机制促进了更复杂的FV机制的学习,而后者最终驱动了ICL。

英文摘要:

Large language models (LLMs) exhibit impressive in-context learning (ICL) capability, enabling them to perform new tasks using only a few demonstrations in the prompt. Two different mechanisms have been proposed to explain ICL: induction heads that find and copy relevant tokens, and function vector (FV) heads whose activations compute a latent encoding of the ICL task. To better understand which of the two distinct mechanisms drives ICL, we study and compare induction heads and FV heads in 12 language models. Through detailed ablations, we discover that few-shot ICL performance depends primarily on FV heads, especially in larger models. In addition, we uncover that FV and induction heads are connected: many FV heads start as induction heads during training before transitioning to the FV mechanism. This leads us to speculate that induction facilitates learning the more complex FV mechanism that ultimately drives ICL.

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

↑