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

CoSQA+: 以测试驱动代理开创多选代码搜索基准

CoSQA+: Pioneering the Multi-Choice Code Search Benchmark with Test-Driven Agents

School of Software Engineering, Sun Yat-sen University(中山大学软件学院)

Jing Gong, Yanghui Wu, Linxi Liang, Yanlin Wang, Jiachi Chen, Mingwei Liu, Zibin Zheng

AI总结:

CoSQA+通过测试驱动代理开创多选代码搜索基准,利用高质查询与多个合适代码配对,提升代码搜索准确率至93.9%。

摘要:

语义代码搜索,即根据给定的自然语言查询检索代码,是提高软件工程生产力的重要任务。现有代码搜索数据集面临限制:它们依赖于人类标注者,通过语义理解而非功能验证来评估代码,导致潜在的不准确性和可扩展性问题。此外,当前评估指标往往忽视了代码搜索的多选特性。本文介绍了CoSQA+,将高质量的CoSQA查询与多个合适的代码配对。我们开发了一个自动化流程,包含多个基于模型的候选选择和新颖的测试驱动代理标注系统。在单个大语言模型(LLM)标注者和Python专家标注者(无测试驱动验证)之间,代理利用测试驱动验证,实现了93.9%的最高准确率。通过广泛的实验,CoSQA+在质量上优于CoSQA。在CoSQA+上训练的模型表现出改进的性能。我们公开发布包含412,080个代理标注对的CoSQA+_all和包含1,000个经人类验证对的CoSQA+_verified,网址为https://github.com/DeepSoftwareAnalytics/CoSQA_Plus。

英文摘要:

Semantic code search, retrieving code that matches a given natural language query, is an important task to improve productivity in software engineering. Existing code search datasets face limitations: they rely on human annotators who assess code primarily through semantic understanding rather than functional verification, leading to potential inaccuracies and scalability issues. Additionally, current evaluation metrics often overlook the multi-choice nature of code search. This paper introduces CoSQA+, pairing high-quality queries from CoSQA with multiple suitable codes. We develop an automated pipeline featuring multiple model-based candidate selections and the novel test-driven agent annotation system. Among a single Large Language Model (LLM) annotator and Python expert annotators (without test-based verification), agents leverage test-based verification and achieve the highest accuracy of 93.9%. Through extensive experiments, CoSQA+ has demonstrated superior quality over CoSQA. Models trained on CoSQA+ exhibit improved performance. We publicly release both CoSQA+_all, which contains 412,080 agent-annotated pairs, and CoSQA+_verified, which contains 1,000 human-verified pairs, at https://github.com/DeepSoftwareAnalytics/CoSQA_Plus.

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

↑