Fault-Aware Neural Code Rankers
Jeevana Priya Inala, Chenglong Wang, Mei Yang, Andrés Codas, Mark Encarnación, Shuvendu K. Lahiri, Madanlal Musuvathi, Jianfeng Gao
Abstract
Large language models (LLMs) have demonstrated an impressive ability to generate code for various programming tasks. In many instances, LLMs can generate a correct program for a task when given numerous trials. Consequently, a recent trend is to do large scale sampling of programs using a model and then filtering/ranking the programs based on the program execution on a small number of known unit tests to select one candidate solution. However, these approaches assume that the unit tests are given and assume the ability to safely execute the generated programs (which can do arbitrary dangerous operations such as file manipulations). Both of the above assumptions are impractical in real-world software development. In this paper, we propose CODERANKER, a neural ranker that can predict the correctness of a sampled program without executing it. Our CODERANKER is fault-aware i.e., it is trained to predict different kinds of execution information such as predicting the exact compile/runtime error type (e.g., an IndexError or a TypeError). We show that CODERANKER can significantly increase the pass@1 accuracy of various code generation models (including Codex [11] , GPT-Neo, GPT-J) on APPS [25] , HumanEval [11] and MBPP [3] datasets.
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.
22 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
- CodeT: Code Generation with Generated Tests cites InCoder: A Generative Model for Code Infilling and Synthesis
- CodeT: Code Generation with Generated Tests cites Generate & Rank: A Multi-task Framework for Math Word Problems
- CodeT: Code Generation with Generated Tests cites Language Models are Few-Shot Learners
- ALGO: Synthesizing Algorithmic Programs with Generated Oracle Verifiers cites CodeT: Code Generation with Generated Tests
- CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modules cites CodeT: Code Generation with Generated Tests
- CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modules cites Coder Reviewer Reranking for Code Generation
- CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modules cites Language Models are Few-Shot Learners
- InCoder: A Generative Model for Code Infilling and Synthesis cites Language Models are Few-Shot Learners
- Is Self-Repair a Silver Bullet for Code Generation? cites CodeT: Code Generation with Generated Tests
- Is Self-Repair a Silver Bullet for Code Generation? cites InCoder: A Generative Model for Code Infilling and Synthesis
- Is Self-Repair a Silver Bullet for Code Generation? cites Coder Reviewer Reranking for Code Generation
- Generate & Rank: A Multi-task Framework for Math Word Problems cites Language Models are Few-Shot Learners
- Coder Reviewer Reranking for Code Generation cites CodeT: Code Generation with Generated Tests
- Coder Reviewer Reranking for Code Generation cites InCoder: A Generative Model for Code Infilling and Synthesis
- Coder Reviewer Reranking for Code Generation cites Language Models are Few-Shot Learners
Cited by top-tier papers22
- Is Self-Repair a Silver Bullet for Code Generation?Theo X. Olausson, Jeevana Priya Inala, Chenglong Wang, Jianfeng Gao et al.ICLR 2024 · 195 citations
- Coder Reviewer Reranking for Code GenerationTianyi Zhang, Tao Yu, Tatsunori Hashimoto, Mike Lewis et al.ICML 2023 · 125 citations
- CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modulesHung Le, Hailin Chen, Amrita Saha, Akash Gokul et al.ICLR 2024 · 73 citations
- ALGO: Synthesizing Algorithmic Programs with Generated Oracle VerifiersKexun Zhang, Danqing Wang, Jingtao Xia, William Yang Wang et al.NeurIPS 2023 · 68 citations
- CodeT: Code Generation with Generated TestsBei Chen, Fengji Zhang, Anh Nguyen, Daoguang Zan et al.ICLR 2023 · 64 citations
Builds on5
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- InCoder: A Generative Model for Code Infilling and SynthesisDaniel Fried, Armen Aghajanyan, Jessy Lin, Sida Wang et al.ICLR 2023 · 140 citations
- Generate & Rank: A Multi-task Framework for Math Word ProblemsJianhao Shen, Yichun Yin, Lin Li, Lifeng Shang et al.EMNLP Findings 2021 · 88 citations
- Latent Execution for Neural Program Synthesis Beyond Domain-Specific LanguagesXinyun Chen, Dawn Song, Yuandong TianNeurIPS 2021 · 56 citations
- Neural Program Generation Modulo Static AnalysisRohan Mukherjee, Yeming Wen, Dipak Chaudhari, Thomas W. Reps et al.NeurIPS 2021 · 28 citations
Related papers
- Sifting through the Chaff: On Utilizing Execution Feedback for Ranking the Generated Code CandidatesZhihong Sun, Yao Wan, Jia Li, Hongyu Zhang et al.ASE 2024 · 5 citations
- Improving Code Generation via Small Language Model-as-a-judgeGiuseppe Crupi, Rosalia Tufano, Gabriele BavotaICSE 2026 · 1 citation
- LEVER: Learning to Verify Language-to-Code Generation with ExecutionAnsong Ni, Srini Iyer, Dragomir Radev, Veselin Stoyanov et al.ICML 2023 · 318 citations
- Self-Edit: Fault-Aware Code Editor for Code GenerationKechi Zhang, Zhuo Li, Jia Li, Ge Li et al.ACL 2023 · 42 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
