arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.15115cs.LGcs.CLstat.ML
收藏

从上下文不确定性量化角度深入理解上下文学习能力

Towards Better Understanding of In-Context Learning Ability from In-Context Uncertainty Quantification

Imperial College Business School, Imperial College London(伦敦帝国学院商学院);University of North Carolina at Chapel Hill(北卡罗来纳大学教堂山分校)

Shang Liu, Zhongze Cai, Guanting Chen, Xiaocheng Li

AI总结:

本文通过双目标预测(条件期望与方差)研究Transformer的上下文学习,证明其接近贝叶斯最优,但任务偏移时并非贝叶斯推断,并给出更紧的泛化界。

摘要:

预测简单函数类已被广泛用作研究训练后Transformer的上下文学习(ICL)能力的理论和理解测试平台。本文重新审视了Transformer在线性回归任务上的训练,与现有文献不同,我们考虑一个双目标预测任务:同时预测条件期望$\mathbb{E}[Y|X]$和条件方差Var$(Y|X)$。这一额外的量化不确定性目标提供了手段,以(i)更好地设计分布外实验来区分上下文学习(ICL)与权重内学习(IWL),以及(ii)更好地分离使用与不使用训练分布先验信息的算法。理论上,我们证明训练后的Transformer达到接近贝叶斯最优,表明其使用了训练分布的信息。我们的方法可扩展到其他情况。具体而言,在Transformer的上下文窗口$S$下,我们证明了在$n$个任务上、序列长度为$T$的泛化界为$\tilde{\mathcal{O}}(\sqrt{\min\{S, T\}/(n T)})$,与之前的$\tilde{\mathcal{O}}(\sqrt{1/n})$结果相比,提供了更精细的分析。实验上,我们表明,虽然训练后的Transformer作为分布内监督训练的自然结果表现出贝叶斯最优行为,但在面对任务转移时,它并不一定执行贝叶斯推断,这与许多现有文献中提出的两者之间的\textit{等价性}相反。我们还展示了训练后的Transformer在协变量偏移和提示长度偏移下的ICL能力,并将其解释为对元分布的泛化。

英文摘要:

Predicting simple function classes has been widely used as a testbed for developing theory and understanding of the trained Transformer's in-context learning (ICL) ability. In this paper, we revisit the training of Transformers on linear regression tasks, and different from all the existing literature, we consider a bi-objective prediction task of predicting both the conditional expectation $\mathbb{E}[Y|X]$ and the conditional variance Var$(Y|X)$. This additional uncertainty quantification objective provides a handle to (i) better design out-of-distribution experiments to distinguish ICL from in-weight learning (IWL) and (ii) make a better separation between the algorithms with and without using the prior information of the training distribution. Theoretically, we show that the trained Transformer reaches near Bayes-optimum, suggesting the usage of the information of the training distribution. Our method can be extended to other cases. Specifically, with the Transformer's context window $S$, we prove a generalization bound of $\tilde{\mathcal{O}}(\sqrt{\min\{S, T\}/(n T)})$ on $n$ tasks with sequences of length $T$, providing sharper analysis compared to previous results of $\tilde{\mathcal{O}}(\sqrt{1/n})$. Empirically, we illustrate that while the trained Transformer behaves as the Bayes-optimal solution as a natural consequence of supervised training in distribution, it does not necessarily perform a Bayesian inference when facing task shifts, in contrast to the \textit{equivalence} between these two proposed in many existing literature. We also demonstrate the trained Transformer's ICL ability over covariates shift and prompt-length shift and interpret them as a generalization over a meta distribution.

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

↑