In-Context Learning with Noisy Labels

Junyong Kang, Donghyun Son, Hwanjun Song, Buru ChangarXiv 2024 · DOI

Abstract

Large Language Models (LLMs) demonstrate remarkable capabilities in In-Context Learning (ICL), where they perform tasks based on a few provided examples. However, this paradigm assumes high-quality, correctly labeled demonstrations. This paper explores the impact of label noise on ICL, finding that performance is both fragile and unstable under such conditions. We introduce a "rectification" method that leverages a small clean dataset to fine-tune a model capable of correcting noisy labels within a prompt sequence. Our results indicate that rectification significantly enhances accuracy and reduces performance variance across diverse text classification tasks, even at high noise rates.

Introduction

In-context learning has become a cornerstone of LLM utility, enabling rapid task adaptation without parameter updates. Despite its success, ICL's reliance on the accuracy of prompt demonstrations is a significant vulnerability. Real-world data, particularly in subjective domains like hate speech detection, frequently contains mislabeled examples due to annotator error or ambiguity. This study formalizes the problem of In-Context Learning with Noisy Labels (ICL-NL) and proposes a robust solution to mitigate the resulting performance degradation.

Methodology

The authors evaluate several strategies to handle noisy labels. Traditional baseline methods often rely on an external classifier (e.g., BERT) to perform point-wise operations, such as overwriting labels with predictions (Correction), adding confidence tags (Weighting), or reordering examples to exploit recency bias.

In contrast, the proposed Rectification method treats the prompt demonstrations as a holistic sequence. By fine-tuning a generative model (such as GPT-2 Large) using Low-Rank Adaptation (LoRA), the system learns to output a corrected sequence of labels for a given set of noisy inputs. This approach allows the model to utilize the collective context of the demonstrations to identify and fix outliers that deviate from the learned task pattern.

The rectification process (top) and its impact on performance across different noise levels for MRPC and Tweet datasets (bottom).

Experimental Setup

The study utilizes three diverse datasets: MRPC (paraphrase detection), SST-5 (sentiment analysis), and Tweet (hate speech detection). Noise is simulated by flipping labels at rates ranging from 10% to 50%. The authors assume access to a small "clean" subset (10% of the original data) to train the rectification model, arguing that this is a low-cost prerequisite for most real-world applications.

Results and Analysis

The experiments reveal that standard ICL is highly sensitive to noise. Without intervention, accuracy drops precipitously as the noise rate increases. For instance, on the SST-5 dataset using GPT2-Neo, accuracy plummeted from ~47% to ~32% when half the labels were noisy.

As illustrated in Figure 4, the Rectification method consistently maintains higher accuracy than "no manipulation" or baseline methods across different inference models like Llama2-7B and Mistral-7B. Even at a 50% noise rate, the Rectification method allowed Llama2-7B to maintain ~75% accuracy on MRPC, whereas the uncorrected version dropped to ~62%.

The input-output format used for the rectification model to produce corrected label sequences from noisy demonstrations.

Beyond raw accuracy, the Rectification method significantly improves stability. Noisy labels typically lead to high variance in model output depending on which specific examples are chosen; rectification narrows this variance, making LLM behavior more predictable and reliable.

Conclusion

Label noise is a significant hurdle for reliable in-context learning. This research demonstrates that a sequence-based rectification approach can effectively "clean" prompts, restoring performance and stability to LLMs. The method is data-efficient, requiring only a small clean sample to achieve significant gains. Future work may extend this to more complex generative tasks and explore how the architecture of the rectifier model impacts final inference performance.

Summary updated

BibTeX
@misc{kang2024context,
  author = {Junyong Kang and Donghyun Son and Hwanjun Song and Buru Chang},
  title = {{In-Context Learning with Noisy Labels}},
  year = {2024},
  eprint = {2411.19581},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.19581},
}
Figure