Abstract
Standard In-Context Learning (ICL) typically selects demonstrations based on semantic similarity to the input. However, this approach often ignores the model's internal uncertainty regarding specific label boundaries. This paper introduces AMBIG-ICL, a novel strategy that selects examples targeting the labels the model is most confused about. By incorporating "hard" examples—specifically those the model previously misclassified—the authors achieve significant performance improvements across complex, fine-grained classification tasks.
Introduction
In-context learning (ICL) has emerged as a powerful paradigm for leveraging Large Language Models (LLMs) without the need for expensive fine-tuning. Despite its success, LLMs remain highly sensitive to the specific demonstrations provided in a prompt. Current state-of-the-art methods rely on semantic retrieval, finding training examples that are textually similar to the test input.
While logical, semantic retrieval fails to address model uncertainty. For instance, if a model struggles to distinguish between "Negative" and "Very Negative" sentiment, a semantically similar "Neutral" example provides little guidance for resolving that specific ambiguity. This research proposes moving beyond simple text matching toward an "ambiguity-aware" selection process that clarifies the model's internal decision boundaries.
Methods: The AMBIG-ICL Framework
The authors propose a three-step strategy called AMBIG-ICL to refine demonstration selection:
- Semantic Retrieval: Initially, the top-$k$ most similar examples are retrieved from the training set using standard methods.
- Identify the Ambiguous Label Set: The test input is processed by the LLM in a zero-shot setting to identify the two labels with the highest probability. These represent the model's primary source of confusion (e.g., Joy vs. Love).
- Constraint-Based Selection: The retrieved pool is filtered using three increasingly strict constraints to find the most informative demonstrations:
- +GOLD: Select examples where the ground-truth label is within the ambiguous label set.
- +MIS: Narrow the selection to examples the model previously misclassified.
- +PRED: Ensure the model’s incorrect prediction for that example also falls within the ambiguous label set.
Experimental Setup
The study evaluates AMBIG-ICL on three multi-class text classification tasks where fine-grained nuances often lead to label confusion:
- SST (Stanford Sentiment Treebank): 5-way sentiment classification.
- GoEmotions: 27 fine-grained emotional categories.
- EDOS (Explainable Detection of Online Sexism): 4-way topic classification for sexist content.
Results and Key Insights
Experimental results demonstrate that AMBIG-ICL consistently outperforms standard retriever-based baselines. The most significant gains were observed when using the full suite of constraints (+GOLD+MIS+PRED), resulting in an average improvement of +2.6% in F1 macro scores across all datasets.
Key Findings:
- The Advantage of "Hard" Examples: Showing the model examples it previously failed on effectively "forces" it to resolve ambiguity at its decision boundaries, leading to better generalization on new inputs.
- Label Space vs. Semantic Space: Clarifying label boundaries is often more beneficial than finding a perfect semantic match. Even if a demonstration is slightly less similar in text, its utility in defining a label boundary is paramount.
- Model Scale Sensitivity: Smaller models (Flan-PaLM 2 M) showed a more substantial performance boost (+3.9%) compared to larger models (Flan-PaLM 2 L, +1.4%). This suggests that models with higher inherent uncertainty benefit more from targeted guidance.
- Entropy Reduction: Analysis of prediction entropy confirmed that AMBIG-ICL explicitly reduces model uncertainty, resulting in more confident and accurate predictions.
Conclusion and Future Work
AMBIG-ICL demonstrates that addressing model confusion directly is a highly effective strategy for improving ICL. However, the method introduces some computational overhead due to the required initial zero-shot pass. Future research may explore expanding the ambiguous label set beyond the top-2 candidates for massive label spaces like GoEmotions, or applying these techniques to token-level tasks such as Named Entity Recognition (NER).
Summary updated