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

上下文学习需要多少个示范?

How Many Demonstrations Do You Need for In-context Learning?

University of Maryland(马里兰大学)

Jiuhai Chen, Lichang Chen, Chen Zhu, Tianyi Zhou

AI总结:

本文研究ICL所需示范数量,发现单随机示范性能未显著下降,而单个正确示范优于全示范,并揭示数据集偏差及多示范干扰带来的基础挑战。

摘要:

大型语言模型(LLM)在获得少量输入-输出示范(demos)时,能够通过上下文学习(ICL)执行复杂推理;若提供示范的中间推理步骤(“思维链(CoT)”),其能力会更强。ICL中是否有必要使用多个示范?本文在文献\cite{wei2022chain}的任务上,针对每个测试查询研究使用更少示范的ICL。令人惊讶的是,仅使用一个随机选择的示范时,我们并未观察到显著性能下降。为研究这一现象,对于每个测试查询,我们将示范分为导向正确答案的“正确示范”和导致错误答案的“错误示范”。分析揭示了这些被广泛研究的数据集存在固有偏差:对于大多数测试查询,多数示范都是正确的,这解释了使用一个随机示范仍有良好表现的原因。此外,仅使用一个正确示范的ICL(无论是否带有CoT)显著优于以往多数工作采用的全示范ICL,这表明LLM在为输入查询寻找正确示范方面存在弱点,而该弱点在有偏差的数据集上难以评估。进一步地,我们观察到多示范ICL的一种反直觉行为:当给出更多正确(错误)示范时,其准确率反而下降(上升)。这意味着ICL很容易受到示范之间的干扰及其虚假相关性的误导。我们的分析凸显了LLM训练、ICL和基准设计中需要解决的若干基础性挑战。

英文摘要:

Large language models (LLMs) are capable to perform complex reasoning by in-context learning (ICL) when provided with a few input-output demonstrations (demos) and more powerful when intermediate reasoning steps ("chain of thoughts (CoT)") of the demos are given. Is it necessary to use multi-demo in ICL? In this paper, we study ICL using fewer demos for each test query on the tasks in~\cite{wei2022chain}. Surprisingly, we do not observe significant degradation when using only one randomly chosen demo. To study this phenomenon, for each test query, we categorize demos into "correct demos" leading to the correct answer, and "wrong demos" resulting in wrong answers. Our analysis reveals an inherent bias in those widely studied datasets: most demos are correct for a majority of test queries, which explains the good performance of using one random demo. Moreover, ICL (with and w/o CoT) using only one correct demo significantly outperforms all-demo ICL adopted by most previous works, indicating the weakness of LLMs in finding correct demo(s) for input queries, which is difficult to evaluate on the biased datasets. Furthermore, we observe a counterintuitive behavior of ICL using multi-demo, i.e., its accuracy degrades(improves) when given more correct(wrong) demos. This implies that ICL can be easily misguided by interference among demos and their spurious correlations. Our analyses highlight several fundamental challenges that need to be addressed in LLMs training, ICL, and benchmark design.

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

↑