Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

InCoder: A Generative Model for Code Infilling and Synthesis

About

Code is seldom written in a single left-to-right pass and is instead repeatedly edited and refined. We introduce InCoder, a unified generative model that can perform program synthesis (via left-to-right generation) as well as editing (via infilling). InCoder is trained to generate code files from a large corpus of permissively licensed code, where regions of code have been randomly masked and moved to the end of each file, allowing code infilling with bidirectional context. Our model is the first generative model that is able to directly perform zero-shot code infilling, which we evaluate on challenging tasks such as type inference, comment generation, and variable re-naming. We find that the ability to condition on bidirectional context substantially improves performance on these tasks, while still performing comparably on standard program synthesis benchmarks in comparison to left-to-right only models pretrained at similar scale. The InCoder models and code are publicly released. https://sites.google.com/view/incoder-code-models

Daniel Fried, Armen Aghajanyan, Jessy Lin, Sida Wang, Eric Wallace, Freda Shi, Ruiqi Zhong, Wen-tau Yih, Luke Zettlemoyer, Mike Lewis• 2022

Related benchmarks

TaskDatasetResultRank
Code GenerationHumanEval
Pass@115.2
850
Code GenerationHumanEval (test)
Pass@115.2
444
Code GenerationHumanEval 1.0 (test)
Pass@115.2
145
Code GenerationMBPP
Pass@117.6
113
Code GenerationHumanEval-ET
Pass@111.6
75
Code GenerationMBPP-ET
Pass@114.3
75
Code GenerationMBPP v1 (test)
Pass@119.4
33
Code GenerationHumanEval-X
Pass@1 (C++)9.5
20
Code GenerationDS-1000 1.0 (test)
Matplotlib28.3
19
Code GenerationHumanEval Python
Pass@115.2
18
Showing 10 of 52 rows

Other info

Code

Follow for update