研究Transformer在何种预训练条件下能跨任务泛化,发现任务多样性是关键。
When can in-context learning generalize out of task distribution?
- 用线性函数任务研究预训练中的任务多样性对ICL的影响。
- 任务多样性提升后,模型从局域泛化转向全任务空间泛化。
- 深度与问题维度也影响泛化能力的转变临界点。
上下文学习(ICL)是预训练Transformer的一项突出能力,使其在仅见少量示例后即可泛化到未见过的任务。本文通过实验探究了促使ICL在分布外任务中仍能泛化的预训练分布条件。以往工作关注预训练数据中不同任务的数量,本文则采用新的任务多样性概念,研究在训练于线性函数的Transformer中ICL的出现机制。结果表明,随着任务多样性的增加,Transformer会经历一次相变:从仅在预训练任务分布内有效的专用解,转变为可泛化至整个任务空间的通用解。我们还观察到非线性回归问题中存在类似转变。构建了相图以刻画任务多样性与预训练任务数的交互关系,并进一步探索了模型深度和回归问题维度对这一转变的影响。
原文摘要 · Abstract (English)
In-context learning (ICL) is a remarkable capability of pretrained transformers that allows models to generalize to unseen tasks after seeing only a few examples. We investigate empirically the conditions necessary on the pretraining distribution for ICL to emerge and generalize \emph{out-of-distribution}. Previous work has focused on the number of distinct tasks necessary in the pretraining dataset. Here, we use a different notion of task diversity to study the emergence of ICL in transformers trained on linear functions. We find that as task diversity increases, transformers undergo a transition from a specialized solution, which exhibits ICL only within the pretraining task distribution, to a solution which generalizes out of distribution to the entire task space. We also investigate the nature of the solutions learned by the transformer on both sides of the transition, and observe similar transitions in nonlinear regression problems. We construct a phase diagram to characterize how our concept of task diversity interacts with the number of pretraining tasks. In addition, we explore how factors such as the depth of the model and the dimensionality of the regression problem influence the transition.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。