揭示基于学习的上下文学习示例选择机制
Unraveling the Mechanics of Learning-Based Demonstration Selection for In-Context Learning
AI总结:
分析了基于学习的上下文学习示例选择机制,发现整合任务无关文本相似性可提升泛化能力,结合任务特定标签可提升任务表现,并据此提出两种简化方法以消除高昂的LLM推理开销。
摘要:
大型语言模型(LLMs)已经从少样本示例中展示了令人印象深刻的上下文学习(ICL)能力。虽然最近基于学习的示例选择方法通过选择更有用的示例被证明对ICL是有益的,但其底层机制是不透明的,这阻碍了人们解决诸如高训练成本和跨任务泛化能力差等局限性。这些方法通常假设选择过程捕获了示例和目标实例之间的相似性,然而,目前尚不清楚捕获了哪些类型的相似性以及哪些相似性对执行ICL至关重要。为了深入研究这个问题,我们分析了基于学习的示例选择方法的工作机制,并凭经验识别出与相似性测量相关的两个重要因素:1)整合示例输入与测试用例之间不同层级的任务无关文本相似性的能力,能够增强跨不同任务的泛化能力。2)在测量相似性时结合特定任务标签,能显著提升在每个特定任务上的表现。我们通过在十个数据集和各种LLMs上的广泛定量和定性分析验证了这两个发现。基于我们的发现,我们引入了两种有效但简化的示例选择方法,以满足任务无关和任务特定的需求,从而消除了高昂的LLM推理开销。
英文摘要:
Large Language Models (LLMs) have demonstrated impressive in-context learning (ICL) capabilities from few-shot demonstration exemplars. While recent learning-based demonstration selection methods have proven beneficial to ICL by choosing more useful exemplars, their underlying mechanisms are opaque, hindering efforts to address limitations such as high training costs and poor generalization across tasks. These methods generally assume the selection process captures similarities between the exemplar and the target instance, however, it remains unknown what kinds of similarities are captured and vital to performing ICL. To dive into this question, we analyze the working mechanisms of the learning-based demonstration selection methods and empirically identify two important factors related to similarity measurement: 1) The ability to integrate different levels of task-agnostic text similarities between the input of exemplars and test cases enhances generalization power across different tasks. 2) Incorporating task-specific labels when measuring the similarities significantly improves the performance on each specific task. We validate these two findings through extensive quantitative and qualitative analyses across ten datasets and various LLMs. Based on our findings, we introduce two effective yet simplified exemplar selection methods catering to task-agnostic and task-specific demands, eliminating the costly LLM inference overhead.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。