NeFut Logo NeFut
Admin Login

[CS.AI] Robust Code RL via Faulty-Code-Driven Test Case Synthesis and Dense Reward Shaping

Published at: 2026-08-26 22:00 Last updated: 2026-08-29 12:04
#AI #Machine Learning #LLM

Reinforcement learning from verifiable rewards (RLVR) has become a pivotal technique for boosting the code generation ability of large language models (LLMs). Yet, its effectiveness in coding tasks is fundamentally limited by test case coverage; insufficient tests cause false positives, reward hacking, and policy degradation. To alleviate reward bias stemming from sub‑optimal automated generation, we introduce the RobustTests framework.

RobustTests employs a faulty‑code‑driven test case synthesis strategy that leverages “near‑correct” faulty programs to guide the model in pinpointing latent logical discrepancies. In parallel, validator agents equipped with behavioral feature clustering filter out invalid or redundant test cases at a fine‑grained level.

To combat hallucination noise that yields false negatives in synthetic tests, the framework incorporates a stepwise dense reward function based on pass rates, delivering granular feedback that strengthens training robustness.

Using this pipeline, we construct a high‑quality dataset that augments test cases in CodeContests, covering a broader spectrum of faulty‑code scenarios and markedly improving diagnostic utility. Experiments show that, after training on a moderately challenging subset of CodeContests, RL fine‑tuning of Qwen3‑32B with RobustTests achieves an absolute 3% performance gain on the LiveCodeBench benchmark compared to baseline methods.

Blogger's Review: By turning near‑correct buggy code into synthetic tests, clustering behavioral features to prune noise, and adding dense rewards, RobustTests effectively overcomes test coverage limitations and offers a more reliable RL pathway for LLM‑driven code generation.

Original Source: https://arxiv.org/abs/2608.24135

[h] Back to Home