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.
翻译:我们研究了语言模型中上下文学习(ICL)如何受到语义先验与输入-标签映射关系的影响。通过在不同模型系列(GPT-3、InstructGPT、Codex、PaLM 和 Flan-PaLM)中设置两类实验——标签反转的ICL和语义无关标签的ICL,我们展开探究。首先,基于反转标签的ICL实验表明,覆盖语义先验是模型规模涌现出的能力:小型语言模型会忽略上下文中的反转标签,主要依赖预训练获得的语义先验;而大型模型即使本身可能具备更强的语义先验,也能在上下文示例与先验矛盾时覆盖这些先验。随后我们对语义无关标签的ICL(SUL-ICL)展开研究——此类任务中标签与输入无语义关联(如用foo/bar替代negative/positive),迫使语言模型通过学习上下文中的输入-标签映射来完成任务。实验发现,SUL-ICL能力同样主要随模型规模涌现,足够大的语言模型甚至能在SUL-ICL场景下完成线性分类任务。最后,我们评估了指令微调模型,发现指令微调既强化了语义先验的运用能力,也增强了输入-标签映射的学习能力,但前者增强幅度更为显著。