Skip to main content
QUICK REVIEW

[论文解读] Pretraining task diversity and the emergence of non-Bayesian in-context learning for regression

Allan Raventós, Mansheej Paul|arXiv (Cornell University)|Jun 26, 2023
Domain Adaptation and Few-Shot LearningComputer Science被引用 11
一句话总结

本文展示了在预训练中的任务多样性阈值,会触发线性回归的非贝叶斯上下文学习,随着多样性增加,变换器从 dMMSE 风格行为转向 Ridge 风格行为。

ABSTRACT

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 $ extit{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 $ extit{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 $ extit{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 $ extit{all tasks}$, including those not seen during pretraining. Thus, when pretrained on data with task diversity greater than the threshold, transformers $ extit{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.

研究动机与目标

  • 研究上下文学习(ICL)是否能够解决在预训练过程中未见过的根本性新回归任务。
  • 考察预训练任务多样性如何影响 ICL 的出现及其算法特性。
  • 比较变换器的 ICL 行为在不同任务多样性下与贝叶斯估计器(dMMSE)及岭回归的差异。

提出的方法

  • 研究线性回归的 ICL,潜在回归向量来自有限的预训练任务分布,真实任务分布为高斯分布。
  • 为两种任务分布定义最优估计量:对预训练任务采用离散 MMSE(dMMSE),对真实任务采用岭回归。
  • 改变预训练任务多样性(M),通过在上下文预测中的均方误差来衡量与 dMMSE 和 Ridge 的对齐程度。
  • 分析学习动力学、任务维度效应、正则化和模型容量对 ICL 出现的影响。
  • 使用以噪声的 (x, y) 对序列为输入,采用下一个令牌 MSE 目标训练的变换器模型(类似 GPT‑2)。

实验结果

研究问题

  • RQ1增加预训练任务多样性是否能使变换器在上下文中学习新任务?
  • RQ2随着任务多样性的变化,变换器的上下文学习行为相对于贝叶斯估计器和岭回归如何转变?
  • RQ3任务维度、正则化和模型容量在回归的 ICL 出现中起什么作用?

主要发现

  • 存在一个任务多样性阈值,超过该阈值,变换器从贝叶斯最优(dMMSE)行为转变为对新任务接近 Ridge 的表现。
  • 超过该阈值,变换器可以在上下文中学习根本性的新任务,并在未见任务上优于预训练的贝叶斯估计器。
  • 增加任务维度会使多样性阈值约线性上升,而 PT 的维度误差尺度仍近似 Ridge,随着 D 增大,性能优于 dMMSE。
  • 权重衰减降低多样性阈值,而增加嵌入大小或深度则提高它,表明正则化和容量影响 ICL 的出现。
  • 每个任务的序列增加时,转变会更锐利,暗示在不同任务多样性水平上的学习动力学存在一个算法性的相变。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。