arXiv:2602.20091cs.CL2026-02ACL被引 1

研究外接文档如何影响大模型内部表示,揭示检索质量对生成效果的深层机制。

How Retrieved Context Shapes Internal Representations in RAG

  • 通过分析隐藏状态变化,揭示不同相关性文档对模型内部表征的影响
  • 发现上下文相关性和层级处理共同决定模型表征演化路径
  • 为提升RAG系统设计提供可解释性依据,适合模型优化与推理研究者

检索增强生成(RAG)通过将外部文档引入大语言模型(LLM)的生成过程来增强其能力,但检索内容的实际影响往往复杂且非显式。在真实检索场景中,返回的文档集合通常包含相关性与有用性各异的文本。尽管已有研究多从输出行为出发分析该现象,但对检索内容如何塑造中介信息融合的内部表示仍知之甚少。本文从潜在表示视角研究RAG,系统分析不同类型的检索文档如何影响LLM的隐藏状态,并探究这些内部表征变化与下游生成行为之间的关联。在四个问答数据集和三种LLM上,我们控制单文档与多文档情境进行分析。结果揭示了上下文相关性与分层处理对内部表示的影响机制,为理解模型输出行为提供了解释,并为RAG系统设计提供了新洞见。

原文摘要 · Abstract (English)

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.

RAG内部表征大模型检索增强

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。