{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/co-evolving-llm-coder-and-unit-tester-via","title":"Co-Evolving LLM Coder and Unit Tester via Reinforcement Learning","arxiv_id":"2506.03136","date":"2025-06-03","proceeding":null,"authors":["Yinjie Wang","Ling Yang","Ye Tian","Ke Shen","Mengdi Wang"],"abstract":"We propose CURE, a novel reinforcement learning framework with a dedicated reward design that co-evolves coding and unit test generation capabilities based on their interaction outcomes, without any ground-truth code as supervision. This approach enables flexible and scalable training and allows the unit tester to learn directly from the coder's mistakes. Our derived ReasonFlux-Coder-7B and 14B models improve code generation accuracy by 5.3% and Best-of-N accuracy by 9.0% after optimization on Qwen2.5-Instruct models, outperforming similarly sized Qwen-Coder, DeepSeek-Coder, and Seed-Coder. They naturally extend to downstream tasks such as test-time scaling and agentic coding-achieving a 8.1% improvement over the base model. For the long-CoT model, our ReasonFlux-Coder-4B consistently outperforms Qwen3-4B while achieving 64.8% inference efficiency in unit test generation. Notably, we also find that our model can serve as an effective reward model for reinforcement learning on base models. Project: https://github.com/Gen-Verse/CURE","url_abs":"https://arxiv.org/abs/2506.03136v1","url_pdf":"https://arxiv.org/pdf/2506.03136v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"co-evolving-llm-coder-and-unit-tester-via","repo_url":"https://github.com/gen-verse/cure","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"co-evolving-llm-coder-and-unit-tester-via","repo_url":"https://github.com/gen-verse/reasonflux","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"reinforcement-learning","task_name":"Reinforcement Learning"},{"task_slug":"reinforcement-learning-2","task_name":"reinforcement-learning"}],"methods":[{"method_slug":"base","method_name":"BASE"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2506.03136","atlas_url":"https://app.syntology.ai/?focus=2506.03136","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2506.03136"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gen-verse/reasonflux","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gen-verse/cure","reach":{"status":"ok"}}],"summary":{"ran_fixture":2},"by_repo_kind":{"listed":{"samples":2,"ran":2,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":2,"samples":[{"code_sha256_prefix":"6a5a28d88ac40c6d","entry":"agg_loss","repo":"gen-verse/reasonflux","repo_kind":"listed","path":"ReasonFlux_PRM/Application/verl/trainer/ppo/core_algos.py","file_url":"https://github.com/gen-verse/reasonflux/blob/HEAD/ReasonFlux_PRM/Application/verl/trainer/ppo/core_algos.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6a5a28d88ac40c6d"}},{"code_sha256_prefix":"2e7d046b997dddca","entry":"compute_policy_loss","repo":"gen-verse/reasonflux","repo_kind":"listed","path":"ReasonFlux_PRM/Application/verl/trainer/ppo/core_algos.py","file_url":"https://github.com/gen-verse/reasonflux/blob/HEAD/ReasonFlux_PRM/Application/verl/trainer/ppo/core_algos.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2e7d046b997dddca"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}