发现大模型对输入位置有偏见,提出重排策略提升性能
Attention Basin: Why Contextual Position Matters in Large Language Models

- 通过校准集识别模型偏好位置,重排输入内容
- 在多跳问答和少样本学习中显著提升10种模型表现
- 无需训练、可插拔,适合所有主流大模型使用
大型语言模型的性能对输入信息的上下文位置极为敏感。我们通过大量实验发现一种称为‘注意力盆地’的现象:当输入结构化项目序列(如检索文档或少样本示例)时,模型会系统性地给予序列开头和结尾更高的注意力,而忽略中间内容。分析表明,将关键信息置于高注意力位置是提升性能的关键。基于此,我们提出注意力驱动重排(AttnRank),一种两阶段框架:(i) 使用小规模校准集估计模型内在的位置注意力偏好;(ii) 重排检索文档或少样本示例,使重要内容对齐高注意力位置。AttnRank 是模型无关、无需训练、可即插即用的方法,计算开销极低。在多跳问答和少样本上下文学习任务中,其在10种不同架构与规模的大模型上均实现显著提升,且不修改模型参数或训练流程。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。