Coder Reviewer Reranking for Code Generation

11/29/2022
by   Tianyi Zhang, et al.
0

Sampling diverse programs from a code language model and reranking with model likelihood is a popular method for code generation but it is prone to preferring degenerate solutions. Inspired by collaborative programming, we propose Coder-Reviewer reranking. We augment Coder language models from past work, which generate programs given language instructions, with Reviewer models, which evaluate the likelihood of the instruction given the generated programs. We perform an extensive study across six datasets with eight models from three model families. Experimental results show that Coder-Reviewer reranking leads to consistent and significant improvement (up to 17 accuracy gain) over reranking with the Coder model only. When combined with executability filtering, Coder-Reviewer reranking can often outperform the minimum Bayes risk method. Coder-Reviewer reranking is easy to implement by prompting, can generalize to different programming languages, and works well with off-the-shelf hyperparameters.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/17/2022

MultiPL-E: A Scalable and Extensible Approach to Benchmarking Neural Code Generation

Large language models have demonstrated the ability to generate both nat...
research
02/08/2023

On the Applicability of Language Models to Block-Based Programs

Block-based programming languages like Scratch are increasingly popular ...
research
05/11/2023

Enabling Programming Thinking in Large Language Models Toward Code Generation

Large Language Models (LLMs) (e.g., ChatGPT) have shown impressive perfo...
research
05/21/2023

SLaDe: A Portable Small Language Model Decompiler for Optimized Assembler

Decompilation is a well-studied area with numerous high-quality tools av...
research
10/26/2022

Piloting Copilot and Codex: Hot Temperature, Cold Prompts, or Black Magic?

Language models are promising solutions for tackling increasing complex ...
research
06/15/2022

FixEval: Execution-based Evaluation of Program Fixes for Competitive Programming Problems

Source code repositories consist of large codebases, often containing er...
research
02/11/2020

Modeling Programs Hierarchically with Stack-Augmented LSTM

Programming language modeling has attracted extensive attention in recen...

Please sign up or login with your details

Forgot password? Click here to reset