CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
Hung Le Thanks: Equal contribution. Yue Wang Akhilesh Deepak Gotmare Silvio Savarese Steven C.H. Hoi Thanks: Corresponding authors: {hungle, Affiliation: Salesforce Research Affiliation: https://github.com/salesforce/CodeRL
Abstract
Program synthesis or code generation aims to generate a program that satisfies a problem specification. Recent approaches using large-scale pretrained language models (LMs) have shown promising results, yet they have some critical limitations. In particular, they often follow a standard supervised fine-tuning procedure to train a code generation model only from the pairs of natural-language problem descriptions and ground-truth programs. Such paradigm largely ignores some important but potentially useful signals in the problem specification such as unit tests, which thus often results in poor performance when solving complex unseen coding tasks. To address the limitations, we propose “CodeRL”, a new framework for program synthesis tasks through pretrained LMs and deep reinforcement learning (RL). Specifically, during training, we treat the code-generating LM as an actor network, and introduce a critic network that is trained to predict the functional correctness of generated programs and provide dense feedback signals to the actor. During inference, we introduce a new generation procedure with a critical sampling strategy that allows a model to automatically regenerate programs bas
原文 arXiv:2207.01780;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2207.01780v3