Dynamic Scaling of Unit Tests for Code Reward Modeling

Current large language models (LLMs) often struggle to produce accurate solutions on the first attempt for code generation.Prior research tackles this challenge by generating multiple candidate solutions and validating them with LLM-generated unit tests.The execution results of unit tests serve as reward signals to identify correct solutions.As LLMs always confidently make mistakes, these unit tests are not reliable, thereby diminishing the quality of reward signals.Motivated by the observation that scaling the number of solutions improves LLM performance, we explore the impact of scaling unit tests to enhance reward signal quality.Our pioneer experiment reveals a positive correlation between the number of unit tests and reward signal quality, with greater benefits observed in more challenging problems.Based on these insights, we propose CodeRM-8B, a lightweight yet effective unit test generator that enables efficient and high-quality unit test scaling.Additionally, we implement a dynamic scaling mechanism that adapts the number of unit tests based on problem difficulty, further improving efficiency.Experimental results show that our approach significantly improves performance across various models on three benchmarks (e.g., with gains of 18.43% for Llama3-8B and 3.42% for GPT-4o-mini on HumanEval Plus).

Authors

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.acl-long.343
Primary Topic
Software Testing and Debugging Techniques
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Dynamic Scaling of Unit Tests for Code Reward Modeling

Zeyao Ma, Jifan Yu, Jie Tang, Sijia Luo et al.
Software Testing and Debugging Techniques
article

Dynamic Scaling of Unit Tests for Code Reward Modeling

Zeyao Ma, Jifan Yu, Jie Tang, Sijia Luo, Xiaokang Zhang, Jing Zhang
article en

Abstract

Current large language models (LLMs) often struggle to produce accurate solutions on the first attempt for code generation.Prior research tackles this challenge by generating multiple candidate solutions and validating them with LLM-generated unit tests.The execution results of unit tests serve as reward signals to identify correct solutions.As LLMs always confidently make mistakes, these unit tests are not reliable, thereby diminishing the quality of reward signals.Motivated by the observation that scaling the number of solutions improves LLM performance, we explore the impact of scaling unit tests to enhance reward signal quality.Our pioneer experiment reveals a positive correlation between the number of unit tests and reward signal quality, with greater benefits observed in more challenging problems.Based on these insights, we propose CodeRM-8B, a lightweight yet effective unit test generator that enables efficient and high-quality unit test scaling.Additionally, we implement a dynamic scaling mechanism that adapts the number of unit tests based on problem difficulty, further improving efficiency.Experimental results show that our approach significantly improves performance across various models on three benchmarks (e.g., with gains of 18.43% for Llama3-8B and 3.42% for GPT-4o-mini on HumanEval Plus).

National Natural Science Foundation of China
Openalex Percentile: Top 80%
Software Testing and Debugging Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Dynamic Scaling of Unit Tests for Code Reward Modeling — Zeyao Ma, Jifan Yu, et al. · (2025) | TGRS Research Map | TGRS