PreprintCited by 131Topic ModelingMultimodal Machine Learning ApplicationsNatural Language Processing Techniques

Found in the Middle: Calibrating Positional Attention Bias Improves Long Context Utilization

Open access
Hsieh, Cheng-Yu, Chuang, Yung-Sung, Li, Chun-Liang, Wang, Zifeng, Le, Long T., Kumar, Abhishek, Glass, James, Ratner, Alexander +3 more·2024·arXiv

Abstract

Large language models (LLMs), even when specifically trained to process long input contexts, struggle to capture relevant information located in the middle of their input. This phenomenon has been known as the lost-in-the-middle problem. In this work, we make three contributions. First, we set out to understand the factors that cause this phenomenon. In doing so, we establish a connection between lost-in-the-middle to LLMs' intrinsic attention bias: LLMs exhibit a U-shaped attention bias where the tokens at the beginning and at the end of its input receive higher attention, regardless of their relevance. Second, we mitigate this positional bias through a calibration mechanism, found-in-the-middle, that allows the model to attend to contexts faithfully according to their relevance, even though when they are in the middle. Third, we show found-in-the-middle not only achieves better performance in locating relevant information within a long context, but also eventually leads to improved retrieval-augmented generation (RAG) performance across various tasks, outperforming existing methods by up to 15 percentage points. These findings open up future directions in understanding LLM attention bias and its potential consequences.

Integrity signals

Registry

DataCite · 10.48550/arxiv.2406.16008

Cites

0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Claims the paper makes

