How Retrieved Context Shapes Internal Representations in RAG
Samuel Yeh, Sharon Li

TL;DR
This paper investigates how retrieved external documents influence the internal representations of large language models in retrieval-augmented generation, revealing insights into context relevance and processing layers.
Contribution
It provides a systematic analysis of how different retrieved documents affect LLM internal states and their relation to output behavior in RAG systems.
Findings
Context relevancy impacts internal representations.
Layer-wise processing varies with document relevance.
Internal shifts correlate with downstream generation quality.
Abstract
Retrieval-augmented generation (RAG) enhances large language models (LLMs) by conditioning generation on retrieved external documents, but the effect of retrieved context is often non-trivial. In realistic retrieval settings, the retrieved document set often contains a mixture of documents that vary in relevance and usefulness. While prior work has largely examined these phenomena through output behavior, little is known about how retrieved context shapes the internal representations that mediate information integration in RAG. In this work, we study RAG through the lens of latent representations. We systematically analyze how different types of retrieved documents affect the hidden states of LLMs, and how these internal representation shifts relate to downstream generation behavior. Across four question-answering datasets and three LLMs, we analyze internal representations under…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
