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

让你的LLM充分利用上下文

Make Your LLM Fully Utilize the Context

Peking University(北京大学);Microsoft(微软)

Shengnan An, Zexiong Ma, Zeqi Lin, Nanning Zheng, Jian-Guang Lou

AI总结:

针对LLM的“迷失在中间”挑战,提出信息密集型(IN2)训练方法,通过合成数据强化细粒度信息感知与跨片段推理,使FILM-7B模型在32K上下文窗口中稳健检索信息,并在真实长上下文任务上显著提升性能。

摘要:

尽管许多当代大型语言模型(LLMs)能够处理长输入,但它们仍难以充分利用长上下文中的信息,这被称为“迷失在中间”挑战。我们假设这源于长上下文训练期间缺乏足够的显式监督,未能强调长上下文中的任何位置都可能包含关键信息。基于这一直觉,我们的研究提出了信息密集型(IN2)训练,一种纯粹数据驱动的解决方案来克服“迷失在中间”问题。具体而言,IN2训练利用一个合成的长上下文问答数据集,其中答案要求(1)对合成长上下文(4K-32K tokens)中短片段(~128 tokens)的细粒度信息感知,以及(2)对来自两个或更多短片段的信息进行整合与推理。通过在Mistral-7B上应用此信息密集型训练,我们提出了FILM-7B(FILl-in-the-Middle)。为全面评估FILM-7B利用长上下文的能力,我们设计了三项探测任务,涵盖多种上下文风格(文档、代码和结构化数据上下文)及信息检索模式(前向、后向和双向检索)。探测结果表明,FILM-7B能稳健地从其32K上下文窗口的不同位置检索信息。除这些探测任务外,FILM-7B在真实长上下文任务上表现显著提升(例如,NarrativeQA上F1分数从23.5提升至26.9),同时在短上下文任务上保持相当性能(例如,MMLU准确率从59.3变为59.2)。

英文摘要:

While many contemporary large language models (LLMs) can process lengthy input, they still struggle to fully utilize information within the long context, known as the lost-in-the-middle challenge. We hypothesize that it stems from insufficient explicit supervision during the long-context training, which fails to emphasize that any position in a long context can hold crucial information. Based on this intuition, our study presents information-intensive (IN2) training, a purely data-driven solution to overcome lost-in-the-middle. Specifically, IN2 training leverages a synthesized long-context question-answer dataset, where the answer requires (1) fine-grained information awareness on a short segment (~128 tokens) within a synthesized long context (4K-32K tokens), and (2) the integration and reasoning of information from two or more short segments. Through applying this information-intensive training on Mistral-7B, we present FILM-7B (FILl-in-the-Middle). To thoroughly assess the ability of FILM-7B for utilizing long contexts, we design three probing tasks that encompass various context styles (document, code, and structured-data context) and information retrieval patterns (forward, backward, and bi-directional retrieval). The probing results demonstrate that FILM-7B can robustly retrieve information from different positions in its 32K context window. Beyond these probing tasks, FILM-7B significantly improves the performance on real-world long-context tasks (e.g., 23.5->26.9 F1 score on NarrativeQA), while maintaining a comparable performance on short-context tasks (e.g., 59.3->59.2 accuracy on MMLU). Github Link: https://github.com/microsoft/FILM.

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

↑