Revisiting In-Context Learning with Long Context Language Models
Jinheon Baek, Sun Jae Lee, Prakhar Gupta, Geunseob Oh, Siddharth Dalmia, Prateek Kolhar
TL;DR
This work re-evaluates In-Context Learning when using Long-Context Language Models that can handle millions of tokens in a single prompt. It systematically compares traditional sample-selection strategies (relevance, diversity, curriculum, hard) against a simple random baseline across 18 datasets and multiple LCLMs, finding that sophisticated selection offers little to no advantage in many-shot scenarios. To address underutilization of extended context when data are scarce, the authors propose a data augmentation approach that generates and filters synthetic demonstrations, significantly boosting performance while preserving efficiency through caching. Additional analyses reveal that excessively long contexts can harm performance, robustness to noise is task-dependent, and the main practical takeaway is a shift from sample selection toward maximizing context usage and data diversity in the extended-context ICL regime.
Abstract
In-Context Learning (ICL) is a technique by which language models make predictions based on examples provided in their input context. Previously, their context window size imposed a limit on the number of examples that can be shown, making example selection techniques crucial for identifying the maximally effective set of examples. However, the recent advent of Long Context Language Models (LCLMs) has significantly increased the number of examples that can be included in context, raising an important question of whether ICL performance in a many-shot regime is still sensitive to the method of sample selection. To answer this, we revisit these approaches in the context of LCLMs through extensive experiments on 18 datasets spanning 4 tasks. Surprisingly, we observe that sophisticated example selection techniques do not yield significant improvements over a simple random sample selection method. Instead, we discover that the advent of LCLMs has fundamentally shifted the challenge of ICL from that of selecting the most effective examples to that of collecting sufficient examples to fill the context window. Specifically, in certain datasets, including all available examples does not fully utilize the context window; however, by augmenting the examples in context with a simple data augmentation approach, we substantially improve ICL performance by 5%.