10 of 15 cited sources checked · 6 supported · 0 flagged · accuracy not yet measured

  • Interpretationcitation

    The U-shaped attention bias correlates with the U-shaped RAG performance observed in prior literature.

    “This correlates well with the U-shaped RAG performance observed in prior literature (Liu et al., 2023).”
    Quote in the paperNot a substantial claim1 of 1 sources checked
    • cites Liu et al., 2023 source
  • Premisecitation

    Large language models (LLMs), even when specifically trained to process long input contexts, struggle to capture relevant information located in the middle of their input.

    “Large language models (LLMs), even when specifically trained to process long input contexts, struggle to capture relevant information located in the middle of their input.”
    • Also stated in: § 1 Introduction · plain
      “LLMs struggle to locate relevant documents when they are placed in the middle of their input prompts (Liu et al., 2023;Li et al., 2023a).”
    Quote in the paperSubstantial claim1 of 2 sources checked
    • cites Liu et al., 2023 source
    • cites Li et al., 2023a

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

  • Premisecitation

    Models preferentially use information from the beginning and end of their prompts.

    “Interestingly, this focus on the beginning and end also extends to content utilization: models preferentially use information from the beginning and end of their prompts (Ravaut et al., 2023;Peysakhovich and Lerer, 2023).”
    Quote in the paperSubstantial claim2 of 2 sources checked
    • cites Ravaut et al., 2023 source
    • cites Peysakhovich and Lerer, 2023 source
  • Premisecitation

    Even models specifically trained for long-context suffer from the lost-in-the-middle problem.

    “Nonetheless, even models specifically trained for long-context suffer lost-in-the-middle problem (Liu et al., 2023;Li et al., 2023a).”
    Quote in the paperSubstantial claim1 of 2 sources checked
    • cites Liu et al., 2023 source
    • cites Li et al., 2023a

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

  • Premisenone given

    Existing methods that manipulate input contexts improve model performance but do not fundamentally improve LLMs' underlying long-context utilization capability.

    “While these existing solutions lead to improved model performances by manipulating the input contexts, they do not fundamentally improve LLMs' underlying long-context utilization capability.”
    Quote in the paperSubstantial claim3 of 3 sources checked
    • cites Chen et al., 2023 source

      The Introduction describes approaches that extend or select input context, then says they remain limited by design; the Context window scaling section identifies further limits in long-sequence attention and recurrence. This supports the concern about persistent long-context limitations, but the paper does not establish the broader claim that these methods improve performance without fundamentally improving LLMs’ underlying long-context utilization capability. (LLM, conf=0.82)

      Experimental — accuracy not yet measured
    • cites Jiang et al., 2023

      The Abstract and Section 7 (Conclusion; page unavailable) report that prompt compression improves performance, and Section 5 (Experiments; page unavailable) compares methods that manipulate input contexts. The paper does not establish that such methods fail to fundamentally improve LLMs’ underlying long-context utilization capability; it also reports that some existing compression methods perform poorly. (LLM, conf=0.82)

      Experimental — accuracy not yet measured
    • cites Peysakhovich and Lerer, 2023 source

      The Conclusion and Limitations (page unavailable) describes attention sorting as an inference-time method that modifies a model’s context to improve task performance, and suggests joint fine-tuning as a more principled solution. This supports the distinction for attention sorting, but the paper does not establish that existing context-manipulation methods generally fail to improve underlying long-context utilization capability. (LLM, conf=0.83)

      Experimental — accuracy not yet measured
  • Classified as probably not a substantial claim. 11
  • May combine two claims. 15
  • Probably not a substantial claim: may not pass S2 (checkable).

    Premisenone given

    The relationship between the lost-in-the-middle problem and LLM's self-attention has been under-explored.

    “However, the relationship between the lost-inthe-middle problem and LLM's self-attention has been under-explored.”
    Quote in the paperNot a substantial claim1 of 2 sources checked
    • cites Peysakhovich and Lerer, 2023 source

      The Introduction discusses the lost-in-the-middle effect and self-attention, and Section 3 examines attention weights alongside that effect. Neither passage says whether the relationship had been under-explored in prior research; searches for that characterization and for discussion of prior work did not establish it. (LLM, conf=0.72)

      Experimental — accuracy not yet measured
    • cites He et al., 2023

      Couldn’t be matched to a paper in Crossref, so it can’t be checked.

  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Premisereasoning

    SynthWiki can minimize knowledge contamination from pre-training and ensure LLMs can only use information from the provided context.

    “All the documents in SynthWiki are GPT-4 generated Wikipedia paragraphs for fictional people, thus it can minimize the knowledge contamination issue from pre-training and ensure the LLMs can only use information from the provided context.”
    Quote in the paperNot a substantial claim1 of 1 sources checked
    • cites Peysakhovich and Lerer, 2023 source
  • May combine two claims.

    Findingown data

    The model's response strongly depends on the document at the first position, and this dependence persists after randomly shuffling document order, irrespective of relevance to the query.

    “Quantitatively, the model's response strongly depends on the document at the first position.This dependence persists even after randomly shuffling the document order, irrespective of its relevance to the query.”
    Quote in the paperSubstantial claim
    • The authors state this as an assumption: The positional attention bias can be modeled as a simple additive combination of document relevance and position bias (Eq. 1).
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingown data

    Attention calibration is robust to the temperature term t in Eq. 5.

    “In the experiments, we find attention calibration to be robust to the temperature term t in Eq. 5.”
    Quote in the paperNot a substantial claim
    • The authors state this as an assumption: The positional attention bias can be modeled as a simple additive combination of document relevance and position bias (Eq. 1).
  • May combine two claims.

    Findingown data

    Calibrated attention consistently outperforms vanilla attention by a large margin and shows superior performance compared to query generation and relevance generation re-ranking metrics.

    “We see that the proposed calibrated attention consistently outperforms vanilla attention by a large margin, and also shows superior performances when compared to the other two re-ranking metrics.”
    Quote in the paperSubstantial claim
    • The authors state this as an assumption: A dummy document x_dum has a constant relevance rel(x_dum).
  • May combine two claims.

    Findingown data

    Models do attend to relevant contexts even when placed in the middle, but are eventually distracted by leading/ending contexts.

    “Models do attend to relevant contexts even when placed in the middle, but are eventually distracted by leading/ending contexts”
    Quote in the paperSubstantial claim
    • The authors state this as an assumption: The positional attention bias can be modeled as a simple additive combination of document relevance and position bias (Eq. 1).
  • May combine two claims.

    Findingown data

    Attention calibration improves models' context utilization/RAG performance compared to uncalibrated vanilla attention, with performance curves above vanilla in 22 of 24 cases and 6-15 point improvements when gold documents are in the middle.

    “Experiments show that attention calibration improves the performance compared to its uncalibrated counterpart especially when relevant context occurs in the middle of the input.”
    • Also stated in: § Ethical Statement · plain
      “Attention calibration effectively improves models' context utilization ability, with its performance curves lying almost entirely above standard vanilla attention (on 22 out of 24 cases).”
    • Also stated in: § Ethical Statement · plain
      “On the most challenging settings where the gold documents are placed in the middle, attention calibration provides 6-15 points improvements.”
    Quote in the paperSubstantial claim
    • The authors state this as an assumption: The positional attention bias can be modeled as a simple additive combination of document relevance and position bias (Eq. 1).
  • May combine two claims.

    Findingown data

    The model's response exhibits a strong bias towards the document at the first position, persisting whether input documents retain original order or are randomly shuffled.

    “Qualitatively, the model's response exhibits a strong bias towards the document at the first position (red).This persists whether the input documents retain their original order (left: gold document at the 10th position) or are randomly shuffled (middle: gold document at the 13th position).”
    Quote in the paperSubstantial claim
    • The authors state this as an assumption: The positional attention bias can be modeled as a simple additive combination of document relevance and position bias (Eq. 1).
  • May combine two claims.

    Findingown data

    Log-linear models result in competitive rank correlation of 0.75, comparable to linear models which result in rank correlation above 0.75.

    “In Appendix C, we also explore log-linear models, which results in competitive 0.75 rank correlation.”
    • Also stated in: § Additional information · plain
      “The log-linear model and linear are competitive to each other, which all result in rank correlation above 0.75.”
    Quote in the paperNot a substantial claim
    • The authors state this as an assumption: The positional attention bias can be modeled as a simple additive combination of document relevance and position bias (Eq. 1).
  • Classified as probably not a substantial claim.

    Interpretationreasoning

    Lost-in-the-middle happens because of the dominating force of positional bias.

    “We thus conjecture that lost-in-the-middle happens because of the dominating force of positional bias.”
    Quote in the paperSubstantial claim
  • May combine two claims.

    Interpretationown data

    Apart from U-shaped positional bias, the model exhibits an ability to prioritize relevant context.

    “This contrasts with instances where x doc 10 is uncontrolled, suggesting that apart from U-shaped positional bias, the model exhibits an ability to prioritize relevant context.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Interpretationown data

    There are two main forces driving the model attention assigned to different documents of an input prompt: where the document locates within the entire input, and the relevance of the document.

    “In Sec. 2, we find that there are two main forces driving the model attention assigned to different documents of an input prompt: (a) where the document locates within the entire input, and (b) the relevance of the document.”
    Quote in the paperSubstantial claim
  • Classified as probably not a substantial claim. May combine two claims.

    Study design and conductnone given

    The method is a pure inference method, so there is no need to do training or hyperparameter searching.

    “Our method is a pure inference method, so there is no need to do training or hyperparameter searching.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Study design and conductnone given

    The use of the datasets was consistent with their intended purpose for academic research and in accordance with their specified licensing agreements.

    “We ensure that the use of these two datasets was consistent with their intended purpose for academic research and in accordance with their specified licensing agreements.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Study design and conductnone given

    No personal or sensitive data was collected or utilized.

    “ensuring that no personal or sensitive data was collected or utilized.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Interpretationown data

    Attention calibration can more fundamentally improve models' context utilization, providing a complementary way to re-ordering methods to further improve current RAG pipeline.

    “These results suggest that attention calibration can more fundamentally improve models' context utilization, providing a complementary way to re-ordering methods to further improve current RAG pipeline.”
    Quote in the paperSubstantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Study design and conductreasoning

    The experiments use greedy decoding without any nondeterministic factor, so only need to run experiments once.

    “We run our experiments with all greedy decoding without any nondeterministic factor, so we only need to run the experiments for once.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing), S4 (based). May combine two claims.

    Study design and conductnone given

    The datasets should not contain any information that names or uniquely identifies individual people or offensive content.

    “These two dataset should not contain any information that names or uniquely identifies individual people or offensive content.”
    Quote in the paperNot a substantial claim
  • May combine two claims.

    Interpretationreasoning

    The proposed method offers an efficient solution by mitigating the lost-in-the-middle problem with off-the-shelf LLMs, unlike methods requiring significant data collection and LLM tuning.

    “Unlike the method, which necessitate significant investment in data collection and LLM tuning, our method offers an efficient solution by mitigating lost-in-the-middle problem with off-theshelf LLMs.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S1 (asserted), S4 (based).

    Interpretationnone given

    The model attention can be modeled as Attn(x_prompt, k) = f(rel(x_doc_k), bias(k)), where f is monotonically increasing in both relevance and positional bias.

    “We thus consider modeling the observable attention weights allocated to the k-th document of an input x prompt as: Attn(x prompt , k) = f (rel(x doc k ), bias(k)), (1 ) where rel(•) measures the relevance of an input document, bias(•) characterizes the positional attention bias, and f (•) is some unknown monotonically increasing function w.r.t. to both rel(x doc k ) and bias(k).”
    Quote in the paperNot a substantial claim
    • The authors state this as an assumption: The function f is monotonically increasing in both relevance and positional bias.
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Study design and conductreasoning

    The paper does not definitively pinpoint the root cause of attention bias in LLMs.

    “However, our work does not definitively pinpoint the root cause of attention bias in LLMs.”
    Quote in the paperNot a substantial claim
    • The authors state this as an assumption: The positional attention bias can be modeled as a simple additive combination of document relevance and position bias (Eq. 1).
