迷失在证据中?重现RAG中的文档位置和上下文大小效应
Lost in the Evidence? Reproducing Document Position and Context Size Effects in RAG
AI总结:
本文通过系统可重复性研究,分析了检索增强生成中文档排序和上下文大小的影响,提出了主题采样校准方法,并揭示了理想设置与现实RAG管道之间的差异。
摘要:
检索增强生成(RAG)系统依赖于将检索到的文档拼接成模型的输入上下文,这使得文档排序和上下文大小成为关键但有争议的设计选择。先前的工作报告了基于位置的影响,例如中间丢失和相关长上下文现象。然而,实证结果仍然不一致,且难以在不同模型、数据集和评估协议中重现。在本文中,我们提出了一项系统的可重复性研究,重新审视这些主张,并检查它们在受控评估框架下如何随当代LLM演变。我们首先表明主题采样是方差的主要来源:小的主题集可能掩盖或夸大排序效应。基于多个主题预算下的重复子集采样,我们提供了一种实用的校准程序,以可承受的成本识别出产生稳定趋势的主题数量。使用这些固定的主题集,我们重现并扩展了关于位置敏感性的结果,重新评估了现代LLM中的中间丢失和位置偏差。然后,我们还研究了一个更现实的RAG场景,其中相关性由检索器而非真实文档的oracle访问来中介。在这种设置下,我们重新审视了最近的一项行业研究,并识别出与评估选择(如有限的主题覆盖和依赖基于LLM的评判者)的差异。最后,我们分析了在非完美检索下,检索顺序和上下文大小如何影响下游LLM性能。我们的结果表明,这两个因素都与检索质量和模型选择强烈交互,并且从理想化设置中得出的结论并不总是适用于现实世界的RAG管道。我们发布所有代码和配置,以支持可重复性和未来关于稳健RAG评估的工作。
英文摘要:
Retrieval-Augmented Generation (RAG) systems rely on retrieved documents being concatenated into a model's input context, making both document ordering and context size critical yet controversial design choices. Prior work reports position-based effects such as lost in the middle and related long-context phenomena. However, empirical findings remain inconsistent and hard to reproduce across models, datasets, and evaluation protocols. In this paper, we present a systematic reproducibility study that revisits these claims and examines how they evolve with contemporary LLMs under a controlled evaluation framework. We first show that topic sampling is a major source of variance: small topic sets can mask or exaggerate ordering effects. Based on repeated subset sampling across multiple topic budgets, we provide a practical calibration procedure that identifies topic counts yielding stable trends at feasible cost. Using these fixed topic sets, we then reproduce and extend results on position sensitivity, re-evaluating lost in the middle and positional biases in modern LLMs. Then, we also study a more realistic RAG scenario in which relevance is mediated by a retriever rather than oracle access to ground-truth documents. In this setting, we re-examine a recent industry study and identify discrepancies to evaluation choices such as limited topic coverage and reliance on LLM-based judges. Finally, we conduct an analysis of how retrieval order and context size affect downstream LLM performance under imperfect retrieval. Our results demonstrate that both factors interact strongly with retrieval quality and model choice, and that conclusions drawn from idealised setups do not always transfer to real-world RAG pipelines. We release all code and configurations to support reproducibility and future work on robust RAG evaluation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。