Search papers, labs, and topics across Lattice.
The paper introduces MIST-RL, a reinforcement learning framework for generating unit tests that focuses on "scaling-by-utility" rather than "scaling-by-quantity" to improve fault detection efficiency. MIST-RL formulates test generation as a sequential decision process optimized using Group Relative Policy Optimization (GRPO) with a novel incremental mutation reward and dynamic penalties to encourage the discovery of new faults and suppress redundant assertions. Experiments on HumanEval+ and MBPP+ demonstrate that MIST-RL achieves a +28.5% higher mutation score with 19.3% fewer test cases and improves downstream code reranking accuracy on HumanEval+ by 3.05% compared to state-of-the-art baselines.
LLMs can verify code more effectively by focusing on test case utility rather than sheer quantity, achieving a 28.5% higher mutation score with 19.3% fewer tests.
Large Language Models (LLMs) often fail to generate correct code on the first attempt, which requires using generated unit tests as verifiers to validate the solutions. Despite the success of recent verification methods, they remain constrained by a"scaling-by-quantity"paradigm. This brute-force approach suffers from a critical limitation: it yields diminishing returns in fault detection while causing severe test redundancy. To address this, we propose MIST-RL (Mutation-based Incremental Suite Testing via Reinforcement Learning), a framework that shifts the focus to"scaling-by-utility". We formulate test generation as a sequential decision process optimized via Group Relative Policy Optimization (GRPO). Specifically, we introduce a novel incremental mutation reward combined with dynamic penalties, which incentivizes the model to discover new faults while it suppresses functionally equivalent assertions. Experiments on HumanEval+ and MBPP+ demonstrate that MIST-RL outperforms state-of-the-art baselines. It achieves a +28.5% higher mutation score while reducing the number of test cases by 19.3%. Furthermore, we show that these compact, high-utility tests serve as superior verifiers, which improves downstream code reranking accuracy on HumanEval+ by 3.05% over the SOTA baseline with 10 candidate samples. The source code and data are provided in the supplementary material.