ChatPaper.aiChatPaper

Bacino di Attenzione: Perché la Posizione Contestuale è Importante nei Modelli Linguistici di Grande Scala

Attention Basin: Why Contextual Position Matters in Large Language Models

August 7, 2025
Autori: Zihao Yi, Delong Zeng, Zhenqing Ling, Haohao Luo, Zhe Xu, Wei Liu, Jian Luan, Wanxia Cao, Ying Shen
cs.AI

Abstract

Le prestazioni dei Large Language Model (LLM) sono significativamente sensibili alla posizione contestuale delle informazioni nell'input. Per indagare il meccanismo alla base di questo bias posizionale, i nostri ampi esperimenti rivelano un fenomeno consistente che abbiamo denominato "attention basin": quando viene presentata una sequenza di elementi strutturati (ad esempio, documenti recuperati o esempi few-shot), i modelli assegnano sistematicamente un'attenzione maggiore agli elementi all'inizio e alla fine della sequenza, trascurando quelli nel mezzo. In modo cruciale, la nostra analisi rivela ulteriormente che l'allocazione di un'attenzione maggiore alle informazioni critiche è fondamentale per migliorare le prestazioni del modello. Sulla base di queste intuizioni, introduciamo l'Attention-Driven Reranking (AttnRank), un framework a due fasi che (i) stima le preferenze intrinseche di attenzione posizionale di un modello utilizzando un piccolo set di calibrazione, e (ii) riordina i documenti recuperati o gli esempi few-shot per allineare il contenuto più rilevante con queste posizioni ad alta attenzione. AttnRank è un metodo model-agnostic, privo di addestramento e plug-and-play, con un sovraccarico computazionale minimo. Gli esperimenti su task di multi-hop QA e few-shot in-context learning dimostrano che AttnRank ottiene miglioramenti sostanziali su 10 grandi modelli linguistici con architetture e scale diverse, senza modificare i parametri del modello o le procedure di addestramento.
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.
PDF42August 8, 2025