CoCoEvo: Co-Evolution of Programs and Test Cases to Enhance Code Generation
School of Computer Science and Engineering, Beihang University(北京航空航天大学计算机科学与工程学院);Qingdao Research Institute, Beihang University(北京航空航天大学青岛研究所);Hangzhou Innovation Institute, Beihang University(北京航空航天大学杭州创新研究院);Zhongguancun Laboratory(中关村实验室)
Kefan Li, Yuan Yuan, Hongyue Yu, Tingyu Guo, Shijie Cao
Large Language Models (LLMs) have shown remarkable performance in automated code generation. However, existing approaches often rely heavily on pre-defined test cases, which become impractical in scenarios where such cases are unavailable. While prior works explore filtering techniques between programs and test cases, they overlook the refinement of test cases. To address this limitation, we introduce CoCoEvo, a novel LLM-based co-evolution framework that simultaneously evolves programs and test cases. CoCoEvo eliminates the dependency on pre-defined test cases by generating both programs and test cases directly from natural language problem descriptions and function headers. The framework employs specialized evolutionary operators, including LLM-based crossover and mutation operators for program evolution, along with an additional test case generation operator for test case evolution. Additionally, we propose optimization strategies such as a crossover rate scheduler to balance exploration and convergence, and a multi-objective optimization method for test case selection. Experimental results on multiple state-of-the-art LLMs demonstrate that CoCoEvo surpasses existing methods, achieving state-of-the-art performance in automated code generation and testing. These results underscore the potential of co-evolutionary techniques in advancing the field of automated programming.
Leveraging Generative AI for Enhancing Automated Assessment in Programming Education Contests
University of Bucharest Faculty of Mathematics and Computer Science(布加勒斯大学数学与计算机科学学院);Softbinator Technologies(Softbinator技术公司);Delft University of Technology(代尔夫特理工大学)
本文提出利用生成式 AI 自动生成编程竞赛高质量测试用例的 NLP 方法,并在 OJI、Kilonova.ro 和 IIOT 数据集上验证其可发现隐藏错误、减轻教师负担。
Yanshan University(燕山大学);Peking University(北京大学);The State Key Laboratory of Blockchain and Data Security, Zhejiang University(浙江大学区块链与数据安全全国重点实验室);Aalto University(阿尔托大学)