CodeRL+: Improving Code Generation via Reinforcement with Execution Semantics Alignment

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Jiang, Xue, Dong, Yihong, Liu, Mengyang, Deng, Hongyi, Wang, Tian, Tao, Yongding, Cao, Rongyu, Li, Binhua, Jin, Zhi, Jiao, Wenpin, Huang, Fei, Li, Yongbin, Li, Ge
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910157192036352
author Jiang, Xue
Dong, Yihong
Liu, Mengyang
Deng, Hongyi
Wang, Tian
Tao, Yongding
Cao, Rongyu
Li, Binhua
Jin, Zhi
Jiao, Wenpin
Huang, Fei
Li, Yongbin
Li, Ge
author_facet Jiang, Xue
Dong, Yihong
Liu, Mengyang
Deng, Hongyi
Wang, Tian
Tao, Yongding
Cao, Rongyu
Li, Binhua
Jin, Zhi
Jiao, Wenpin
Huang, Fei
Li, Yongbin
Li, Ge
contents While Large Language Models (LLMs) excel at code generation by learning from vast code corpora, a fundamental semantic gap remains between their training on textual patterns and the goal of functional correctness, which is governed by formal execution semantics. Reinforcement Learning with Verifiable Rewards (RLVR) approaches attempt to bridge this gap using outcome rewards from executing test cases. However, solely relying on binary pass/fail signals is inefficient for establishing a well-aligned connection between the textual representation of code and its execution semantics, especially for subtle logical errors within the code. In this paper, we propose CodeRL+, a novel approach that integrates execution semantics alignment into the RLVR training pipeline for code generation. CodeRL+ enables the model to infer variable-level execution trajectory, providing a direct learning signal of execution semantics. CodeRL+ can construct execution semantics alignment directly using existing on-policy rollouts and integrates seamlessly with various RL algorithms. Extensive experiments demonstrate that CodeRL+ outperforms post-training baselines (including RLVR and Distillation), achieving a 4.6% average relative improvement in pass@1. CodeRL+ generalizes effectively to other coding tasks, yielding 15.5% and 4.4% higher accuracy on code-reasoning and test-output-generation benchmarks, respectively. CodeRL+ shows strong applicability across diverse RL algorithms and LLMs. Furthermore, probe analyses provide compelling evidence that CodeRL+ strengthens the alignment between code's textual representations and its underlying execution semantics.
format Preprint
id arxiv_https___arxiv_org_abs_2510_18471
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle CodeRL+: Improving Code Generation via Reinforcement with Execution Semantics Alignment
Jiang, Xue
Dong, Yihong
Liu, Mengyang
Deng, Hongyi
Wang, Tian
Tao, Yongding
Cao, Rongyu
Li, Binhua
Jin, Zhi
Jiao, Wenpin
Huang, Fei
Li, Yongbin
Li, Ge
Software Engineering
Artificial Intelligence
Computation and Language
While Large Language Models (LLMs) excel at code generation by learning from vast code corpora, a fundamental semantic gap remains between their training on textual patterns and the goal of functional correctness, which is governed by formal execution semantics. Reinforcement Learning with Verifiable Rewards (RLVR) approaches attempt to bridge this gap using outcome rewards from executing test cases. However, solely relying on binary pass/fail signals is inefficient for establishing a well-aligned connection between the textual representation of code and its execution semantics, especially for subtle logical errors within the code. In this paper, we propose CodeRL+, a novel approach that integrates execution semantics alignment into the RLVR training pipeline for code generation. CodeRL+ enables the model to infer variable-level execution trajectory, providing a direct learning signal of execution semantics. CodeRL+ can construct execution semantics alignment directly using existing on-policy rollouts and integrates seamlessly with various RL algorithms. Extensive experiments demonstrate that CodeRL+ outperforms post-training baselines (including RLVR and Distillation), achieving a 4.6% average relative improvement in pass@1. CodeRL+ generalizes effectively to other coding tasks, yielding 15.5% and 4.4% higher accuracy on code-reasoning and test-output-generation benchmarks, respectively. CodeRL+ shows strong applicability across diverse RL algorithms and LLMs. Furthermore, probe analyses provide compelling evidence that CodeRL+ strengthens the alignment between code's textual representations and its underlying execution semantics.
title CodeRL+: Improving Code Generation via Reinforcement with Execution Semantics Alignment
topic Software Engineering
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2510.18471