并非所有RAG都同等有效:面向软件工程任务的组件级实证研究
Not All RAGs Are Created Equal: A Component-Wise Empirical Study for Software Engineering Tasks
AI总结:
本文通过实证研究分析RAG组件对软件工程任务的影响,发现检索端组件尤其是检索算法对系统性能影响更大,BM25在多种任务中表现稳健。
摘要:
尽管检索增强生成(RAG)被广泛用于将大型语言模型(LLMs)与软件 artifacts 结合,但其组件的最优配置仍是一个开放问题。本文进行了一项全面的组件级实证研究,分析了RAG流程,评估了超过21种不同的模型和方法。我们的研究系统地隔离并评估了4种查询处理技术、7种覆盖稀疏、密集和混合范式的检索模型、4种上下文细化方法以及6种不同的生成器。我们测试了这些组件在三个核心软件工程任务(代码生成、摘要和修复)上的表现。我们的实证发现揭示了一个关键见解:检索端组件,特别是检索算法的选择,往往对最终系统性能的影响比生成器模型的选择更大。令人惊讶的是,经典词法检索器BM25在各种任务中表现出异常稳健的性能。我们的分析为研究人员和实践者提供了实用的数据驱动路线图,提供了在构建有效的软件工程RAG系统时优先优化努力的明确指导。
英文摘要:
While Retrieval-Augmented Generation (RAG) is increasingly adopted to ground Large Language Models (LLMs) in software artifacts, the optimal configuration of its components remains an open question for software engineering (SE) tasks. The lack of systematic guidance forces practitioners into costly, ad-hoc experimentation. This paper presents a comprehensive, component-wise empirical study that dissects the RAG pipeline, evaluating over 21 distinct models and methods. Our study systematically isolates and evaluates 4 query processing techniques, 7 retrieval models spanning sparse, dense, and hybrid paradigms, 4 context refinement methods, and 6 distinct generators. We test these components on a suite of 3 core SE tasks: code generation, summarization, and repair. Our empirical findings reveal a crucial insight: the retriever-side components, particularly the choice of the retrieval algorithm, often exert a more significant influence on final system performance than the selection of the generator model. Strikingly, the classic lexical retriever BM25 demonstrates exceptionally robust performance across diverse tasks. Our analysis provides a practical, data-driven roadmap for researchers and practitioners, offering clear guidance on prioritizing optimization efforts when constructing effective RAG systems for software engineering contexts.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。