上下文学习(In-context learning, ICL)是自然语言处理(natural language processing, NLP)领域的一种新范式,大语言模型(large language model, LLM)将少量演示样本和一个测试实例作为输入,无需更新模型参数即可直接做出预测。已有研究表明,ICL对演示样本的选择和排序十分敏感。但由于学界普遍认为演示样本数量与模型性能呈正相关,鲜有研究探讨在LLM有限输入长度范围内,演示样本数量对ICL性能的影响。本文发现这一结论并不总是成立。通过预实验我们发现,增加演示样本数量并不一定能提升性能。基于这一洞见,我们提出动态演示控制器(Dynamic Demonstrations Controller, D$^2$Controller),该控制器可通过动态调整演示样本数量来提升ICL性能。实验结果显示,在10个数据集上,D$^2$Controller在10种不同规模的LLM上取得了4.6%的相对提升。此外,我们还将该方法扩展到已有的ICL模型上,取得了具有竞争力的结果。
英文摘要:
In-context learning (ICL) is a new paradigm for natural language processing (NLP), where a large language model (LLM) observes a small number of demonstrations and a test instance as its input, and directly makes predictions without updating model parameters. Previous studies have revealed that ICL is sensitive to the selection and the ordering of demonstrations. However, there are few studies regarding the impact of the demonstration number on the ICL performance within a limited input length of LLM, because it is commonly believed that the number of demonstrations is positively correlated with model performance. In this paper, we found this conclusion does not always hold true. Through pilot experiments, we discover that increasing the number of demonstrations does not necessarily lead to improved performance. Building upon this insight, we propose a Dynamic Demonstrations Controller (D$^2$Controller), which can improve the ICL performance by adjusting the number of demonstrations dynamically. The experimental results show that D$^2$Controller yields a 4.6% relative improvement on ten different sizes of LLMs across ten datasets. Moreover, we also extend our method to previous ICL models and achieve competitive results.
The Impact of Demonstrations on Multilingual In-Context Learning: A Multidimensional Analysis
Saarland University(萨尔大学);Bosch Center for AI(博世人工智能中心);LMU Munich(慕尼黑大学);Munich Center for Machine Learning (MCML)(慕尼黑机器学习中心);Eastern Institute of Technology(东方理工学院);Mila(米拉研究所);McGill University(麦吉尔大学)
DETAIL: Task DEmonsTration Attribution for Interpretable In-context Learning
National University of Singapore(新加坡国立大学);Singapore-MIT Alliance for Research and Technology(新加坡-麻省理工学院研究与技术联盟);Institute for Infocomm Research, A*STAR(新加坡科技研究局信息通信研究所);CSAIL, MIT(麻省理工学院计算机科学与人工智能实验室)
DemoShapley: Valuation of Demonstrations for In-Context Learning
Department of Mathematics and Computer Science(数学与计算机科学系);Eindhoven University of Technology(埃因霍温理工大学);Intel Lab(英特尔实验室);Department of Psychology(心理学系);University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Department of Data Science(数据科学系);New Jersey Institute of Technology(新泽西理工学院);Department of Computer Science(计算机科学系);University of Illinois Chicago(伊利诺伊大学芝加哥分校)
Learning to Select In-Context Demonstration Preferred by Large Language Model
School of Information Science and Technology, ShanghaiTech University(上海科技大学信息科学与技术学院);Microsoft Research Asia(微软亚洲研究院);State Key Laboratory of General Artificial Intelligence, BIGAI, Beijing, China(一般人工智能国家重点实验室)
Demonstration Augmentation for Zero-shot In-context Learning
School of Computer Science and Technology, Soochow University(苏州大学计算机科学与技术学院);Department of Computer Science and Technology, Tsinghua University(清华大学计算机科学与技术系)
ICL-D3IE: In-Context Learning with Diverse Demonstrations Updating for Document Information Extraction
University of Electronic Science and Technology of China(电子科技大学);Singapore Management University(新加坡管理大学);Beijing Forestry University(北京林业大学);Beijing Rongda Technology Co., Ltd.(北京融达科技有限公司)
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(香港理工大学)