Retrieval-Augmented Generation (RAG) has recently emerged as a method to extend beyond the pre-trained knowledge of Large Language Models by augmenting the original prompt with relevant passages or documents retrieved by an Information Retrieval (IR) system. RAG has become increasingly important for Generative AI solutions, especially in enterprise settings or in any domain in which knowledge is constantly refreshed and cannot be memorized in the LLM. We argue here that the retrieval component of RAG systems, be it dense or sparse, deserves increased attention from the research community, and accordingly, we conduct the first comprehensive and systematic examination of the retrieval strategy of RAG systems. We focus, in particular, on the type of passages IR systems within a RAG solution should retrieve. Our analysis considers multiple factors, such as the relevance of the passages included in the prompt context, their position, and their number. One counter-intuitive finding of this work is that the retriever's highest-scoring documents that are not directly relevant to the query (e.g., do not contain the answer) negatively impact the effectiveness of the LLM. Even more surprising, we discovered that adding random documents in the prompt improves the LLM accuracy by up to 35%. These results highlight the need to investigate the appropriate strategies when integrating retrieval with LLMs, thereby laying the groundwork for future research in this area.
翻译:检索增强生成(RAG)近期作为一种扩展大语言模型预训练知识的方法而出现,其通过信息检索系统检索到的相关段落或文档来增强原始提示。RAG对于生成式AI解决方案日益重要,尤其在知识不断更新且无法被大语言模型记忆的企业环境或任何领域中。本文认为,RAG系统的检索组件(无论是密集检索还是稀疏检索)应获得研究界更多关注,并据此首次对RAG系统的检索策略进行了全面系统的研究。我们特别关注RAG解决方案中信息检索系统应检索的段落类型。我们的分析考虑了多个因素,如提示上下文中所包含段落的关联性、位置及数量。本研究的一个反直觉发现是:检索器得分最高但与查询不直接相关(例如不包含答案)的文档会降低大语言模型的有效性。更令人意外的是,我们发现向提示中添加随机文档可使大语言模型的准确率提升高达35%。这些结果凸显了整合检索与大语言模型时需探究适当策略的必要性,从而为该领域的未来研究奠定基础。