Title: Exploring Imbalanced Annotations for Effective In-Context Learning
Primary area: generative models
Keywords: Imbalanced Annotations; In-Context Learning; Demonstration Selection; Large Language Models

Abstract: Large language models (LLMs) have shown impressive performance on downstream tasks through in-context learning (ICL), which heavily relies on the quality of demonstrations selected from a large annotated dataset. However, real-world datasets often exhibit long-tailed class distributions, where a few classes occupy most of the data while most classes are under-represented. In this work, we show that class imbalance in annotated datasets significantly degrades the ICL performance across various tasks and cannot be mitigated by varying the demonstration sets, selection methods, or calibration methods. To circumvent the issue, we propose a simple and effective approach termed Reweighting with Importance Factors (dubbed RIF) to enhance ICL performance under class imbalance. In particular, RIF constructs a balanced subset to estimate importance factors for each class: the ratio between the class distributions of demonstration sets selected from balanced and imbalanced datasets. Then, we leverage the factors to re-weight the scoring function (e.g., the cosine similarity score used in TopK) during demonstration selection. In effect, RIF prevents over-selection from dominant classes while preserving the efficacy of current selection methods. Extensive experiments on common benchmarks demonstrate the effectiveness of our method, improving the average accuracy of current selection methods by up to 5.60\%.

TL;DR: The paper understands and mitigates the effect of imbalanced annotations on the performance of in-context learning.