Abstract
Large Language Models (LLMs) exhibit positional bias, struggling to utilize information from the middle or end of long contexts. Our study explores LLMs’ long-context reasoning by probing their hidden representations. We find that while LLMs encode the position of target information, they often fail to leverage this in generating accurate responses. This reveals a disconnect between information retrieval and utilization, a “know but don’t tell” phenomenon. We further analyze the relationship between extraction time and final accuracy, offering insights into the underlying mechanics of transformer models.
Introduction
As context windows for Large Language Models (LLMs) expand to accommodate hundreds of thousands of tokens, a persistent flaw has emerged: the "lost in the middle" phenomenon. Models demonstrate high proficiency at retrieving information from the extreme beginning or end of a prompt but frequently fail when the target information is situated in the center. This research investigates whether this failure stems from an inability to "see" the information during initial processing or a disconnect during the final response generation phase.
Methodology
To investigate the internal state of LLMs, researchers at Johns Hopkins University employed layer-wise probing. This technique involves training simple linear classifiers (probes) to examine the hidden representations at every transformer layer. The primary task for these probes was to predict the position (ID) of the "gold" information—the specific key-value pair or document required to answer a prompt.
The study utilized two primary benchmarks:
- Key-Value (KV) Pairs Retrieval: A synthetic task involving a list of 100 UUID pairs.
- Multi-Document Question Answering (MDQA): A natural language task requiring the model to identify an answer within 30 provided documents.
Experiments were conducted on LLaMa3-8B-Instruct, Mistral-7B-Instruct-v0.3, and Gemma-7b-it.
The "Know but Don't Tell" Phenomenon
The headline finding of this study is the "Know but Don't Tell" phenomenon. Internal probes frequently identified the location of target information with near 100% accuracy, even in instances where the model failed to generate the correct answer. This suggests that the information is successfully encoded within the model's hidden layers but is not effectively utilized during the generation step.
Key Insights
- Positional Latency: Information located in the middle of a context requires significantly more layers of processing to be "located" internally compared to information at the edges. For MDQA, models typically needed to reach Layer 13 or higher for middle-context information, whereas edge information was identified by Layer 5.
- The "Early Bird" Advantage: There is a statistically significant correlation (p-value < 5e-5) between early internal identification and final generation accuracy. If a model locates the target information in its early layers, it is far more likely to produce a correct response.
- Information Degradation: In some models, internal knowledge of the information's location peaks in middle layers and subsequently decreases, suggesting a form of internal "forgetting" or distraction before the final output is generated.
Conclusion and Future Work
While this research confirms that LLMs internally locate target information even when they fail to report it, the exact mechanism of this communication failure remains to be fully mapped. Future work should focus on mechanistic interpretability to identify specific attention heads responsible for this disconnect and develop intervention methods to "force" models to attend to the information already present in their hidden states. Such insights could lead to improved training objectives that specifically target the utilization of middle-context information.
Summary updated