Abstract
Despite the expansion of context windows in Large Language Models (LLMs) to 128K tokens and beyond, many models exhibit a "lost-in-the-middle" phenomenon, where information located in the center of a long prompt is frequently ignored. This paper presents INformation-INtensive (IN2) training, a data-driven fine-tuning methodology designed to compel models to utilize their entire context window. By training on synthesized tasks requiring fine-grained information awareness and multi-hop reasoning, the resulting model, FILM-7B, achieves performance comparable to or exceeding GPT-4-Turbo on long-context retrieval tasks while preserving strong performance on standard short-context benchmarks.
Introduction
As LLMs scale their context windows, a performance gap has emerged: models excel at retrieving information from the beginning or end of a prompt but struggle with the middle. This "U-shaped" performance curve limits the reliability of long-context windows for tasks like codebase analysis or multi-document reasoning. The authors argue that this is not a fundamental architectural limitation but a consequence of current training paradigms. Standard pre-training and fine-tuning often place critical information at the extremities, inadvertently teaching models that the middle is less relevant.
Methodology: INformation-INtensive (IN2) Training
To address this supervision failure, the researchers introduced IN2 training, which focuses on changing the model's data "diet" during fine-tuning rather than modifying its architecture.
The training process involves:
- Synthesized Long Contexts: Contexts (4K to 32K tokens) are constructed by concatenating short (~128 token) segments.
- Information-Intensive QA: Using GPT-4-Turbo as a teacher, two types of questions are generated:
- Fine-grained awareness: Requires identifying a specific segment hidden randomly in the context.
- Integration and Reasoning: Multi-hop questions requiring the combination of information from multiple scattered segments.
The resulting model, FILM-7B (Fill-in-the-Middle), was fine-tuned from Mistral-7B-Instruct-v0.2 using 1.1 million synthesized examples mixed with general short-context data to maintain broad capabilities.
Experimental Setup: VAL Probing
The authors introduced VArious Long-context (VAL) Probing to evaluate retrieval more rigorously than the standard "Needle-in-the-Haystack" test. VAL Probing includes:
- Document Sentence Retrieval: Bi-directional natural language retrieval.
- Code Function Retrieval: Backward retrieval (finding a function name from its definition).
- Database Entity Retrieval: Forward retrieval in structured data.
Results and Analysis
FILM-7B effectively eliminates the "lost-in-the-middle" problem. While the base Mistral model shows significant performance degradation in the center of the context, FILM-7B maintains high, stable performance across the entire 32K window.
Key findings include:
- Retrieval Superiority: FILM-7B achieved an average score of 85.9% on VAL Probing, surpassing GPT-4-Turbo (79.0%).
- Retrieval Directionality: Models generally find forward retrieval easier than backward retrieval; VAL Probing highlights these specific weaknesses.
- Generalization: FILM-7B maintained its performance on MMLU (59.3%), showing no "tax" on general intelligence for long-context specialization.
- RoPE Scaling: Increasing the Rotary Positional Encoding (RoPE) base factor (up to 10x) was found to be beneficial for high-intensity long-context tasks.
Conclusion
IN2 training demonstrates that the "lost-in-the-middle" phenomenon is largely a result of insufficient supervision during training. By explicitly training models to treat every position in the context as potentially critical, FILM-7B achieves state-of-the-art long-context utilization. Future work includes scaling this approach to 128K+ contexts and reducing the computational cost of generating synthetic training data, which currently requires approximately 300 GPU days (A100s) for a 7B model.
Summary updated