arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.23211cs.CL
收藏

失败是成功之垫脚石:利用负样本增强少样本上下文学习

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

Chengdu Institute of Computer Applications, Chinese Academy of Sciences(中国科学院成都计算机应用研究所);University of Chinese Academy of Sciences(中国科学院大学);Institute of Multidisciplinary Research for Advanced Materials (IMRAM), Tohoku University(东北大学多学科先进材料研究所)

Yunhao Liang, Ruixuan Ying, Takuya Taniguchi, Zhe Cui

AI总结:

该研究针对少样本上下文学习对示例敏感且现有研究忽视负样本信息的问题,提出基于Zero-Shot-Cot构建正负语料、结合负样本语义相似度筛选正样本的方法,有效提升了ICL性能。

摘要:

大语言模型展现出强大的少样本上下文学习(ICL)能力,但其性能对所提供的示例高度敏感。近期研究聚焦于为每个输入查询检索对应示例,这不仅提升了学习过程的效率与可扩展性,还缓解了人工示例选择中的固有偏差。然而,这些研究主要强调利用正样本,却忽视了负样本中可供上下文学习使用的额外信息。我们提出一种利用负样本更好地筛选正样本示例的新方法,以此提升少样本ICL的性能。首先,我们基于Zero-Shot-Cot(零样本思维链)构建正负样本语料库。随后在推理阶段,我们采用基于语义相似度的方法,从正负样本语料库中为给定查询选取最相似的示例。接着,我们依据与负样本示例的语义相似度,从正样本语料库中进一步检索正样本示例,再将其与此前选出的正样本示例拼接,作为ICL的演示示例。实验结果表明,我们的方法优于仅依赖最相似正样本构建上下文的方法,验证了负样本中的额外信息可通过优化正样本选择来助力提升ICL性能。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