arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.16003cs.CLcs.LG
收藏

无需训练的学习:上下文学习的内在动态

Learning without training: The implicit dynamics of in-context learning

Google(谷歌)

Benoit Dherin, Michael Munn, Hanna Mazzawi, Michael Wunder, Javier Gonzalvo

AI总结:

本文通过理论分析和实验证明,自注意力层与MLP的组合使Transformer块能够根据上下文隐式修改MLP权重,从而解释大语言模型在推理时无需权重更新即可进行上下文学习的机制。

摘要:

大型语言模型(LLMs)最显著的特征之一是其上下文学习能力。即在推理时,即使提示中呈现的模式在训练中未见,LLM也能在无需额外权重更新的情况下学习新模式。这种机制如何实现仍很大程度上未知。本文中,我们展示了自注意力层与MLP的堆叠使得Transformer块能够根据上下文隐式修改MLP层的权重。通过理论分析和实验,我们认为这种简单机制可能有助于解释为什么LLMs展现出超越训练捕获的上下文学习能力。具体而言,我们证明带有上下文的标准前向传播在数学上等价于无上下文但MLP权重通过表示上下文的最小低秩更新进行更新的前向传播。

英文摘要:

One of the most striking features of Large Language Models (LLMs) is their ability to learn in-context. Namely at inference time an LLM is able to learn new patterns without any additional weight update when these patterns are presented in the form of examples in the prompt, even if these patterns were not seen during training. The mechanisms through which this can happen are still largely unknown. In this work, we show that the stacking of a self-attention layer with an MLP allows the transformer block to implicitly modify the weights of the MLP layer according to the context. We argue through theoretical analysis and experimentation that this simple mechanism may help explain why LLMs demonstrate capabilities of in-context learning, beyond what is captured during training. Specifically, we show that a standard forward pass with context is mathematically equivalent to a forward pass without context but with the MLP weights updated by a minimal low-rank update representing the context.

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

↑