Co-Evolving LLM Coder and Unit Tester via Reinforcement Learning

Yinjie Wang, Ling Yang, Ye Tian, Ke Shen, Mengdi Wang
6/3/2025
cs.CL

Official code: Gen-Verse/CURE (168 stars, last commit 2025-09-19).

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

View on arXivView PDF

Code Implementations(1)

Gen-Verse/CUREOfficial100%

[NeurIPS 2025 Spotlight] Co-Evolving LLM Coder and Unit Tester via Reinforcement Learning

16815Python, Jupyter NotebookJun 4, 20251 years ago
code-generationllm-coderreinforcement-learning-algorithmsunit-testing

Cite this paper

@article{wang2025coevolving,
  title  = {Co-Evolving LLM Coder and Unit Tester via Reinforcement Learning},
  author = {Yinjie Wang and Ling Yang and Ye Tian and Ke Shen and Mengdi Wang},
  year   = {2025},
  eprint = {2506.03136},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.03136v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.03136.svg)](https://codeofpaper.com/paper/2506.03136)

Discussion