ChatPaper.aiChatPaper

Co-Evoluzione di Codificatore LLM e Tester di Unità tramite Apprendimento per Rinforzo

Co-Evolving LLM Coder and Unit Tester via Reinforcement Learning

June 3, 2025
Autori: Yinjie Wang, Ling Yang, Ye Tian, Ke Shen, Mengdi Wang
cs.AI

Abstract

Proponiamo CURE, un innovativo framework di apprendimento per rinforzo con un design dedicato delle ricompense che co-evolve le capacità di generazione di codice e di test unitari basandosi sui risultati della loro interazione, senza alcun codice di riferimento come supervisione. Questo approccio consente un addestramento flessibile e scalabile e permette al tester unitario di apprendere direttamente dagli errori del generatore di codice. I nostri modelli derivati ReasonFlux-Coder-7B e 14B migliorano l'accuratezza nella generazione di codice del 5,3% e l'accuratezza Best-of-N del 9,0% dopo l'ottimizzazione sui modelli Qwen2.5-Instruct, superando Qwen-Coder, DeepSeek-Coder e Seed-Coder di dimensioni simili. Essi si estendono naturalmente a task downstream come lo scaling in fase di test e il coding agentico, ottenendo un miglioramento dell'8,1% rispetto al modello base. Per il modello long-CoT, il nostro ReasonFlux-Coder-4B supera costantemente Qwen3-4B raggiungendo un'efficienza inferenziale del 64,8% nella generazione di test unitari. Inoltre, notiamo che il nostro modello può servire come un efficace modello di ricompensa per l'apprendimento per rinforzo sui modelli base. Progetto: https://github.com/Gen-Verse/CURE
English
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
PDF244June 4, 2025