arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2410.23099cs.CLcs.AIcs.LG
收藏

面向大语言模型上下文学习的示例选择算法对比分析

Comparative Analysis of Demonstration Selection Algorithms for LLM In-Context Learning

Northwestern University(西北大学);New Jersey Institute of Technology(新泽西理工学院)

Dong Shu, Mengnan Du

AI总结:

该研究针对大语言模型上下文学习中示例选择算法效果与效率不明确的问题,对六种算法在五个数据集上开展对比评估,揭示了算法性能的任务差异性、示例数量与性能的非正相关关系及准确率与效率的权衡问题。

摘要:

上下文学习可帮助大语言模型(LLM)无需额外训练即可适配新任务。但其性能高度依赖示例质量,推动了针对有效示例选择算法的研究,以优化这一过程。这类算法可辅助用户针对给定的测试输入,选出最优的$k$个输入-标签对(即示例样本),使LLM能够通过上下文学习所提供示例与测试输入之间的关联。尽管已有多种示例选择算法被提出,它们的效率与效果仍不明确。这种模糊性导致这类算法难以应用于实际场景,也给旨在开发更优方法的未来研究带来挑战。本文重新梳理了六种已提出的算法,从效率和效果两个维度在五个数据集上对其进行评估。实验表明,不同任务下算法性能存在显著差异,部分方法在某些场景中甚至难以超过随机选择的表现。研究还发现,增加示例数量并不总能提升性能,且准确率与计算效率之间通常存在权衡关系。本文代码已发布于https://github.com/Tizzzzy/Demonstration_Selection_Overview。

英文摘要:

In-context learning can help Large Language Models (LLMs) to adapt new tasks without additional training. However, this performance heavily depends on the quality of the demonstrations, driving research into effective demonstration selection algorithms to optimize this process. These algorithms assist users in selecting the best $k$ input-label pairs (demonstration examples) based on a given test input, enabling LLMs to in-context learn the relationship between the provided examples and the test inputs. Despite all the proposed demonstration selection algorithms, their efficiency and effectiveness remain unclear. This lack of clarity make it difficult to apply these algorithms in real-world scenarios and poses challenges for future research aimed at developing improved methods. This paper revisits six proposed algorithms, evaluating them on five datasets from both efficiency and effectiveness perspectives. Our experiments reveal significant variations in algorithm performance across different tasks, with some methods struggling to outperform random selection in certain scenarios. We also find that increasing the number of demonstrations does not always lead to better performance, and that there are often trade-offs between accuracy and computational efficiency. Our code is available at https://github.com/Tizzzzy/Demonstration_Selection_Overview.

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

↑