TL;DR
ZeroCoder is a fully label-free, co-evolutionary reinforcement learning framework that trains a single LLM to simultaneously excel at code generation and test generation without relying on expensive human-curated unit tests. By leveraging self-generated code-test interactions, rank-based data filtering, and a dynamically calibrated Bayesian selector, ZeroCoder achieves performance competitive with oracle-supervised training using as few as 10 labeled instances.
What Problem Does This Paper Address?
Reinforcement Learning with Verifiable Rewards (RLVR) has significantly boosted the code-generation capabilities of Large Language Models (LLMs) by optimizing them against execution-based feedback. However, standard RLVR pipelines suffer from a major bottleneck: they depend heavily on high-quality, human-curated unit tests or reference solutions to act as verifiers. Scaling these ground-truth resources is incredibly expensive and labor-intensive.
While some recent approaches attempt to use self-generated tests to provide rewards, they run into a "weak verifier" problem. Because the underlying model is initially poor at generating rigorous test suites, its self-generated tests lack discriminative power—often allowing buggy or superficial code solutions to pass. This introduces significant noise into the training loop, leading to vanishing gradients or reinforcing incorrect model behaviors.
Methods
ZeroCoder solves this by treating code generation and test generation as dual, mutually reinforcing tasks. A single language model alternates between two roles: a Coder (generating solutions) and a Tester (generating unit tests).
The framework introduces three core techniques to make this label-free co-evolution work:
- Offline Rank-based Pre-filtering: Before training, the model runs a one-time rollout on the dataset to construct a "passing matrix" $E$ (where rows are solutions and columns are tests). ZeroCoder computes the mathematical rank of this matrix and filters out low-rank problems. High rank indicates a diverse, informative interaction structure (i.e., a good mix of tricky edge cases and varied code behaviors), while low rank signifies degenerate, low-information problems where everything simply passes or fails.
- Mutation-Driven Tester Curriculum: To prevent the Tester from generating trivial tests (like
assert True), the authors introduce a mutation-based reward using program mutation testing (via themutmutlibrary). The Tester is rewarded not just for agreeing with likely-correct solutions, but specifically for its ability to "kill" subtly flawed, mutated variants of those solutions. A cosine scheduler gradually shifts the training focus from basic test validity to high discriminative power. - Dynamic Calibration ($DyB^4$): The authors discover a phenomenon called selector drift—as the model evolves, static consensus-based selection rules (like majority voting) become miscalibrated to the shifting error distributions of the Coder and Tester. To fix this, they introduce $DyB^4$, a Bayesian selector that uses a tiny calibration set of just 10 labeled instances to dynamically update its prior assumptions at each training step.
Datasets
- Training: The models were trained on the training split of the APPS dataset (5,000 coding problems).
- Evaluation: Code generation was evaluated across four benchmarks: MBPP, LiveCodeBench (problems from Oct 2024 to Feb 2025), APPS (test set subset), and CodeForces. Test generation was evaluated on LiveCodeBench and MBPP using Test Accuracy and Mutation Score metrics.
Key Insights and Ideas
- The Power of Duality: Instead of freezing a test generator and optimizing the coder, training them simultaneously creates a rising-tide effect. Stronger tests force the coder to write more robust code, and a smarter coder forces the tester to find more nuanced edge cases.
- Matrix Rank as a Quality Proxy: In a completely unsupervised setting, the mathematical rank of an execution matrix serves as an elegant, effective proxy for data informativeness, successfully filtering out dead-weight training samples.
- The Reality of Selector Drift: Fixed heuristic selectors are a hidden liability in co-evolutionary RL. As shown in the paper's analysis, the selection noise of static rules fluctuates wildly and degrades over time, whereas a dynamically calibrated Bayesian approach maintains a low noise rate throughout the entire training lifecycle.
Key Results
ZeroCoder was evaluated across three model families: Qwen2.5-1.5B-Instruct, Qwen3-4B, and Qwen2.5-Coder-7B-Instruct.
- Fully Label-Free Setting: On Qwen2.5-Coder-7B-Instruct, ZeroCoder improved code generation by up to 14.5% and test generation by 15.6% over the base model without using a single human label.
- With Dynamic Calibration ($DyB^4$): When equipped with just 10 labeled calibration examples, the relative performance gains jumped to 21.6% for code generation and 24.3% for test generation.
- Oracle Comparison: Across all tested models, ZeroCoder with $DyB^4$ achieved an average improvement of 18.8% in code generation and 62.7% in test generation, effectively matching the performance of an "Oracle" baseline trained on complete ground-truth solutions and test suites.
Limitations and Future Work
While highly effective, the authors note a few limitations:
- Scale Constraints: Due to computational resource limits, the framework was only validated on models up to 7B parameters. Testing on larger frontier models remains future work.
- Prompting Dependencies: The framework relies on fixed, standard prompt templates. Integrating advanced prompting strategies like Chain-of-Thought (CoT) could potentially yield even higher baselines.
- Proxy Approximations: Matrix rank is an effective proxy for interaction diversity, but it doesn't capture every nuance of supervision quality. Exploring more expressive spectral properties or covariance-based statistics represents a promising future direction.
Summary updated