21 of 21
  • The paper relies on this without support.

    Re-ranking methods do not fundamentally improve LLMs' ability to utilize and capture relevant information from the provided input contexts.

    “Worse, re-ranking methods do not fundamentally improve LLMs' ability to utilize and capture relevant information from the provided input contexts.”
  • The authors state this as an assumption.

    Model attention can be modeled as Attn(x_doc, k) = rel(x_doc) + bias(k) + ε.

    “Attn(x doc , k) = rel(x doc ) + bias(k) + ϵ, (2) where ϵ is a noise.”
  • The authors state this as an assumption.

    The function f is monotonically increasing in both relevance and positional bias.

    “f (•) is some unknown monotonically increasing function w.r.t. to both rel(x doc k ) and bias(k).”
  • The authors state this as an assumption.

    A dummy document x_dum has a constant relevance rel(x_dum).

    “Consider using a consistent dummy document x dum which has a constant rel(x dum )”
  • The authors state this as an assumption.

    The positional attention bias can be modeled as a simple additive combination of document relevance and position bias (Eq. 1).

    “We proposed a simple hypothesis to model the positional attention bias, as shown in Eq. 1.”
5 of 5

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

Each contradiction between two passages listed here was confirmed by an independent check.

  • The reported log-linear correlation is not above 0.75

    Minor

    The text says both model correlations exceed 0.75, but Table 4 reports exactly 0.75 for the log-linear model.

