Learning to Generate Code Sketches

by   Daya Guo, et al.

Traditional generative models are limited to predicting sequences of terminal tokens. However, ambiguities in the generation task may lead to incorrect outputs. Towards addressing this, we introduce Grammformers, transformer-based grammar-guided models that learn (without explicit supervision) to generate sketches – sequences of tokens with holes. Through reinforcement learning, Grammformers learn to introduce holes avoiding the generation of incorrect tokens where there is ambiguity in the target task. We train Grammformers for statement-level source code completion, i.e., the generation of code snippets given an ambiguous user intent, such as a partial code context. We evaluate Grammformers on code completion for C# and Python and show that it generates 10-50 generative models and 37-50 baselines trained with similar techniques.



There are no comments yet.


page 1

page 2

page 3

page 4


CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequences

Code completion is an essential feature of IDEs, yet current autocomplet...

IntelliCode Compose: Code Generation Using Transformer

In software development through integrated development environments (IDE...

Structured Generative Models of Natural Source Code

We study the problem of building generative models of natural source cod...

Corrigendum to Improve Language Modelling for Code Completion through Learning General Token Repetition of Source Code

This paper is written because I receive several inquiry emails saying it...

An Empirical Study on the Usage of Transformer Models for Code Completion

Code completion aims at speeding up code writing by predicting the next ...

Neural Networks for Modeling Source Code Edits

Programming languages are emerging as a challenging and interesting doma...

An Empirical Study on the Usage of BERT Models for Code Completion

Code completion is one of the main features of modern Integrated Develop...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.