arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.20091cs.CL

检索上下文如何塑造RAG中的内部表示

How Retrieved Context Shapes Internal Representations in RAG

Department of Computer Science, University of Wisconsin-Madison(威斯康星大学麦迪逊分校计算机科学系)

Samuel Yeh, Sharon Li

AI总结:

研究通过潜在表示分析检索文档类型对LLM隐藏状态的影响,揭示上下文相关性和分层处理对内部表示的影响,为RAG系统设计提供见解。

摘要:

检索增强生成(RAG)通过将生成过程条件化于检索到的外部文档来增强大型语言模型(LLMs),但检索上下文的影响往往非 trivial。在现实检索设置中,检索到的文档集通常包含相关性和有用性各不相同的文档。尽管先前工作主要通过输出行为研究这些现象,但很少有人了解检索上下文如何塑造RAG中介信息整合的内部表示。在本工作中,我们通过潜在表示的视角研究RAG。我们系统地分析了不同类型的检索文档如何影响LLM的隐藏状态,以及这些内部表示变化如何与下游生成行为相关联。在四个问答数据集和三个LLM上,我们分析了受控的单文档和多文档设置下的内部表示。我们的结果揭示了上下文相关性和分层处理如何影响内部表示,为LLM的输出行为提供了解释,并为RAG系统设计提供了见解。

英文摘要:

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 controlled single- and multi-document settings. Our results reveal how context relevancy and layer-wise processing influence internal representations, providing explanations of LLMs' output behaviors and insights for RAG system design.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