Large language models (LLMs) are able to solve various tasks with only a few demonstrations utilizing their in-context learning (ICL) abilities. However, LLMs often rely on their pre-trained semantic priors of demonstrations rather than on the input-label relationships to proceed with ICL prediction. In this work, we term this phenomenon as the `Demonstration Shortcut'. While previous works have primarily focused on improving ICL prediction results for predefined tasks, we aim to rectify the Demonstration Shortcut, thereby enabling the LLM to effectively learn new input-label relationships from demonstrations. To achieve this, we introduce In-Context Calibration, a demonstration-aware calibration method. We evaluate the effectiveness of the proposed method in two settings: (1) the Original ICL Task using the standard label space and (2) the Task Learning setting, where the label space is replaced with semantically unrelated tokens. In both settings, In-Context Calibration demonstrates substantial improvements, with results generalized across three LLM families (OPT, GPT, and Llama2) under various configurations.
翻译:大型语言模型(LLMs)能够利用其上下文学习能力,仅通过少量演示解决各类任务。然而,LLMs在进行上下文学习预测时,往往依赖其预训练获得的演示语义先验,而非输入-标签之间的对应关系。本文将此现象定义为"演示捷径"。此前研究主要致力于优化预定义任务的上下文学习预测结果,而本文旨在纠正演示捷径,使LLM能够从演示中有效学习新的输入-标签关系。为此,我们提出上下文校准——一种基于演示感知的校准方法。我们在两种场景下评估该方法的有效性:(1)使用标准标签空间的原始上下文学习任务;(2)使用语义无关标记替代标签空间的任务学习场景。在这两种场景中,上下文校准均展现出显著改进效果,且在三种LLM系列(OPT、GPT和Llama2)的不同配置下均具有泛化能力。