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

EvolveCoder: Evolving Test Cases via Adversarial Verification for Code Reinforcement Learning

Chi Ruan, Dongfu Jiang, Huaye Zeng, Ping Nie, Wenhu ChenarXiv 2026

TL;DR

Reinforcement Learning with Verifiable Rewards (RLVR) is a powerful paradigm for training coding LLMs, but it is heavily bottlenecked by weak, static test suites that fail to challenge models effectively. EvolveCoder solves this by introducing a solution-conditioned, adversarial framework that iteratively evolves test cases based on the actual execution behaviors of candidate solutions. By training on the resulting EVOLVECODER-22K dataset, a 4B-scale model achieves a 4.2-point average improvement across major downstream benchmarks, outperforming much larger baselines.

What Problem Does This Paper Address?

When training Large Language Models (LLMs) for code generation, standard reinforcement learning relies on executing unit tests to provide binary reward signals (pass/fail). However, existing coding RL datasets suffer from three major flaws:

  1. Weak Discriminative Power: Human-annotated test suites often miss edge cases, allowing partially correct or buggy code to pass.
  2. High Redundancy: Automated test augmentation methods often generate thousands of randomized inputs that test the exact same code paths, leading to high computational costs during RL training.
  3. Static Nature: Single-pass generative pipelines create test cases based purely on the problem description or a single reference solution, rather than targeting the specific failure modes of the models being trained.

This mismatch leads to a "vanishing advantage" issue: if problems are too easy or too hard under the current test suite, the RL algorithm cannot differentiate between good and bad policy rollouts, causing training stagnation.

Methods

EvolveCoder introduces a progressive, multi-round test case refinement pipeline that alternates between adversarial and discriminative test generation.

Figure 3: EVOLVECODER-22K Construction Pipeline

The pipeline operates as follows:

  • Diverse Solution Sampling: Instead of relying on a single reference solution, the authors sample 64 candidate solutions per problem from 8 distinct open-source reasoning models (including the Qwen3 family, Phi-4-Reasoning, and DeepSeek-R1-Distill). This exposes a wide variety of logical errors and coding styles.
  • Adversarial Test Case Generation: The framework evaluates all candidate solutions against the current test suite to build a pass/fail matrix. It filters out trivial tests that everyone passes. It then prompts an LLM to generate new assert-based tests specifically targeting the highest-performing solutions that still exhibit subtle variations in behavior.
  • Discriminative Test Case Generation: To separate solutions that look identical under current tests, the framework groups behaviorally overlapping programs and generates new tests under a strict split constraint—meaning the new test must be passed by at least one solution and failed by at least one other.
  • Test Suite Filtering: To keep RL training computationally tractable, a final filtering step removes tests with extremely low pass rates (<10%) and deduplicates tests with identical pass/fail vectors across the solution pool.

Datasets

The authors aggregate and refine data from five public repositories: TACO, APPS, Synthetic-1 (PrimeIntellect), Codeforces, and CodeContests.

To prevent data contamination and distribution distortion, they perform semantic-level deduplication using dense sentence embeddings (all-mpnet-base-v2), discarding problem pairs with a cosine similarity greater than 0.9.

The final dataset, EVOLVECODER-22K, contains 21,642 refined programming problems. Through three rounds of evolution, the average number of test cases per problem scales up dramatically from 10.76 to 35.04.

For evaluation, the models are tested on four downstream benchmarks: EvalPlus, BigCodeBench-Instruct, Aider-Polyglot, and LiveCodeBench v5.

Key Insights and Ideas

  • Solution-Conditioned over Reference-Conditioned: Traditional test generation looks only at the problem statement or a golden reference solution. EvolveCoder's core insight is that candidate solutions and their execution behaviors directly reveal which aspects of program semantics remain unchallenged.
  • Driving Down Pass Rates Productively: As the test cases evolve across rounds, the pass@1 rate of the candidate solution pool drops monotonically from 43.80 to 31.22. This drop doesn't mean the models got worse; it proves the test suites successfully uncovered latent bugs and edge-case failures that previous test suites missed.
Figure 4: Difficulty evolution across rounds.
  • The Power of the Split Constraint: The discriminative generation strategy (Method 2) yields higher test retention rates after filtering compared to pure adversarial generation. Forcing the LLM to find a test that splits a pair of similar programs is a highly efficient way to generate high-quality, non-redundant verification signals.

Key Results

The authors fine-tuned a Qwen3-4B (Thinking) base model using Group Relative Policy Optimization (GRPO) on the EVOLVECODER-22K dataset.

  • Consistent Downstream Gains: The final model, EVOLVECODER-4B (r3), achieved an average score of 49.0 across the four downstream benchmarks, marking a +4.2 point improvement over the base Qwen3-4B model.
  • Outperforming Strong Baselines: It outperformed Critique-Coder-4B (the previous state-of-the-art 4B coding model) by 1.8 points on average and remained highly competitive with significantly larger models, such as the 238B-parameter DeepSeek-V2.5.
  • Ablation Validation: Models trained on Round 3 data consistently achieved higher performance and more stable optimization curves than models trained on Round 0 or Round 1 data, validating the necessity of multi-round test evolution.

Limitations and Future Work

  • No Formal Correctness Guarantees: Because the pipeline relies on LLMs to generate both the rewritten problem specifications and the new test cases, there is a small chance of introducing ambiguous problem descriptions or incorrect test ground truths that went undetected by the filtering heuristics.
  • Restricted to Python: The current infrastructure is entirely built around Python due to its mature sandboxing and execution tooling. Extending this adversarial verification loop to compiled languages (like C++ or Java) or multi-file repository-level environments remains an open challenge for future work.

Summary updated

BibTeX
@misc{ruan2026evolvecoder,
  author = {Chi Ruan and Dongfu Jiang and Huaye Zeng and Ping Nie and Wenhu Chen},
  title = {{EvolveCoder: Evolving Test Cases via Adversarial Verification for Code Reinforcement Learning}},
  year = {2026},
  eprint = {2603.12698},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.12698},
}
Figure