StepCoder: Improving Code Generation with Reinforcement Learning from Compiler Feedback
Shihan Dou, Yan Liu, Haoxiang Jia, Enyu Zhou, Limao Xiong, Junjie Shan, Caishuang Huang, Xiao Wang, Xiaoran Fan, Zhiheng Xi, Yuhao Zhou, Tao Ji
Abstract
The advancement of large language models (LLMs) has significantly propelled the field of code generation. Previous work integrated reinforcement learning (RL) with compiler feedback for exploring the output space of LLMs to enhance code generation quality. However, the lengthy code generated by LLMs in response to complex human requirements makes RL exploration a challenge. Also, since the unit tests may not cover the complicated code, optimizing LLMs by using these unexecuted code snippets is ineffective. To tackle these challenges, we introduce StepCoder, a novel RL framework for code generation, consisting of two main components: CCCS addresses the exploration challenge by breaking the long sequences code generation task into a Curriculum of Code Completion Subtasks, while FGO only optimizes the model by masking the unexecuted code segments to provide Fine-Grained Optimization. In addition, we furthermore construct the APPS+ dataset for RL training, which is manually verified to ensure the correctness of unit tests. Experimental results show that our method improves the ability to explore the output space and outperforms state-of-the-art approaches in corresponding benchmarks 1 .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
10 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning cites Training language models to follow instructions with human feedback
- Dynamic and Generalizable Process Reward Modeling cites Training language models to follow instructions with human feedback
- CODERL+: Improving Code Generation via Reinforcement with Execution Semantics Alignment cites CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
- Agentic Reinforcement Learning with Implicit Step Rewards cites Training language models to follow instructions with human feedback
- Uncovering the Impact of Chain-of-Thought Reasoning for Direct Preference Optimization: Lessons from Text-to-SQL cites CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
- ReCode: Reinforcing Code Generation with Reasoning-Process Rewards cites CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
Cited by top-tier papers10
- Agentic Reinforcement Learning with Implicit Step RewardsXiaoqian Liu, Ke Wang, Yuchuan Wu, Fei Huang et al.ICLR 2026 · 46 citations
- ReCode: Reinforcing Code Generation with Reasoning-Process RewardsLishui Fan, Yu Zhang, Mouxiang Chen, Zhongxin LiuACL 2026 · 19 citations
- CODERL+: Improving Code Generation via Reinforcement with Execution Semantics AlignmentXue Jiang, Yihong Dong, Mengyang Liu, Hongyi Deng et al.ACL 2026 · 18 citations
- Dynamic and Generalizable Process Reward ModelingZhangyue Yin, Qiushi Sun, Zhiyuan Zeng, Qinyuan Cheng et al.ACL 2025 · 13 citations
- Uncovering the Impact of Chain-of-Thought Reasoning for Direct Preference Optimization: Lessons from Text-to-SQLHanbing Liu, Haoyang Li, Xiaokang Zhang, Ruotong Chen et al.ACL 2025 · 10 citations
Builds on3
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
- CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement LearningHung Le, Yue Wang, Akhilesh Deepak Gotmare, Silvio Savarese et al.NeurIPS 2022 · 571 citations
- Loose lips sink ships: Mitigating Length Bias in Reinforcement Learning from Human FeedbackWei Shen, Rui Zheng, WenYu Zhan, Jun Zhao et al.EMNLP Findings 2023 · 9 citations
Related papers
- Learning to Generate Unit Test via Adversarial Reinforcement LearningDongjun Lee, Changho Hwang, Kimin LeeICLR 2026 · 14 citations
- SeDev: Structured Semantic Exploration for LLM-Driven Code GenerationRonghui Yang, Jie Liu, Jiajie Zeng, Jiexin Wang et al.ACL 2026
- CodeRM-NT: Reward Model for Code RL without Unit TestsXiao Xia, Dan Zhang, Tianrui SunACL Findings 2026
- Automatic Unit Test Data Generation and Actor-Critic Reinforcement Learning for Code SynthesisPhilip John Gorinski, Matthieu Zimmer, Gerasimos Lampouras, Derrick-Goh-Xin Deik et al.EMNLP Findings 2023 · 1 citation
- Alignment with Fill-In-the-Middle for Enhancing Code GenerationHouxing Ren, Zimu Lu, Weikang Shi, Haotian Hou et al.EMNLP 2025
