上下文学习的内隐贝叶斯推理解释
An Explanation of In-context Learning as Implicit Bayesian Inference
摘要:
大语言模型(LMs),如GPT-3,具有令人惊讶的上下文学习能力,其中模型仅通过由输入-输出示例组成的提示来学习完成下游任务。LM从这些示例中学习,而无需明确地预先训练学习。因此,目前还不清楚是什么使上下文学习。在本文中,我们研究了如何上下文学习可以出现时,预训练文档具有长程一致性。在这里,LM必须推断潜在的文档级概念,以在预训练期间生成连贯的下一个标记。在测试时,当LM也推断提示中的示例之间的共享潜在概念时,上下文学习发生。我们证明了这种情况发生时,尽管提示和预训练数据之间的分布不匹配的设置中,预训练分布是一个混合的障碍。与用于训练具有上下文学习能力的LM的杂乱大规模数据集相比,我们生成了一个小规模合成数据集(GINC),其中Transformers和LSTM都表现出上下文学习。除了理论之外,GINC的实验还展示了大规模的现实世界现象,包括模型缩放(尽管有相同的预训练损失),对示例顺序的敏感性,以及zero-shot优于Few-Shot上下文学习的实例。
英文摘要:
Large language models (LMs) such as GPT-3 have the surprising ability to do in-context learning, where the model learns to do a downstream task simply by conditioning on a prompt consisting of input-output examples. The LM learns from these examples without being explicitly pretrained to learn. Thus, it is unclear what enables in-context learning. In this paper, we study how in-context learning can emerge when pretraining documents have long-range coherence. Here, the LM must infer a latent document-level concept to generate coherent next tokens during pretraining. At test time, in-context learning occurs when the LM also infers a shared latent concept between examples in a prompt. We prove when this occurs despite a distribution mismatch between prompts and pretraining data in a setting where the pretraining distribution is a mixture of HMMs. In contrast to messy large-scale datasets used to train LMs capable of in-context learning, we generate a small-scale synthetic dataset (GINC) where Transformers and LSTMs both exhibit in-context learning. Beyond the theory, experiments on GINC exhibit large-scale real-world phenomena including improved in-context performance with model scaling (despite the same pretraining loss), sensitivity to example order, and instances where zero-shot is better than few-shot in-context learning.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。