arXiv:2507.23211cs.CL2025-07被引 2

利用负样本提升正样本选择,增强少样本上下文学习效果

Failures Are the Stepping Stones to Success: Enhancing Few-Shot In-Context Learning by Leveraging Negative Samples

  • 用语义相似度从正负样本库中筛选示例
  • 在多个数据集上超越仅用正样本的方法
  • 适合改进少样本学习中的示例选择策略

大语言模型具备强大的少样本上下文学习(ICL)能力,但性能高度依赖提供的示例。现有研究多聚焦于为每个查询检索对应正样本,虽提升了效率与可扩展性,缓解了人工选例的偏差,但忽略了负样本中的潜在信息。本文提出一种新方法,通过负样本优化正样本选择,从而提升少样本ICL表现。首先基于Zero-Shot-CoT构建正负样本库;推理时,分别从正负样本库中选取与查询语义最相似的示例;随后,进一步从正样本库中检索与负样本语义相近的示例,并将其与原选正样本拼接作为ICL示范。实验表明,该方法在多个基准测试中优于仅使用最相似正样本的方法,验证了负样本信息有助于通过更优的正样本选择提升ICL性能。

原文摘要 · Abstract (English)

Large Language Models exhibit powerful few-shot in-context learning (ICL) capabilities, but the performance is highly sensitive to provided examples. Recent research has focused on retrieving corresponding examples for each input query, not only enhancing the efficiency and scalability of the learning process but also mitigating inherent biases in manual example selection. However, these studies have primarily emphasized leveraging Positive samples while overlooking the additional information within Negative samples for contextual learning. We propose a novel method that utilizes Negative samples to better select Positive sample examples, thereby enhancing the performance of few-shot ICL. Initially, we construct Positive and Negative sample corpora based on Zero-Shot-Cot. Then, during inference, we employ a semantic similarity-based approach to select the most similar examples from both the Positive and Negative corpora for a given query. Subsequently, we further retrieve Positive examples from the Positive sample corpus based on semantic similarity to the Negative examples, then concatenating them with the previously selected Positive examples to serve as ICL demonstrations. Experimental results demonstrate that our approach surpasses methods solely relying on the most similar positive examples for context, validating that the additional information in negative samples aids in enhancing ICL performance through improved Positive sample selection.

少样本学习上下文学习负样本

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。