Rectifying Demonstration Shortcut in In-Context Learning
Joonwon Jang, Sanghwan Jang, Wonbin Kweon, Minjin Jeon, Hwanjo Yu
TL;DR
The paper identifies a Demonstration Shortcut in in-context learning, where LLMs rely on pre-trained semantic priors in demonstrations rather than learning new input–label mappings. It introduces In-Context Calibration (ICC), a demonstration-aware calibration method that estimates per-sample semantic priors from in-context examples and from shuffled word representations, then uses these priors to rectify predictions. Across 27 classification datasets and three model families (GPT, OPT, Llama2), ICC consistently improves both Original ICL Task performance and Task Learning (where labels are semantically unrelated or symbolized), with notable gains in challenging NLI tasks and large-scale models. The approach remains effective after instruction tuning and scales to models above 50B, suggesting broad applicability for enabling LLMs to learn new mappings from demonstrations. Overall, ICC provides a practical, demonstration-level calibration technique to mitigate semantic priors and enhance task learning in diverse LLM settings.
Abstract
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.
