NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CoRe-Code: Collaborative Reinforcement Learning for Code Generation

Zhihao Dou, Qinjian Zhao, Zhongwei Wan, Xiaoyu Xia, Sumon BiswasarXiv 2026

TL;DR

CoRe-Code introduces a collaborative reinforcement learning framework that optimizes multi-agent large language models (LLMs) for code generation. By combining a structured "Algorithmic Thought" planning process with a two-stage Group Relative Policy Optimization (GRPO) alignment strategy, CoRe-Code ensures that specialized Planner and Coder agents work in harmony, significantly boosting code correctness, execution speed, and memory efficiency.

What Problem Does This Paper Address?

While LLMs are remarkably capable at writing code, they typically generate programs token-by-token in an autoregressive fashion. This lack of global planning often leads to code that is locally coherent but globally flawed—resulting in failed edge cases or horribly inefficient algorithms.

To fix this, researchers have turned to Chain-of-Thought (CoT) prompting and Multi-Agent Systems (MAS). However, the authors of this paper identify a major bottleneck: existing multi-agent frameworks suffer from poor coordination and weak role specialization. To prove this, they introduce a metric called Collaboration Gain (CG), which quantifies how much auxiliary agents actually help the core Coder agent. Alarmingly, they discover that traditional multi-agent systems often yield minimal or even negative collaboration gains because the agents are not properly aligned to support one another.

Figure 1: (a) CoT for code generation. (b) CoRe-Code for code generation. (c) Comparison with different multi-agent systems for code generation. (d) Collaboration Gain values across different models. Both (c) and (d) use Qwen2.5-7B-Coder-Instruct as the base model. More examples can be found in Appendix E.4.

Methods

CoRe-Code tackles the coordination problem using a clean Planner–Coder paradigm backed by a novel two-stage reinforcement learning framework.

  1. Algorithmic Thought (Structured Planning): Instead of letting the Planner agent output loose pseudocode, CoRe-Code enforces a strict, code-oriented structure called Algorithmic Thought. This breaks the plan down into four explicit components: input-output definitions, linear progression, conditional logic, and iterations.
  2. Collaborative GRPO (Two-Stage RL): Directly evaluating whether a high-level plan is "good" is incredibly difficult in isolation. CoRe-Code solves this by using downstream code-execution results as verifiable rewards to train both agents sequentially:
  3. Stage 1: Planner RL. The Planner is optimized while the Coder remains frozen. The Planner receives rewards based on the accuracy (test cases passed) and time complexity of the code that the Coder generates using that plan.
  4. Stage 2: Coder RL. The Coder is optimized while the Planner remains frozen. The Coder is rewarded for accurately implementing the plan while minimizing space complexity (monitored via memory usage tracking).
Figure 2: Overview of CoRe-Code. (a) The Planner agent is optimized to generate effective algorithmic thoughts, while (b) the Coder agent is optimized to translate the given thought into correct and efficient code.

Datasets

The authors evaluated CoRe-Code across four prominent benchmarks representing different tiers of difficulty:

  • LiveBench & MBPP: Focused on basic, function-level programming tasks.
  • CodeContests & CodeForces: Focused on complex, competitive-level programming problems that demand advanced algorithmic design.

Training was conducted using 15,000 open-source code generation training samples.

Key Insights and Ideas

  • Verifiable Rewards for Abstract Plans: One of the paper's core "aha!" moments is grounding the Planner's optimization entirely in the Coder's execution success. If a plan looks elegant but causes the Coder to output buggy or slow code, the framework penalizes the plan. This eliminates the "proxy-reward mismatch" common in other RL methods.
  • True Synergy via Joint Training: As shown in the training dynamics, the Collaboration Gain steadily climbs across different base models during RL training. This demonstrates that multi-agent systems don't inherently collaborate well out of the box; they must be explicitly trained to cooperate.
  • Multi-Objective Optimization: By factoring execution runtime into the Planner's reward and memory consumption into the Coder's reward, the framework optimizes for holistic software engineering quality rather than just blindly passing test cases.

Key Results

CoRe-Code was tested using three open-source base models: Qwen2.5-7B-Coder-Instruct, Qwen2.5-14B-Coder-Instruct, and Qwen3-4B.

  • State-of-the-Art Accuracy: CoRe-Code consistently outperformed representative RL baselines (like GRPO and Focused-DPO) and multi-agent baselines (like Reflexion and MapCoder) across all benchmarks. For instance, on LiveBench using the Qwen2.5-14B base model, CoRe-Code achieved a 48.4% Pass@1 score, outperforming standard GRPO (45.5%).
  • Enhanced Efficiency: Code generated by CoRe-Code demonstrated lower average runtimes, reduced memory usage, and lower cyclomatic complexity (meaning the code is cleaner and easier to maintain).
  • Flexibility and Scalability: The authors successfully extended CoRe-Code's RL framework to other multi-agent architectures, independently reinforcing Retrieval and Debugging agents within the MapCoder framework to achieve further performance gains.

Limitations and Future Work

While CoRe-Code delivers impressive results, the authors note a few limitations:

  • Model and Benchmark Scope: The evaluation was restricted to a specific selection of open-source models and benchmarks. Future work should explore how well this framework generalizes to other proprietary or diverse model families.
  • Fixed Interaction Formats: The current framework relies on a rigid, sequential Planner-Coder interaction. Exploring more fluid, multi-turn communication styles or alternative prompting templates could unlock even higher collaborative efficiency.

Summary updated

BibTeX
@misc{dou2026core,
  author = {Zhihao Dou and Qinjian Zhao and Zhongwei Wan and Xiaoyu Xia and Sumon Biswas},
  title = {{CoRe-Code: Collaborative Reinforcement Learning for Code Generation}},
  year = {2026},
  eprint = {2605.24812},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.24812},
}
Figure