arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2306.04891cs.LGcs.CL
收藏

透过贝叶斯视角看上下文学习

In-Context Learning through the Bayesian Prism

Microsoft Research India(微软研究院印度分院);University of Washington(华盛顿大学)

Madhur Panwar, Kabir Ahuja, Navin Goyal

AI总结:

本研究从贝叶斯视角探究大模型上下文学习机制,提出分层元ICL设置,验证高容量Transformer在可推断场景下模拟贝叶斯预测器,同时发现其能泛化到预训练未见函数族并分析偏差。

摘要:

上下文学习(ICL)是大语言模型最令人惊讶且实用的特性之一,也是当前的研究热点。近期,研究者设计了风格化的、类似元学习的ICL实验设置,在输入-输出对序列$(x, f(x))$上训练Transformer模型。其中函数$f$取自某个函数族,泛化能力通过评估模型在同一函数族中未见过的函数生成的序列上的表现来检验。该研究方向的核心发现之一是,对于线性回归等多个函数族,Transformer能够成功泛化到该族中的新函数。然而,导致这一行为的模型归纳偏置尚未被清晰理解。拥有无限训练数据与计算资源的模型本质上是一个贝叶斯预测器:它会学习预训练分布。本文通过实证研究检验了这一贝叶斯视角对理解ICL的帮助程度。为此,我们将此前的元ICL设置推广到涉及多个任务族并集的分层元ICL设置。我们在一系列多样的线性和非线性函数族上实现了该设置,发现Transformer在这种场景下也能完成ICL。在贝叶斯推断可处理的场景中,我们找到了高容量Transformer会模拟贝叶斯预测器的证据。贝叶斯视角为理解ICL的归纳偏置,以及Transformer在多任务上训练时如何执行特定任务提供了洞见。我们还发现,Transformer能够学会泛化到预训练期间未见过的新函数族,这一行为偏离了贝叶斯预测器的特性。我们对这些偏差进行了更深入的研究,提出了新的见解与假设。

英文摘要:

In-context learning (ICL) is one of the surprising and useful features of large language models and subject of intense research. Recently, stylized meta-learning-like ICL setups have been devised that train transformers on sequences of input-output pairs $(x, f(x))$. The function $f$ comes from a function class and generalization is checked by evaluating on sequences generated from unseen functions from the same class. One of the main discoveries in this line of research has been that for several function classes, such as linear regression, transformers successfully generalize to new functions in the class. However, the inductive biases of these models resulting in this behavior are not clearly understood. A model with unlimited training data and compute is a Bayesian predictor: it learns the pretraining distribution. In this paper we empirically examine how far this Bayesian perspective can help us understand ICL. To this end, we generalize the previous meta-ICL setup to hierarchical meta-ICL setup which involve unions of multiple task families. We instantiate this setup on a diverse range of linear and nonlinear function families and find that transformers can do ICL in this setting as well. Where Bayesian inference is tractable, we find evidence that high-capacity transformers mimic the Bayesian predictor. The Bayesian perspective provides insights into the inductive bias of ICL and how transformers perform a particular task when they are trained on multiple tasks. We also find that transformers can learn to generalize to new function classes that were not seen during pretraining. This involves deviation from the Bayesian predictor. We examine these deviations in more depth offering new insights and hypotheses.

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

↑