StepCoder: Improve Code Generation with Reinforcement Learning from Compiler Feedback

Shihan Dou, Yan Liu, Haoxiang Jia, Limao Xiong, Enyu Zhou +12 more
2/2/2024
100 citations
cs.SEcs.CL
rlrlhf-rlvr-dpo

Official code: Ablustrund/APPS_Plus (73 stars, MIT, last commit 2024-08-31).

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.

Show full abstract

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. Our dataset APPS+ and StepCoder are available online.

View on arXivView PDF

Code Implementations(1)

MIT

StepCoder: Improve Code Generation with Reinforcement Learning from Compiler Feedback

733Feb 5, 20242 years agoMIT

Similar Papers

Cite this paper

@article{dou2024stepcoder,
  title  = {StepCoder: Improve Code Generation with Reinforcement Learning from Compiler Feedback},
  author = {Shihan Dou and Yan Liu and Haoxiang Jia and Limao Xiong and Enyu Zhou and Wei Shen and Junjie Shan and Caishuang Huang and Xiao Wang and Xiaoran Fan and Zhiheng Xi and Yuhao Zhou and Tao Ji and Rui Zheng and Qi Zhang and Xuanjing Huang and Tao Gui},
  year   = {2024},
  eprint = {2402.01391},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.01391v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.01391.svg)](https://codeofpaper.com/paper/2402.01391)

Discussion