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

评估大语言模型上下文窗口:一项“工作记忆”测试与推理时校正方法

Evaluating Language Model Context Windows: A "Working Memory" Test and Inference-time Correction

Snorkel AI(斯诺克人工智能公司);University of Wisconsin-Madison(威斯康星大学麦迪逊分校)

Amanda Dsouza, Christopher Glaze, Changho Shin, Frederic Sala

AI总结:

本研究提出SWiM长上下文评估框架,验证了大模型存在上下文中间信息丢失效应,并提出无需训练的中心点投票方法,可将单文档问答准确率最高提升24%。

摘要:

大语言模型已广泛应用于现实场景中,通常需要基于大量文档进行推理。该领域一个令人瞩目的进展是模型不断扩展上下文能力,部分模型可支持超过200万个token。这类长上下文模型在生产系统中的实际表现仍不明确,因此有必要针对现实用例构建基准测试来衡量其性能。针对这一挑战,我们提出SWiM(一种评估框架),以弥补标准测试的局限性。在8个长上下文模型上测试该框架后,我们发现即使是GPT-4、Claude 3 Opus这类性能强劲的模型,当关键信息位于上下文窗口中间时,表现也会出现下降(即“中间丢失”效应)。除基准测试外,我们还提出了中心点投票(medoid voting)——一种简单有效且无需训练的方法,可缓解该效应:其思路是多次生成回复,每次随机打乱上下文中的文档顺序,再选取中心点答案。我们在单文档问答任务上评估了中心点投票方法,准确率最高提升了24%。相关代码已发布于https://github.com/snorkel-ai/long-context-eval。

英文摘要:

Large language models are prominently used in real-world applications, often tasked with reasoning over large volumes of documents. An exciting development in this space is models boasting extended context capabilities, with some accommodating over 2 million tokens. Such long context model capabilities remain uncertain in production systems, motivating the need to benchmark their performance on real world use cases. We address this challenge by proposing SWiM, an evaluation framework that addresses the limitations of standard tests. Testing the framework on eight long context models, we find that even strong models such as GPT-4 and Claude 3 Opus degrade in performance when information is present in the middle of the context window (lost-in-the-middle effect). Next, in addition to our benchmark, we propose medoid voting, a simple, but effective training-free approach that helps alleviate this effect, by generating responses a few times, each time randomly permuting documents in the context, and selecting the medoid answer. We evaluate medoid voting on single document QA tasks, achieving up to a 24% lift in accuracy. Our code is available at https://github.com/snorkel-ai/long-context-eval.

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

↑