Exploring Imbalanced Annotations for Effective In-Context Learning

04 Sept 2025 (modified: 11 Feb 2026)Submitted to ICLR 2026EveryoneRevisionsBibTeXCC BY 4.0
Keywords: Imbalanced Annotations; In-Context Learning; Demonstration Selection; Large Language Models
TL;DR: The paper understands and mitigates the effect of imbalanced annotations on the performance of in-context learning.
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 imbalanced annotations hurt the ICL performance by degrading the Task Learning ability and cannot be mitigated by varying the demonstration sets, selection methods, calibration methods and rebalancing 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 joint distribution 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\%.
Supplementary Material: zip
Primary Area: generative models
Submission Number: 1961
Loading