1 of 1

Cites

The publisher hasn’t deposited this paper’s reference list.

Research works printed but not linked: 5

  1. [6]6. Sebastian Borgeaud, Arthur Mensch, Jordan Hoff- mann, Trevor Cai, Eliza Rutherford, Katie Milli- can, George Bm Van Den Driessche, Jean-Baptiste Lespiau, Bogdan Damoc, Aidan Clark, et al. 2022. Improving language models by retrieving from tril- lions of tokens. In International conference on ma- chine learning, pages 2206-2240. PMLR.
  2. [16]16. Junqing He, Kunhao Pan, Xiaoqun Dong, Zhuoyang Song, Yibo Liu, Yuxin Liang, Hao Wang, Qianguo Sun, Songxin Zhang, Zejian Xie, et al. 2023. Never lost in the middle: Improving large language mod- els via attention strengthening question answering. arXiv e-prints, pages arXiv-2311.
  3. [21]21. Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Ye Jin Bang, Andrea Madotto, and Pascale Fung. 2023. Survey of halluci- nation in natural language generation. ACM Comput- ing Surveys, 55(12):1-38.
  4. [42]42. Yongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li, Weiming Lu, and Yueting Zhuang. 2023. Hugging- gpt: Solving ai tasks with chatgpt and its friends in huggingface. In Advances in Neural Information Processing Systems.
  5. [44]44. PMLR.

Cited by

Sorted by citations

Authors
Hsieh, C.-Y., Chuang, Y.-S., Li, C.-L., Wang, Z., Le, L. T., Kumar, A., Glass, J., Ratner, A., Lee, C.-Y., Krishna, R., & Pfister, T.
Affiliations
  • University of Washington (US)
  • Massachusetts Institute of Technology (US)
  • Google (United States) (US)
Venue
arXiv
Publisher
arXiv
Published
2024
ISSN
2331-8422 (ISSN-L)
OpenAlex
W4400023197
Cited by
0
References
0
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Multimodal Machine Learning Applications
  • Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
Keywords
long-context modeling, retrieval-augmented generation, large language models

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Claims read by deepseek-v4.1-flash under definition version 3 (extract-v3) on 2026-10-11.

Classified by jev-1.13-20260917 (gold-guideline-v0.2) on 2026-10-11.

Cited sources are checked by gpt-6-sol.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review