arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.13464cs.SEcs.CL
收藏

GenX:通过执行反馈掌握代码与测试生成

GenX: Mastering Code and Test Generation with Execution Feedback

OPPO AI Center(OPPO人工智能中心)

Nan Wang, Yafei Liu, Chen Chen, Haonan Lu

AI总结:

提出一种利用执行反馈同时训练代码生成模型和测试生成模型的新方法,通过数据增强和新评分函数提升性能,在APPS数据集上表现优于原始数据集训练的模型。

摘要:

语言建模的最新进展使得将自然语言转换为代码成为可能,并能够利用执行反馈来改进代码生成。然而,这些方法通常严重依赖预先存在的测试用例,而这些测试用例可能并不总是可用或不够全面。在这项工作中,我们提出了一种新方法,该方法同时训练代码生成模型和测试生成模型,利用执行反馈来改进和增强两者的性能。我们引入了两种用于测试和代码数据增强的策略,以及一种用于代码和测试排序的新评分函数。我们在 APPS 数据集上进行实验,证明我们的方法能够有效地生成和增强测试用例,过滤和合成正确的代码解决方案,并对生成的代码和测试的质量进行排序。结果表明,当我们的模型使用不断增加的测试用例和代码解决方案进行迭代训练时,其性能优于在原始数据集上训练的模型。

英文摘要:

Recent advancements in language modeling have enabled the translation of natural language into code, and the use of execution feedback to improve code generation. However, these methods often rely heavily on pre-existing test cases, which may not always be available or comprehensive. In this work, we propose a novel approach that concurrently trains a code generation model and a test generation model, utilizing execution feedback to refine and enhance the performance of both. We introduce two strategies for test and code data augmentation and a new scoring function for code and test ranking. We experiment on the APPS dataset and demonstrate that our approach can effectively generate and augment test cases, filter and synthesize correct code solutions, and rank the quality of generated code and tests. The results demonstrate that our models, when iteratively trained with an increasing number of test cases and code solutions, outperform those trained on the original dataset.

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

↑