Exploring Pass-Rate Reward in Reinforcement Learning for Code Generation

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Li, Xin-Ye, Liu, Ren-Biao, Zhang, Yun-Ji, Sun, Hui, Xie, Zheng, Li, Ming
Formato: Preprint
Publicado: 2026
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866911645968629760
author Li, Xin-Ye
Liu, Ren-Biao
Zhang, Yun-Ji
Sun, Hui
Xie, Zheng
Li, Ming
author_facet Li, Xin-Ye
Liu, Ren-Biao
Zhang, Yun-Ji
Sun, Hui
Xie, Zheng
Li, Ming
contents Reinforcement learning (RL) from unit-test feedback has become a standard post-training recipe for improving large language models (LLMs) on code generation. However, the pass-all-tests binary reward can be sparse, yielding no learning signal on challenging problems where none of the sampled solutions passes all tests. A common remedy is to use the test-case pass rate as a surrogate reward. In this work, we study pass-rate rewards in critic-free RL for code generation (e.g., GRPO and RLOO) and report a consistent pattern across base models and algorithms: despite alleviating reward sparsity, pass-rate rewards do not reliably improve final performance over binary rewards in rigorous controlled experiments. To understand this discrepancy, we analyze reward density and the resulting gradient directions. We find that pass-rate rewards are denser, but the induced gradient updates do not consistently move probability mass toward full-pass solutions. This arises because test-case pass rate is a miscalibrated surrogate for progress toward full correctness, and partial-pass solutions within the same group can induce conflicting gradient directions that cancel out. Overall, our results suggest that, in critic-free RL, pass-rate rewards are insufficient to improve code generation and motivate reward designs that better align optimization with the goal of full correctness.
format Preprint
id arxiv_https___arxiv_org_abs_2605_02944
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Exploring Pass-Rate Reward in Reinforcement Learning for Code Generation
Li, Xin-Ye
Liu, Ren-Biao
Zhang, Yun-Ji
Sun, Hui
Xie, Zheng
Li, Ming
Machine Learning
Artificial Intelligence
Software Engineering
Reinforcement learning (RL) from unit-test feedback has become a standard post-training recipe for improving large language models (LLMs) on code generation. However, the pass-all-tests binary reward can be sparse, yielding no learning signal on challenging problems where none of the sampled solutions passes all tests. A common remedy is to use the test-case pass rate as a surrogate reward. In this work, we study pass-rate rewards in critic-free RL for code generation (e.g., GRPO and RLOO) and report a consistent pattern across base models and algorithms: despite alleviating reward sparsity, pass-rate rewards do not reliably improve final performance over binary rewards in rigorous controlled experiments. To understand this discrepancy, we analyze reward density and the resulting gradient directions. We find that pass-rate rewards are denser, but the induced gradient updates do not consistently move probability mass toward full-pass solutions. This arises because test-case pass rate is a miscalibrated surrogate for progress toward full correctness, and partial-pass solutions within the same group can induce conflicting gradient directions that cancel out. Overall, our results suggest that, in critic-free RL, pass-rate rewards are insufficient to improve code generation and motivate reward designs that better align optimization with the goal of full correctness.
title Exploring Pass-Rate Reward in Reinforcement Learning for Code Generation
topic Machine Learning
Artificial Intelligence
Software Engineering
url https://arxiv.org/abs/2605.02944