Seedlabs
Source research

What Works for 'Lost-in-the-Middle' in LLMs? A Study on GM-Extract and Mitigations

Gupte, Mihir, Dixit, Eshan, Tayyab, Muhammad, Adiththan, Arun · 2025 · 3 citationsRead the paper

The diminishing ability of large language models (LLMs) to effectively utilize long-range context-the "lost-in-the-middle" phenomenon-poses a significant challenge in retrieval-based LLM applications. To study the impact of this phenomenon in a real-world application setting, we introduce GM-Extract, a novel benchmark dataset meticulously designed to evaluate LLM performance on retrieval of control variables. To accurately diagnose failure modes, we propose a simple yet elegant evaluation system using two distinct metrics: one for spatial retrieval capability (Document Metric) and the other for semantic retrieval capability (Variable Extraction Metric). We conduct a systematic evaluation of 7-8B parameter models on two multi-document tasks (key-value extraction and question-answering), demonstrating a significant change in retrieval performance simply by altering how the data is represented in the context window. While a distinct U-shaped curve was not consistently observed, our analysis reveals a clear pattern of performance across models, which we further correlate with perplexity scores. Furthermore, we perform a literature survey of mitigation methods, which we categorize into two distinct approaches: black-box and white-box methods. We then apply these techniques to our benchmark, finding that their efficacy is highly nuanced. Our evaluation highlights scenarios where these strategies successfully improve performance, as well as surprising cases where they lead to a negative impact, providing a comprehensive understanding of their utility in a practical context.

What the full text shows

Working prototype
  • Positional Data Augmentation (MIX) strategy provides the most significant performance gain in the challenging middle region of the context window. (Fine-tuning Vicuna-7B-1.5 using LoRA with a mix of uniform and middle-position over-sampled data)
  • LLaMA-3.1-8B achieves near-perfect performance on the benchmark tasks when the context is approximately 4k tokens. — near-perfect (4k token context window)
  • Instruction-tuning is a prerequisite for the effectiveness of data-driven mitigation strategies. (Comparison between LLaMa-2-7B (non-instruct) and Vicuna-7B-1.5 (instruct) during fine-tuning)
Setup
Models used: LLaMa-2-7B, Vicuna-7B-1.5, LLaMa-3.1-8B. Fine-tuning datasets ranged from 60k to 120k permutation samples using LoRA on a single GPU.
How
The researchers developed the GM-Extract benchmark for key-value extraction and QA, evaluating 7-8B parameter models. They tested white-box mitigations (Ms-PoE, Hidden State Scaling) and black-box mitigations (LoRA-based fine-tuning with positional data augmentation).
Limitations
Institutional resource constraints limited experiments to a single GPU. · Evaluation focused on models in the 7-8B parameter range. · Fine-tuning was performed using PEFT/LoRA rather than full parameter updates due to resource limits.

Summarized by Gemma 4 from the open-access full text · 15 Nov 2026. Read it