PLLGMar 16, 2017

Neural Sketch Learning for Conditional Program Generation

arXiv:1703.05698v551 citations
Originality Incremental advance
AI Analysis

This addresses the challenge of conditional program generation for developers by enabling code synthesis from sparse specifications, though it is incremental as it builds on existing neural and combinatorial techniques.

The paper tackles the problem of generating Java-like source code from minimal labels (e.g., API calls or types) by training a neural generator on program sketches that abstract low-level details, then concretizing them into type-safe programs. It demonstrates that the system can often predict entire method bodies given just a few API calls or data types.

We study the problem of generating source code in a strongly typed, Java-like programming language, given a label (for example a set of API calls or types) carrying a small amount of information about the code that is desired. The generated programs are expected to respect a "realistic" relationship between programs and labels, as exemplified by a corpus of labeled programs available during training. Two challenges in such conditional program generation are that the generated programs must satisfy a rich set of syntactic and semantic constraints, and that source code contains many low-level features that impede learning. We address these problems by training a neural generator not on code but on program sketches, or models of program syntax that abstract out names and operations that do not generalize across programs. During generation, we infer a posterior distribution over sketches, then concretize samples from this distribution into type-safe programs using combinatorial techniques. We implement our ideas in a system for generating API-heavy Java code, and show that it can often predict the entire body of a method given just a few API calls or data types that appear in the method.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes