ChatPaper.aiChatPaper

Trovato nel mezzo: calibrare il bias dell'attenzione posizionale migliora l'utilizzo di contesti lunghi

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

June 23, 2024
Autori: Cheng-Yu Hsieh, Yung-Sung Chuang, Chun-Liang Li, Zifeng Wang, Long T. Le, Abhishek Kumar, James Glass, Alexander Ratner, Chen-Yu Lee, Ranjay Krishna, Tomas Pfister
cs.AI

Abstract

I grandi modelli linguistici (LLM), anche quando specificamente addestrati per elaborare contesti di input lunghi, faticano a catturare le informazioni rilevanti situate nel mezzo del loro input. Questo fenomeno è stato definito come il problema del "lost-in-the-middle" (perduto nel mezzo). In questo lavoro, forniamo tre contributi. Innanzitutto, ci proponiamo di comprendere i fattori che causano questo fenomeno. Nel farlo, stabiliamo una connessione tra il "lost-in-the-middle" e il bias intrinseco di attenzione degli LLM: gli LLM mostrano un bias di attenzione a forma di U, in cui i token all'inizio e alla fine del loro input ricevono un'attenzione maggiore, indipendentemente dalla loro rilevanza. In secondo luogo, mitigiamo questo bias posizionale attraverso un meccanismo di calibrazione, chiamato "found-in-the-middle" (trovato nel mezzo), che consente al modello di prestare attenzione ai contesti in modo fedele alla loro rilevanza, anche quando si trovano nel mezzo. In terzo luogo, dimostriamo che il "found-in-the-middle" non solo ottiene prestazioni migliori nel localizzare informazioni rilevanti all'interno di un contesto lungo, ma porta anche a un miglioramento delle prestazioni nella generazione aumentata dal recupero (RAG) in vari compiti, superando i metodi esistenti fino a 15 punti percentuali. Questi risultati aprono nuove direzioni future per comprendere il bias di attenzione degli LLM e le sue potenziali conseguenze.
English
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.
PDF61February 8, 2026