Encontrado en el medio: Calibrar el sesgo de atención posicional mejora la utilización de contextos largos
Found in the Middle: Calibrating Positional Attention Bias Improves Long Context Utilization
June 23, 2024
Autores: 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
Resumen
Los modelos de lenguaje de gran escala (LLMs), incluso cuando están específicamente entrenados para procesar contextos de entrada largos, tienen dificultades para capturar información relevante ubicada en el medio de su entrada. Este fenómeno se ha conocido como el problema de "perdido en el medio". En este trabajo, realizamos tres contribuciones. Primero, nos proponemos entender los factores que causan este fenómeno. Al hacerlo, establecemos una conexión entre el problema de "perdido en el medio" y el sesgo de atención intrínseco de los LLMs: los LLMs exhiben un sesgo de atención en forma de U, donde los tokens al principio y al final de su entrada reciben mayor atención, independientemente de su relevancia. Segundo, mitigamos este sesgo posicional a través de un mecanismo de calibración, llamado "encontrado en el medio", que permite al modelo atender a los contextos de manera fiel según su relevancia, incluso cuando están en el medio. Tercero, demostramos que "encontrado en el medio" no solo logra un mejor rendimiento en la localización de información relevante dentro de un contexto largo, sino que también conduce a una mejora en el rendimiento de la generación aumentada por recuperación (RAG) en diversas tareas, superando a los métodos existentes hasta en 15 puntos porcentuales. Estos hallazgos abren futuras direcciones para comprender el sesgo de atención en los LLMs y sus posibles consecuencias.
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.Summary
AI-Generated Summary