Attention Basin: Why Contextual Position Matters in Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yi, Zihao, Zeng, Delong, Ling, Zhenqing, Luo, Haohao, Xu, Zhe, Liu, Wei, Luan, Jian, Cao, Wanxia, Shen, Ying
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909727101812736
author Yi, Zihao
Zeng, Delong
Ling, Zhenqing
Luo, Haohao
Xu, Zhe
Liu, Wei
Luan, Jian
Cao, Wanxia
Shen, Ying
author_facet Yi, Zihao
Zeng, Delong
Ling, Zhenqing
Luo, Haohao
Xu, Zhe
Liu, Wei
Luan, Jian
Cao, Wanxia
Shen, Ying
contents The performance of Large Language Models (LLMs) is significantly sensitive to the contextual position of information in the input. To investigate the mechanism behind this positional bias, our extensive experiments reveal a consistent phenomenon we term the attention basin: when presented with a sequence of structured items (e.g., retrieved documents or few-shot examples), models systematically assign higher attention to the items at the beginning and end of the sequence, while neglecting those in the middle. Crucially, our analysis further reveals that allocating higher attention to critical information is key to enhancing model performance. Based on these insights, we introduce Attention-Driven Reranking (AttnRank), a two-stage framework that (i) estimates a model's intrinsic positional attention preferences using a small calibration set, and (ii) reorders retrieved documents or few-shot examples to align the most salient content with these high-attention positions. AttnRank is a model-agnostic, training-free, and plug-and-play method with minimal computational overhead. Experiments on multi-hop QA and few-shot in-context learning tasks demonstrate that AttnRank achieves substantial improvements across 10 large language models of varying architectures and scales, without modifying model parameters or training procedures.
format Preprint
id arxiv_https___arxiv_org_abs_2508_05128
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Attention Basin: Why Contextual Position Matters in Large Language Models
Yi, Zihao
Zeng, Delong
Ling, Zhenqing
Luo, Haohao
Xu, Zhe
Liu, Wei
Luan, Jian
Cao, Wanxia
Shen, Ying
Computation and Language
Artificial Intelligence
The performance of Large Language Models (LLMs) is significantly sensitive to the contextual position of information in the input. To investigate the mechanism behind this positional bias, our extensive experiments reveal a consistent phenomenon we term the attention basin: when presented with a sequence of structured items (e.g., retrieved documents or few-shot examples), models systematically assign higher attention to the items at the beginning and end of the sequence, while neglecting those in the middle. Crucially, our analysis further reveals that allocating higher attention to critical information is key to enhancing model performance. Based on these insights, we introduce Attention-Driven Reranking (AttnRank), a two-stage framework that (i) estimates a model's intrinsic positional attention preferences using a small calibration set, and (ii) reorders retrieved documents or few-shot examples to align the most salient content with these high-attention positions. AttnRank is a model-agnostic, training-free, and plug-and-play method with minimal computational overhead. Experiments on multi-hop QA and few-shot in-context learning tasks demonstrate that AttnRank achieves substantial improvements across 10 large language models of varying architectures and scales, without modifying model parameters or training procedures.
title Attention Basin: Why Contextual Position Matters in Large Language Models
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2508.05128