Pretrained transformers exhibit the remarkable ability of in-context learning (ICL): they can learn tasks from just a few examples provided in the prompt without updating any weights. This raises a foundational question: can ICL solve fundamentally $\textit{new}$ tasks that are very different from those seen during pretraining? To probe this question, we examine ICL's performance on linear regression while varying the diversity of tasks in the pretraining dataset. We empirically demonstrate a $\textit{task diversity threshold}$ for the emergence of ICL. Below this threshold, the pretrained transformer cannot solve unseen regression tasks, instead behaving like a Bayesian estimator with the $\textit{non-diverse pretraining task distribution}$ as the prior. Beyond this threshold, the transformer significantly outperforms this estimator; its behavior aligns with that of ridge regression, corresponding to a Gaussian prior over $\textit{all tasks}$, including those not seen during pretraining. Thus, when pretrained on data with task diversity greater than the threshold, transformers $\textit{can}$ optimally solve fundamentally new tasks in-context. Importantly, this capability hinges on it deviating from the Bayes optimal estimator with the pretraining distribution as the prior. This study also explores the effect of regularization, model capacity and task structure and underscores, in a concrete example, the critical role of task diversity, alongside data and model scale, in the emergence of ICL. Code is available at https://github.com/mansheej/icl-task-diversity.


翻译:预训练Transformer展现出卓越的上下文学习能力:它们能够仅通过提示中的少数示例学习新任务,而无需更新任何参数。这引发了一个根本性问题:上下文学习能否解决与预训练任务截然不同的全新任务?为探究此问题,我们在改变预训练数据集任务多样性的条件下,考察了上下文学习在线性回归中的表现。我们通过实验证明,上下文学习的涌现存在一个**任务多样性阈值**。当任务多样性低于该阈值时,预训练Transformer无法解决未见过的回归任务,其行为类似于以**非多样化的预训练任务分布**为先验的贝叶斯估计器。而当任务多样性超过该阈值时,Transformer的表现显著优于该估计器;其行为与岭回归一致,对应一个覆盖**所有任务**(包括预训练中未见的任务)的高斯先验。因此,当预训练数据中的任务多样性超过阈值时,Transformer**能够**以上下文学习方式最优地解决全新任务。重要的是,这一能力依赖于它偏离以预训练分布为先验的贝叶斯最优估计器。本研究还探讨了正则化、模型容量和任务结构的影响,并通过具体实例强调:在上下文学习的涌现中,任务多样性与数据和模型规模同样关键。代码见 https://github.com/mansheej/icl-task-diversity。

0
下载
关闭预览

相关内容

【ACL2020】多模态信息抽取,365页ppt
专知会员服务
151+阅读 · 2020年7月6日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
164+阅读 · 2019年10月12日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
41+阅读 · 2019年10月9日
学习自然语言处理路线图
专知会员服务
140+阅读 · 2019年9月24日
RL解决'BipedalWalkerHardcore-v2' (SOTA)
CreateAMind
31+阅读 · 2019年7月17日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
IJCAI | Cascade Dynamics Modeling with Attention-based RNN
KingsGarden
13+阅读 · 2017年7月16日
Layer Normalization原理及其TensorFlow实现
深度学习每日摘要
32+阅读 · 2017年6月17日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
Arxiv
0+阅读 · 2023年12月26日
Arxiv
18+阅读 · 2021年3月16日
Recent advances in deep learning theory
Arxiv
52+阅读 · 2020年12月20日
VIP会员
最新内容
《无人水面艇文献综述与结构设计》135页
专知会员服务
2+阅读 · 今天14:53
乌克兰战场背后的新武器
专知会员服务
6+阅读 · 6月12日
基于博弈论的陆军人机协同(长文报告)
专知会员服务
12+阅读 · 6月12日
美国陆军航空兵:以愿景引领转型
专知会员服务
7+阅读 · 6月12日
相关资讯
RL解决'BipedalWalkerHardcore-v2' (SOTA)
CreateAMind
31+阅读 · 2019年7月17日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
IJCAI | Cascade Dynamics Modeling with Attention-based RNN
KingsGarden
13+阅读 · 2017年7月16日
Layer Normalization原理及其TensorFlow实现
深度学习每日摘要
32+阅读 · 2017年6月17日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员