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

Learning to Retrieve In-Context Examples for Large Language Models(学习为大语言模型检索上下文示例)

Learning to Retrieve In-Context Examples for Large Language Models

Microsoft Research(微软研究院)

Liang Wang, Nan Yang, Furu Wei

AI总结:

针对大语言模型上下文学习效果依赖示例质量的问题,提出迭代训练稠密检索器的框架,通过奖励模型与知识蒸馏提升示例检索质量,在30项任务上显著提升性能且具备跨任务泛化性。

摘要:

大语言模型(LLM)已展现出上下文学习能力,可基于少量输入-输出示例执行各类任务。但上下文学习的有效性高度依赖所选示例的质量。本文提出一种新颖框架,用于迭代训练能为LLM识别高质量上下文示例的稠密检索器。该框架首先基于LLM反馈训练奖励模型以评估候选示例的质量,随后通过知识蒸馏训练基于双编码器的稠密检索器。我们在30项任务组成的套件上开展的实验表明,该框架显著提升了上下文学习性能。此外,我们验证了框架对训练期间未见过的任务具备泛化能力。深入分析显示,该模型通过检索具有相似模式的示例提升性能,且这种增益在不同规模的LLM中均保持一致。代码与数据可在https://github.com/microsoft/LMOps/tree/main/llm_retriever 获取。

英文摘要:

Large language models (LLMs) have demonstrated their ability to learn in-context, allowing them to perform various tasks based on a few input-output examples. However, the effectiveness of in-context learning is heavily reliant on the quality of the selected examples. In this paper, we propose a novel framework to iteratively train dense retrievers that can identify high-quality in-context examples for LLMs. Our framework initially trains a reward model based on LLM feedback to evaluate the quality of candidate examples, followed by knowledge distillation to train a bi-encoder based dense retriever. Our experiments on a suite of $30$ tasks demonstrate that our framework significantly enhances in-context learning performance. Furthermore, we show the generalization ability of our framework to unseen tasks during training. An in-depth analysis reveals that our model improves performance by retrieving examples with similar patterns, and the gains are consistent across LLMs of varying sizes. The code and data are available at https://github.com/microsoft/LMOps/tree/main/llm_retriever .

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

↑