[论文解读] Make Your LLM Fully Utilize the Context
这篇论文引入 In2 训练,教 LLMs 在长上下文中的任意位置提取并整合信息,产生 FilM-7B,在长上下文探测和真实任务上优于基线,同时保留短上下文性能。
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.
研究动机与目标
- 激发并解决长上下文 LLMs 中的“丢在中间”挑战——中间上下文信息未被充分利用。
- 提出一种纯数据驱动的 In2 训练方法,明确教导信息可以分布在整个长上下文中。
- 证明从短片段合成的长上下文问答数据可以同时提高探测和真实场景任务的表现。
- 证明 FilM-7B 在提升长上下文处理能力的同时,仍保持短上下文的能力。
提出的方法
- 从通用语料库构建一个长上下文问答数据集 D,通过生成需要来自一个或多个 128-token 段内信息的问题,所涉长上下文为 4K–32K tokens。
- 使用 GPT-4-Turbo 生成问答对,并通过拼接段落并打乱它们来组装长上下文。
- 创建两种问答类型:细粒度的单段感知与多段整合/推理。
- 通过拒绝采样在4K–32K tokens之间平衡上下文长度,并混入短上下文和通用指令微调数据以防止忘记。
- 用指令微调对 Mistral-7B-Instruct-v0.2 进行指令微调以在 In2 训练下获得 FilM-7B,约 14K 步,128 的批次,在 16 个节点上使用 FSDP。
实验结果
研究问题
- RQ1信息密集型(In2)训练范式是否通过强调关键信息可以在整个长上下文中的任意位置来减少中间丢失现象?
- RQ2在文档、代码和结构化数据上下文中,对探测鲁棒性的影响如何?
- RQ3FilM-7B 是否在不牺牲短上下文性能的前提下提升真实场景的长上下文任务?
主要发现
- FilM-7B 显著缓解中间丢失,在 VaL 探测任务中的 32K 上下文窗口各位置表现鲁棒。
- FilM-7B 在探测任务上的表现可与或优于 GPT-4-Turbo,并在文档和代码上下文中表现出鲁棒性。
- FilM-7B 在真实世界的长上下文任务(如 NarrativeQA)上取得显著提升,同时维持可比的短上下文性能(如 MMLU)。
- 在合成长上下文数据上的训练能推广到真实场景,FilM-7B 在约 7B 开源模型中的长上下文基准上达到SOTA级别的结果。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。