Misconfidence-based Demonstration Selection for LLM In-Context Learning

Shangqing Xu, Chao ZhangarXiv 2024 · DOI

Abstract

In-Context Learning (ICL) allows Large Language Models (LLMs) to perform new tasks via few-shot demonstrations, yet performance is highly sensitive to example selection. This paper introduces In-Context Reflection (ICR), a method that selects demonstrations by identifying "misconfidence"—instances where the model is most confidently incorrect. By iteratively refining prompts with these challenging examples, ICR bridges the gap between model knowledge and task requirements, achieving an average 4% performance boost across diverse benchmarks.

Introduction

The effectiveness of In-Context Learning (ICL) is well-documented, yet the process of selecting optimal demonstrations is often treated as a heuristic or computationally expensive search. Traditional methods rely on semantic similarity (e.g., KATE) or exhaustive influence analysis. While similarity-based methods are efficient, they often select redundant examples that the model already understands. Conversely, influence analysis is too slow for practical, large-scale deployment.

Researchers from Georgia Tech address this gap with In-Context Reflection (ICR). The core hypothesis is that the most valuable demonstrations are those that challenge the model's current internal logic. By focusing on "misconfidence," ICR selects examples that highlight the model's errors, providing a more effective "correction" than simple similarity-based retrieval.

Methodology: In-Context Reflection

The ICR pipeline is designed to be both model-aware and computationally efficient. It centers on a new metric called misconfidence ($\psi$).

The Misconfidence Metric

Misconfidence measures not just whether a model is incorrect, but the degree of its error. It is defined as the ratio of the probability assigned to the most likely incorrect label versus the probability assigned to the ground-truth label: $$\psi = \frac{\max_{y \neq y_{true}} P(y|x)}{P(y_{true}|x)}$$ A high $\psi$ indicates that the model is strongly biased toward an incorrect prediction, signaling a significant knowledge discrepancy.

The ICR Pipeline

The selection process follows an iterative refinement strategy:

  1. Initialization: A small set of random demonstrations is used to create an initial prompt.
  2. Scoring: The LLM evaluates a larger pool of candidate examples using the current prompt. Misconfidence scores are calculated for each candidate.
  3. Refinement: Candidates with the highest misconfidence scores are selected to replace the least informative examples in the prompt.
  4. Iteration: The process can be repeated to further tune the prompt, though a single iteration often provides the most stable gains.
The In-Context Reflection (ICR) pipeline: from candidate scoring via misconfidence to prompt refinement.

Experimental Setup

The authors evaluated ICR across 13 subtasks spanning five major datasets:

  • GLUE: MRPC, WNLI, COLA, and RTE.
  • Ethos: Various categories of hate speech detection.
  • TweetEval: Sentiment, emotion, and irony detection.
  • HateSpeech18: Binary classification.
  • Poem Sentiment: Multi-class sentiment analysis.

Results and Discussion

ICR demonstrated superior performance across nearly all benchmarks, achieving an average 4% boost in Macro-F1 and Accuracy compared to state-of-the-art baselines like KATE and AMBIG.

Key Insights

  • Independence from Semantics: Misconfidence is largely decoupled from semantic distance. A model can be confidently wrong about an example even if it is semantically distant from the current prompt, suggesting that ICR captures task logic that similarity-based retrievers miss.
  • Cross-Task Generalization: One of the most significant findings is the robustness of ICR-selected prompts across related tasks. A prompt optimized for one task often performs well on others within the same family.
Heatmap showing the performance gain of ICR-selected prompts when transferred across different training and testing tasks.
  • Label Distribution: The study found that maintaining the natural label distribution is crucial. Replacing the entire prompt with misconfident examples can skew the model's output, whereas partial replacement preserves balance while injecting necessary corrections.

Conclusion and Future Work

In-Context Reflection provides a robust, efficient framework for demonstration selection by targeting the model's specific weaknesses. While highly effective, the authors noted that multi-iteration runs can sometimes lead to performance fluctuations, suggesting a need for more granular update strategies. Future research will explore combining misconfidence with other metrics like uncertainty and diversity to further enhance the reliability of ICL.

Summary updated

BibTeX
@misc{xu2024misconfidence,
  author = {Shangqing Xu and Chao Zhang},
  title = {{Misconfidence-based Demonstration Selection for LLM In-Context Learning}},
  year = {2024},
  eprint = {2401.06301},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.06301},
}
Figure