We study how in-context learning (ICL) in language models is affected by semantic priors versus input-label mappings. We investigate two setups-ICL with flipped labels and ICL with semantically-unrelated labels-across various model families (GPT-3, InstructGPT, Codex, PaLM, and Flan-PaLM). First, experiments on ICL with flipped labels show that overriding semantic priors is an emergent ability of model scale. While small language models ignore flipped labels presented in-context and thus rely primarily on semantic priors from pretraining, large models can override semantic priors when presented with in-context exemplars that contradict priors, despite the stronger semantic priors that larger models may hold. We next study semantically-unrelated label ICL (SUL-ICL), in which labels are semantically unrelated to their inputs (e.g., foo/bar instead of negative/positive), thereby forcing language models to learn the input-label mappings shown in in-context exemplars in order to perform the task. The ability to do SUL-ICL also emerges primarily with scale, and large-enough language models can even perform linear classification in a SUL-ICL setting. Finally, we evaluate instruction-tuned models and find that instruction tuning strengthens both the use of semantic priors and the capacity to learn input-label mappings, but more of the former.
翻译:我们研究了语言模型中的上下文学习如何受语义先验与输入-标签映射的影响。我们探讨了两种设置——翻转标签的上下文学习与语义无关标签的上下文学习——涵盖多种模型家族(GPT-3、InstructGPT、Codex、PaLM与Flan-PaLM)。首先,翻转标签的上下文学习实验表明,覆盖语义先验是模型规模的新兴能力。小语言模型忽略上下文中呈现的翻转标签,主要依赖预训练中的语义先验;而大模型尽管可能持有更强的语义先验,但当上下文中出现与先验矛盾的示例时,能够覆盖语义先验。接下来我们研究语义无关标签的上下文学习(SUL-ICL),其中标签与输入语义无关(例如使用foo/bar而非negative/positive),从而迫使语言模型学习上下文示例中呈现的输入-标签映射以执行任务。SUL-ICL能力同样主要随规模涌现,足够大的语言模型甚至能在SUL-ICL设置中进行线性分类。最后,我们评估了指令微调模型,发现指令微调既增强了语义先验的利用,也提升了学习输入-标签映射的能力,但前者的增强更为显著。