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 theory and experimentation that this simple mechanism may be the reason why LLMs can learn in-context and not only during training. Specifically, we show how a transformer block implicitly transforms a context into a low-rank weight-update of its MLP layer.


翻译:大型语言模型(LLM)最显著的特征之一是其上下文学习能力。具体而言,在推理阶段,当新模式以提示中的示例形式呈现时,LLM能够在无需额外权重更新的情况下学习这些模式,即使这些模式在训练期间从未出现过。这种现象背后的机制在很大程度上仍是未知的。本研究表明,自注意力层与多层感知机(MLP)的堆叠结构,使得Transformer模块能够根据上下文隐式地调整MLP层的权重。我们通过理论分析与实验验证提出,这一简单机制可能是LLM不仅能在训练中学习,还能进行上下文学习的关键原因。具体而言,我们证明了Transformer模块如何将上下文隐式地转化为其MLP层的低秩权重更新。

0
下载
关闭预览

相关内容

CLIP通用提示学习的简要概述
专知会员服务
16+阅读 · 3月13日
【NeurIPS2022】通过模型转换的可解释强化学习
专知会员服务
38+阅读 · 2022年10月4日
专知会员服务
41+阅读 · 2021年6月19日
【CVPR2021】跨模态检索的概率嵌入
专知
17+阅读 · 2021年3月2日
【CVPR 2020 Oral】小样本类增量学习
专知
20+阅读 · 2020年6月26日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
VIP会员
相关VIP内容
CLIP通用提示学习的简要概述
专知会员服务
16+阅读 · 3月13日
【NeurIPS2022】通过模型转换的可解释强化学习
专知会员服务
38+阅读 · 2022年10月4日
专知会员服务
41+阅读 · 2021年6月19日
相关资讯
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员