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

重新审视上下文学习中的示例选择策略

Revisiting Demonstration Selection Strategies in In-Context Learning

Beihang University(北京航空航天大学);The University of Sydney(悉尼大学);Harbin Institute of Technology, Shenzhen(哈尔滨工业大学(深圳));Nanyang Technological University(南洋理工大学);The Hong Kong Polytechnic University(香港理工大学)

Keqin Peng, Liang Ding, Yancheng Yuan, Xuebo Liu, Min Zhang, Yuanxin Ouyang, Dacheng Tao

AI总结:

本研究重新审视上下文学习中示例选择的影响因素,提出数据与模型依赖的TopK + ConE选择方法,在多任务多模型规模下实现稳定提升,并为过往方法的有效性提供统一解释。

摘要:

大语言模型(LLM)展现出了利用上下文学习(ICL)执行广泛任务的出色能力,该范式通过少量示例向模型描述任务。然而,ICL的性能会随示例的选择产生显著波动,目前尚不清楚这种波动的成因以及哪些因素会影响示例选择。在本研究中,我们首先从数据和模型两个层面重新审视了导致这种性能差异的因素,发现示例选择同时依赖于数据与模型。基于“示例的性能与其对模型理解测试样本的贡献正相关”这一假设,我们进一步提出了一种同时依赖数据与模型的示例选择方法TopK + ConE,为ICL提供了一种简单有效的方案。实验结果表明,我们的方法在不同模型规模的语言理解和生成任务上均带来了一致的性能提升。进一步分析证实,除了在不同场景下具备通用性和稳定性外,我们的方法还为以往方法的有效性提供了统一的解释。代码将公开发布。

英文摘要:

Large language models (LLMs) have shown an impressive ability to perform a wide range of tasks using in-context learning (ICL), where a few examples are used to describe a task to the model. However, the performance of ICL varies significantly with the choice of demonstrations, and it is still unclear why this happens or what factors will influence its choice. In this work, we first revisit the factors contributing to this variance from both data and model aspects, and find that the choice of demonstration is both data- and model-dependent. We further proposed a data- and model-dependent demonstration selection method, \textbf{TopK + ConE}, based on the assumption that \textit{the performance of a demonstration positively correlates with its contribution to the model's understanding of the test samples}, resulting in a simple and effective recipe for ICL. Empirically, our method yields consistent improvements in both language understanding and generation tasks with different model scales. Further analyses confirm that, besides the generality and stability under different circumstances, our method provides a unified explanation for the effectiveness of previous methods. Code will be released.

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

↑