CVeDRL: An Efficient Code Verifier via Difficulty-aware Reinforcement Learning

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Shi, Ji, Guo, Peiming, Zhang, Meishan, Zhang, Miao, Liu, Xuebo, Zhang, Min, Guan, Weili
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910006042951680
author Shi, Ji
Guo, Peiming
Zhang, Meishan
Zhang, Miao
Liu, Xuebo
Zhang, Min
Guan, Weili
author_facet Shi, Ji
Guo, Peiming
Zhang, Meishan
Zhang, Miao
Liu, Xuebo
Zhang, Min
Guan, Weili
contents Code verifiers play a critical role in post-verification for LLM-based code generation, yet existing supervised fine-tuning methods suffer from data scarcity, high failure rates, and poor inference efficiency. While reinforcement learning (RL) offers a promising alternative by optimizing models through execution-driven rewards without labeled supervision, our preliminary results show that naive RL with only functionality rewards fails to generate effective unit tests for difficult branches and samples. We first theoretically analyze showing that branch coverage, sample difficulty, syntactic and functional correctness can be jointly modeled as RL rewards, where optimizing these signals can improve the reliability of unit-test-based verification. Guided by this analysis, we design syntax- and functionality-aware rewards and further propose branch- and sample-difficulty--aware RL using exponential reward shaping and static analysis metrics. With this formulation, CVeDRL achieves state-of-the-art performance with only 0.6B parameters, yielding up to 28.97% higher pass rate and 15.08% higher branch coverage than GPT-3.5, while delivering over $20\times$ faster inference than competitive baselines. Code is available at https://github.com/LIGHTCHASER1/CVeDRL.git
format Preprint
id arxiv_https___arxiv_org_abs_2601_22803
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle CVeDRL: An Efficient Code Verifier via Difficulty-aware Reinforcement Learning
Shi, Ji
Guo, Peiming
Zhang, Meishan
Zhang, Miao
Liu, Xuebo
Zhang, Min
Guan, Weili
Artificial Intelligence
Software Engineering
Code verifiers play a critical role in post-verification for LLM-based code generation, yet existing supervised fine-tuning methods suffer from data scarcity, high failure rates, and poor inference efficiency. While reinforcement learning (RL) offers a promising alternative by optimizing models through execution-driven rewards without labeled supervision, our preliminary results show that naive RL with only functionality rewards fails to generate effective unit tests for difficult branches and samples. We first theoretically analyze showing that branch coverage, sample difficulty, syntactic and functional correctness can be jointly modeled as RL rewards, where optimizing these signals can improve the reliability of unit-test-based verification. Guided by this analysis, we design syntax- and functionality-aware rewards and further propose branch- and sample-difficulty--aware RL using exponential reward shaping and static analysis metrics. With this formulation, CVeDRL achieves state-of-the-art performance with only 0.6B parameters, yielding up to 28.97% higher pass rate and 15.08% higher branch coverage than GPT-3.5, while delivering over $20\times$ faster inference than competitive baselines. Code is available at https://github.com/LIGHTCHASER1/CVeDRL.git
title CVeDRL: An Efficient Code Verifier via Difficulty-aware Reinforcement Learning
topic Artificial Intelligence
Software Engineering
url https://arxiv.org/abs/2601.22803