arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.11058cs.SEcs.AIcs.CLcs.IR
收藏

LLM智能体改进语义代码搜索

LLM Agents Improve Semantic Code Search

Cisco(思科公司);University of Illinois Urbana Champaign(伊利诺伊大学厄巴纳-香槟分校)

Sarthak Jain, Aditya Dora, Ka Seng Sam, Prabhat Singh

AI总结:

本文提出利用RAG驱动的LLM智能体增强用户查询,结合多流集成方法,在CodeSearchNet上显著提升语义代码搜索准确性,Success@10达78.2%。

摘要:

代码搜索是许多程序员在开发问题解决方案时经常需要执行的关键任务。当前方法在面对包含一定歧义的提示或需要相对于代码库额外上下文的提示时,无法准确执行。我们引入了使用检索增强生成(RAG)驱动的智能体将信息注入用户提示的方法,从而为嵌入模型提供更好的输入。通过利用RAG,智能体用来自GitHub仓库的相关细节增强用户查询,使其更具信息量并在上下文上更对齐。此外,我们引入了一种多流集成方法,当与智能体工作流结合时,可以获得改进的检索准确性,我们将其部署在名为repo-rift.com的应用程序上。在CodeSearchNet数据集上的实验结果表明,RepoRift显著优于现有方法,在Success@10上达到78.2%的成功率,在Success@1上达到34.6%的成功率。这项研究在语义代码搜索方面展示了实质性进展,突出了智能体LLM和RAG在增强代码检索系统方面的潜力。

英文摘要:

Code Search is a key task that many programmers often have to perform while developing solutions to problems. Current methodologies suffer from an inability to perform accurately on prompts that contain some ambiguity or ones that require additional context relative to a code-base. We introduce the approach of using Retrieval Augmented Generation (RAG) powered agents to inject information into user prompts allowing for better inputs into embedding models. By utilizing RAG, agents enhance user queries with relevant details from GitHub repositories, making them more informative and contextually aligned. Additionally, we introduce a multi-stream ensemble approach which when paired with agentic workflow can obtain improved retrieval accuracy, which we deploy on application called repo-rift.com. Experimental results on the CodeSearchNet dataset demonstrate that RepoRift significantly outperforms existing methods, achieving an 78.2% success rate at Success@10 and a 34.6% success rate at Success@1. This research presents a substantial advancement in semantic code search, highlighting the potential of agentic LLMs and RAG to enhance code retrieval systems.

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

↑