CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
Hung Le, Yue Wang, Akhilesh Deepak Gotmare, Silvio Savarese, Steven Chu-Hong Hoi
摘要
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 based on feedback from example unit tests and critic scores. For the model backbones, we extended the encoder-decoder architecture of CodeT5 with enhanced learning objectives, larger model sizes, and better pretraining data. Our method not only achieves new SOTA results on the challenging APPS benchmark, but also shows strong zero-shot transfer capability with new SOTA results on the simpler MBPP benchmark.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 168 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- DAPO: An Open-Source LLM Reinforcement Learning System at Scale 引用了 Teaching Large Language Models to Self-Debug
- DAPO: An Open-Source LLM Reinforcement Learning System at Scale 引用了 Reflexion: language agents with verbal reinforcement learning
- DAPO: An Open-Source LLM Reinforcement Learning System at Scale 引用了 Language Models are Few-Shot Learners
- DAPO: An Open-Source LLM Reinforcement Learning System at Scale 引用了 Training language models to follow instructions with human feedback
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Mastering Sparse CUDA Generation through Pretrained Models and Deep Reinforcement Learning 引用了 CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- Mastering Sparse CUDA Generation through Pretrained Models and Deep Reinforcement Learning 引用了 Training language models to follow instructions with human feedback
- GeDi: Generative Discriminator Guided Sequence Generation 引用了 Language Models are Few-Shot Learners
- Teaching Large Language Models to Self-Debug 引用了 Language Models are Few-Shot Learners
- Teaching Large Language Models to Self-Debug 引用了 Training language models to follow instructions with human feedback
- Reflexion: language agents with verbal reinforcement learning 引用了 Teaching Large Language Models to Self-Debug
- CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquing 引用了 GeDi: Generative Discriminator Guided Sequence Generation
- CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquing 引用了 Teaching Large Language Models to Self-Debug
- CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquing 引用了 Language Models are Few-Shot Learners
- CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquing 引用了 Training language models to follow instructions with human feedback
- Training language models to follow instructions with human feedback 引用了 GeDi: Generative Discriminator Guided Sequence Generation
- Training language models to follow instructions with human feedback 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper168
- Reflexion: language agents with verbal reinforcement learningNoah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan 等NeurIPS 2023 · 5,828 次引用
- DAPO: An Open-Source LLM Reinforcement Learning System at ScaleQiying Yu, Zheng Zhang, Ruofei Zhu, Yufeng Yuan 等NeurIPS 2025 · 2,828 次引用
- Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 次引用
- CRITIC: Large Language Models Can Self-Correct with Tool-Interactive CritiquingZhibin Gou, Zhihong Shao, Yeyun Gong, Yelong Shen 等ICLR 2024 · 699 次引用
- Mastering Sparse CUDA Generation through Pretrained Models and Deep Reinforcement LearningYaoyu Wang, Hankun Dai, Zhidong Yang, Junmin Xiao 等ICLR 2026 · 476 次引用
它引用的 Paper11
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 次引用
- GeDi: Generative Discriminator Guided Sequence GenerationBen Krause, Akhilesh Deepak Gotmare, Bryan McCann, Nitish Shirish Keskar 等EMNLP Findings 2021 · 219 次引用
相关 Paper
- Automatic Unit Test Data Generation and Actor-Critic Reinforcement Learning for Code SynthesisPhilip John Gorinski, Matthieu Zimmer, Gerasimos Lampouras, Derrick-Goh-Xin Deik 等EMNLP Findings 2023 · 1 次引用
- CodeRM-NT: Reward Model for Code RL without Unit TestsXiao Xia, Dan Zhang, Tianrui SunACL Findings 2026
- RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement LearningJonas Gehring, Kunhao Zheng, Jade Copet, Vegard Mella 等ICML 2025
- CODERL+: Improving Code Generation via Reinforcement with Execution Semantics AlignmentXue Jiang, Yihong Dong, Mengyang Liu, Hongyi Deng 等ACL 2026 · 18 次引用
- B-Coder: Value-Based Deep Reinforcement Learning for Program SynthesisZishun Yu, Yunzhe Tao, Liyu Chen, Tao Sun 等ICLR 2024 · 20 次引用
