Timezone: »

 
Spotlight
Fault-Aware Neural Code Rankers
Jeevana Priya Inala · Chenglong Wang · Mei Yang · Andres Codas · Mark Encarnación · Shuvendu Lahiri · Madanlal Musuvathi · Jianfeng Gao

Tue Dec 06 09:00 AM -- 11:00 AM (PST) @

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, GPT-Neo, GPT-J) on APPS, HumanEval and MBPP datasets.

Author Information

Jeevana Priya Inala (Microsoft Research)
Chenglong Wang (University of Washington)
Mei Yang (Microsoft)
Andres Codas (IBM Research)
Mark Encarnación (Research, Microsoft)
Shuvendu Lahiri (Research, Microsoft)
Madanlal Musuvathi (Stanford University)
Jianfeng Gao (Microsoft Research, Redmond, WA)

More from the Same Authors