Skip to main content
QUICK REVIEW

[Paper Review] Make Your LLM Fully Utilize the Context

Shengnan An, Zexiong Ma|arXiv (Cornell University)|Apr 25, 2024
Library Science and Information SystemsComputer Science9 citations
TL;DR

This paper introduces In2 training to teach LLMs to extract and integrate information from any position in long contexts, producing FilM-7B which outperforms baselines on long-context probing and real tasks while preserving short-context performance.

ABSTRACT

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.

Motivation & Objective

  • Motivate and address the lost-in-the-middle challenge in long-context LLMs where middle-context information is underutilized.
  • Propose a purely data-driven In2 training method that explicitly teaches information can be distributed throughout a long context.
  • Show that long-context QA data synthesized from short segments can improve both probing and real-world tasks.
  • Demonstrate that FilM-7B retains short-context capabilities while enhancing long-context processing.

Proposed method

  • Construct a long-context QA dataset D from a general corpus by generating questions requiring information from one or more 128-token segments within a long context (4K–32K tokens).
  • Use GPT-4-Turbo to generate QA pairs and assemble long contexts by concatenating segments and shuffling them.
  • Create two QA types: fine-grained single-segment awareness and multi-segment integration/reasoning.
  • Balance context lengths 4K–32K tokens via reject sampling and mix in short-context and general instruction-tuning data to prevent forgetting.
  • Fine-tune Mistral-7B-Instruct-v0.2 with instruction-tuning to obtain FilM-7B using In2 training, with ~14K steps and 128-size batches on 16 nodes with FSDP.

Experimental results

Research questions

  • RQ1Can an information-intensive (In2) training paradigm reduce lost-in-the-middle phenomena by emphasizing that important information can be anywhere in a long context?
  • RQ2How does training on synthesized long-context QA data affect probing robustness across document, code, and structured-data contexts?
  • RQ3Does FilM-7B improve real-world long-context tasks without sacrificing short-context performance?

Key findings

  • FilM-7B significantly mitigates lost-in-the-middle, showing robust performance across positions in the 32K context window on VaL Probing tasks.
  • FilM-7B achieves performance comparable to or better than GPT-4-Turbo on probing tasks and demonstrates robustness across document and code contexts.
  • FilM-7B yields notable improvements on real-world long-context tasks (e.g., NarrativeQA) while maintaining comparable short-context performance (e.g., MMLU).
  • Training on synthesized long-context data generalizes to real-world scenarios, and FilM-7B attains SOTA-level results among ~7B open-source models for long-context benchmarks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.