TL;DR
This paper introduces a novel method to transform existing coding benchmarks into datasets for evaluating "synthetic verifiers" – AI techniques that generate test cases or reward models to assess code quality. They release four new benchmarks and demonstrate that reasoning-enhanced LLMs significantly improve test case generation, and that increasing the number of test cases boosts verification accuracy.
What Problem Does This Paper Address?
Large Language Models (LLMs) are increasingly capable of code generation, but evaluating their performance beyond a fixed set of predefined tests is challenging due to the scarcity of such test cases. To address this, researchers are exploring "synthetic verifiers" – methods that automatically generate test cases or reward signals to assess code quality. However, there's a lack of standardized benchmarks to rigorously evaluate and compare these synthetic verification techniques, especially for code that requires reasoning. This paper aims to fill this gap by providing a framework and new benchmarks to systematically assess the effectiveness of synthetic verifiers, particularly in conjunction with reasoning-capable LLMs.
Methods
The core contribution is a recipe for transforming existing coding benchmarks (like HumanEval and MBPP) into "scoring and ranking" benchmarks. This involves:
- Generating Diverse Solutions: Using LLMs with multiple prompting techniques to create a wide range of correct, partially correct, and incorrect code solutions for each problem.
- Filtering and Ranking: Deduplicating solutions, scoring them based on the fraction of predefined test cases they pass, and then selecting a diverse set of solutions that are evenly distributed in terms of their scores. This process creates a ranked list of solutions for each problem.
- Developing Evaluation Metrics: Proposing metrics like Top-1 Accuracy, Spearman's ρ Coefficient, Bottom-1 Accuracy, and Mean Absolute Error (MAE) to quantify how well synthetic verifiers can rank solutions and estimate their correctness.
The paper also explores two categories of synthetic verification methods: test case generation and code reward modeling.
Datasets
The paper introduces four new benchmarks derived from existing ones:
- HE-R and HE-R+: Derived from HumanEval (HE) and HumanEval+ (HE+).
- MBPP-R and MBPP-R+: Derived from Mostly Basic Programming Problems (MBPP) and MBPP+.
These new benchmarks are designed to be scoring and ranking datasets, allowing for a more nuanced evaluation of synthetic verifiers compared to the original datasets which primarily focus on code generation.
Key Insights and Ideas
- Transforming Benchmarks: The proposed method offers a systematic way to create valuable evaluation datasets for synthetic verifiers from readily available coding benchmarks.
- Reasoning Powers Verification: Reasoning-enhanced LLMs show a significant advantage in generating effective test cases compared to standard LLMs.
- More Tests, Better Accuracy: Increasing the number of generated test cases directly leads to improved verification accuracy, up to a certain point.
- Solution Inclusion Bias: Providing potentially incorrect solutions to LLMs when generating test cases can lead to a bias, causing the LLM to adhere to the incorrect solution. This suggests it's better to prompt LLMs without providing a solution for test case generation.
Key Results
- The paper demonstrates that reasoning models like DeepSeek-R1 and its variants achieve higher Top-1 accuracy and Spearman's ρ scores in test case generation compared to standard LLMs. For instance, DeepSeek-R1 achieved a Top-1 accuracy of 83.8% on HE-R+ and 77.5% on MBPP-R+.
- Scaling the number of test cases from 5 to 25 significantly improved the Top-1 accuracy for models like DeepSeek-R1 on HE-R+, reaching 91.6%.
- The best performing reward models were AceCoderRM-32B for HE-R+ and Nemotron4-340B-Reward for MBPP-R+. However, in most metrics, reasoning and standard LLMs for test case generation outperformed these reward models.
- The study found that LLMs are worse at providing test cases when given an incorrect solution, leading the authors to exclude solutions from their main experiments.
Limitations and Future Work
- Benchmark Dependency: The quality of the transformed benchmarks is directly tied to the reliability and accuracy of the original benchmarks.
- API Constraints: Practical limitations due to API context length and pricing constrained the number of test cases generated by reasoning models, leading to the selection of 10 test cases as a balance.
- Future Work: The authors suggest using a family of models for generation to mitigate self-evaluation bias and further explore the limits of reasoning and test case scaling for improved accuracy. They also encourage further research into reward models for coding.
Summary updated