并非所有演示示例都同等有益:为上下文学习中的演示示例重新加权
Not All Demonstration Examples are Equally Beneficial: Reweighting Demonstration Examples for In-Context Learning
AI总结:
本文针对上下文学习(ICL)中演示示例质量不均的问题,提出基于掩码自预测得分和束搜索的示例加权方法,在8个文本分类任务上显著提升ICL性能。
摘要:
大型语言模型(LLMs)随着模型规模的扩大,近期获得了上下文学习(ICL)能力,使其能够仅通过在输入序列中前置少量演示示例,快速适应下游任务。然而,当前的ICL实践将所有演示示例同等对待,这仍有改进空间,因为示例的质量通常参差不齐。在本文中,我们研究了如何确定演示示例的近似最优权重,以及如何在ICL过程中应用这些权重。在没有额外验证数据的情况下,为了评估权重的质量,我们设计了一种掩码自预测(MSP)得分,该得分与最终的ICL性能表现出很强的相关性。为了加速权重搜索过程,我们将连续的权重空间离散化,并采用束搜索。在获得近似最优权重后,我们进一步提出了两种策略,将其应用于模型中不同位置的演示示例。在8个文本分类任务上的实验结果表明,我们的方法大幅优于传统的ICL。我们的代码公开于https://github.com/Zhe-Young/WICL。
英文摘要:
Large Language Models (LLMs) have recently gained the In-Context Learning (ICL) ability with the models scaling up, allowing them to quickly adapt to downstream tasks with only a few demonstration examples prepended in the input sequence. Nonetheless, the current practice of ICL treats all demonstration examples equally, which still warrants improvement, as the quality of examples is usually uneven. In this paper, we investigate how to determine approximately optimal weights for demonstration examples and how to apply them during ICL. To assess the quality of weights in the absence of additional validation data, we design a masked self-prediction (MSP) score that exhibits a strong correlation with the final ICL performance. To expedite the weight-searching process, we discretize the continuous weight space and adopt beam search. With approximately optimal weights obtained, we further propose two strategies to apply them to demonstrations at different model positions. Experimental results on 8 text classification tasks show that our approach outperforms conventional ICL by a large margin. Our code are publicly available at https:github.com/Zhe-Young/WICL.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。