Abstract
Few shot in-context learning (ICL) typically assumes access to large annotated training sets. However, in many real world scenarios, such as domain adaptation, there is only a limited budget to annotate a small number of samples, with the goal of maximizing downstream performance. We study various methods for selecting samples to annotate within a predefined budget, focusing on token classification tasks, which are expensive to annotate and are relatively less studied in ICL setups. Across various tasks, models, and datasets, we observe that no method significantly outperforms the others, with most yielding similar results, including random sample selection for annotation. Moreover, we demonstrate that a relatively small annotated sample pool can achieve performance comparable to using the entire training set. We hope that future work adopts our realistic paradigm which takes annotation budget into account.
Introduction
In-Context Learning (ICL) has emerged as a dominant paradigm for leveraging Large Language Models (LLMs), where a few demonstration examples are provided in the prompt to guide the model's behavior. However, existing research often operates under an "Oracle" assumption, presuming the existence of massive labeled datasets (e.g., 10,000+ samples) from which to draw these demonstrations.
In practical applications, such as adapting models to specialized medical or legal domains, practitioners often face a "cold start" problem: they possess abundant raw text but lack the budget to annotate more than a few hundred samples. This paper investigates the Pool Selection problem: given a fixed annotation budget $k$, which samples should be selected from an unlabeled corpus to create the most effective demonstration pool for ICL? This study specifically targets token classification tasks like Named Entity Recognition (NER), which are particularly resource-intensive to annotate.
The Pool Selection Framework
The authors propose a four-step framework to model realistic ICL scenarios under budget constraints:
- Unlabeled Pool: Start with a large corpus of domain-specific raw text.
- Pool Selection: Apply a strategy to select $k$ representative samples for annotation.
- Annotation: Obtain gold-standard labels for the selected $k$ samples.
- Inference: For a new query, retrieve the most relevant examples from this small labeled pool (e.g., using k-Nearest Neighbors) to construct the few-shot prompt.
Four selection strategies were evaluated:
- Random: A simple baseline of picking samples uniformly at random.
- Central: Selecting samples closest to the centroid of the unlabeled set in embedding space.
- Cluster: Using K-means to identify $k$ clusters and selecting the representative center of each to ensure distributional coverage.
- Vote-k: A sophisticated method selecting samples based on diversity and model confidence.
Experimental Setup
The study evaluated these strategies across three token-level tasks: Named Entity Recognition (NER) using Ontonotes 5.0, and Part-of-Speech (POS) tagging and Dependency Parsing using Universal Dependencies (UD). Experiments involved frontier models (GPT-4, Claude 3 Haiku, Gemini 1.5 Pro) and open-weight models (Llama-2, Mistral).
Results and Discussion
The core finding of the study is that complex selection strategies rarely outperform simple random selection. As shown in the performance plots, the "Random" baseline consistently performs on par with more computationally expensive methods like "Cluster" or "Vote-k."
The Efficiency of Small Pools
A significant discovery is the "200-sample sweet spot." For NER on Ontonotes, a pool of just 220 labeled samples allowed models to achieve over 88% of the performance possible with the full training set. For POS tagging, the gap is even smaller; with only 138 samples, models reached 96% of state-of-the-art performance, suggesting that POS tagging is largely "solved" by ICL even on a tight budget.
Factors Influencing Performance
- Label Diversity: Performance correlates strongly with the entropy (diversity) of labels in the selected pool. Pools that cover a wider variety of entity types or grammatical structures lead to better ICL outcomes.
- Model Scale: While frontier models handle complex token classification formatting well, smaller models (under 10B parameters) often struggle with instruction following in these structured tasks.
- Task Complexity: While ICL is efficient for NER and POS tagging, a significant performance gap remains for complex tasks like Dependency Parsing compared to full fine-tuning.
Conclusion
This research demonstrates that for token classification, a small, randomly selected pool of annotated data is often sufficient for effective In-Context Learning. This finding simplifies the practical application of LLMs in low-resource domains, suggesting that practitioners can focus more on the quality of a small number of annotations rather than complex selection algorithms. Future work will explore if these trends hold in multilingual settings and for other types of NLP tasks.
Summary updated