arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.07391cs.CLcs.AI
收藏

增强检索增强生成:最佳实践研究

Enhancing Retrieval-Augmented Generation: A Study of Best Practices

University of Tübingen(蒂宾根大学)

Siran Li, Linus Stenzel, Carsten Eickhoff, Seyed Ali Bahrainian

AI总结:

该研究针对RAG系统组件配置影响未被充分探究的问题,开发融合查询扩展、新型检索策略及对比上下文学习的RAG设计,系统分析多类关键因素的影响,为高性能RAG系统开发提供实践指导。

摘要:

检索增强生成(Retrieval-Augmented Generation, RAG)系统近期通过将检索机制集成到语言模型中取得了显著进展,提升了其生成更准确、更具上下文相关性的回复的能力。然而,RAG系统内部各类组件与配置的影响仍未得到充分探究。全面理解这些要素对于让RAG系统适配复杂检索任务、确保其在多样应用中实现最优性能至关重要。本文中,我们开发了数种先进的RAG系统设计,融合了查询扩展、多种新型检索策略,以及一种全新的对比上下文学习RAG(Contrastive In-Context Learning RAG)。我们的研究系统探究了关键影响因素,包括语言模型规模、提示设计、文档分块大小、知识库规模、检索步长、查询扩展技术、对比上下文学习知识库、多语言知识库,以及在句子级检索相关上下文的聚焦模式(Focus Mode)。通过大量实验,我们详细分析了这些因素如何影响回复质量。我们的研究结果为开发RAG系统提供了可落地的洞见,在上下文丰富度与检索-生成效率之间取得平衡,从而为在多样真实场景中构建更具适应性、性能更高的RAG框架铺平了道路。我们的代码与实现细节已公开。

英文摘要:

Retrieval-Augmented Generation (RAG) systems have recently shown remarkable advancements by integrating retrieval mechanisms into language models, enhancing their ability to produce more accurate and contextually relevant responses. However, the influence of various components and configurations within RAG systems remains underexplored. A comprehensive understanding of these elements is essential for tailoring RAG systems to complex retrieval tasks and ensuring optimal performance across diverse applications. In this paper, we develop several advanced RAG system designs that incorporate query expansion, various novel retrieval strategies, and a novel Contrastive In-Context Learning RAG. Our study systematically investigates key factors, including language model size, prompt design, document chunk size, knowledge base size, retrieval stride, query expansion techniques, Contrastive In-Context Learning knowledge bases, multilingual knowledge bases, and Focus Mode retrieving relevant context at sentence-level. Through extensive experimentation, we provide a detailed analysis of how these factors influence response quality. Our findings offer actionable insights for developing RAG systems, striking a balance between contextual richness and retrieval-generation efficiency, thereby paving the way for more adaptable and high-performing RAG frameworks in diverse real-world scenarios. Our code and implementation details are publicly available.

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

↑