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

CoCoST:基于在线搜索与正确性测试的自动复杂代码生成

CoCoST: Automatic Complex Code Generation with Online Searching and Correctness Testing

Xi’an Jiaotong University(西安交通大学);University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Peking University(北京大学);Microsoft Research(微软研究院)

Xinyi He, Jiaru Zou, Yun Lin, Mengyu Zhou, Shi Han, Zejian Yuan, Dongmei Zhang

AI总结:

针对真实场景下复杂代码生成难题,提出CoCoST框架,通过规划查询的在线搜索和正确性测试进行代码完善,并序列化复杂输入输出及生成测试用例,在DS-1000和ClassEval数据集上显著提升了复杂代码生成质量。

摘要:

大型语言模型通过将自然语言描述转换为可执行代码,彻底改变了代码生成能力。然而,由于结构复杂、存在隐蔽漏洞、对高级数据类型的理解要求以及缺乏补充内容,在真实场景中生成复杂代码仍具挑战。为应对这些挑战,我们引入了CoCoST框架,该框架通过使用规划查询在线搜索更多信息以及进行正确性测试以完善代码,从而增强复杂代码生成。此外,CoCoST对复杂的输入和输出进行序列化以提高理解能力,并生成测试用例以确保对真实应用的适应性。CoCoST通过在DS-1000和ClassEval数据集上的严格实验进行了验证。实验结果表明,CoCoST显著提升了复杂代码生成的质量,突显了其在增强LLMs生成复杂代码实用性方面的潜力。

英文摘要:

Large Language Models have revolutionized code generation ability by converting natural language descriptions into executable code. However, generating complex code within real-world scenarios remains challenging due to intricate structures, subtle bugs, understanding of advanced data types, and lack of supplementary contents. To address these challenges, we introduce the CoCoST framework, which enhances complex code generation by online searching for more information with planned queries and correctness testing for code refinement. Moreover, CoCoST serializes the complex inputs and outputs to improve comprehension and generates test cases to ensure the adaptability for real-world applications. CoCoST is validated through rigorous experiments on the DS-1000 and ClassEval datasets. Experimental results show that CoCoST substantially improves the quality of complex code generation, highlighting its potential to enhance the practicality of LLMs in generating complex code.

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

↑