Neural Sketch Learning for Conditional Program Generation
arXiv:1703.05698
Abstract
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.
Cited by in corpus (17)
- Review: Deep Learning in Electron Microscopy
- Programmatically Interpretable Reinforcement Learning
- Structuring the Synthesis of Heap-Manipulating Programs - Extended Version
- SketchGraphs: A Large-Scale Dataset for Modeling Relational Geometry in Computer-Aided Design
- Learning Compositional Rules via Neural Program Synthesis
- Program Synthesis with Large Language Models
- Neural Attribute Machines for Program Generation
- ENCORE: Ensemble Learning using Convolution Neural Machine Translation for Automatic Program Repair
- Learning the Relation between Code Features and Code Transforms with Structured Prediction
- Imitation-Projected Programmatic Reinforcement Learning
- Learning Differentiable Programs with Admissible Neural Heuristics
- Latent Programmer: Discrete Latent Codes for Program Synthesis
- Discrete Object Generation with Reversible Inductive Construction
- Robot Action Selection Learning via Layered Dimension Informed Program Synthesis
- PSCS: A Path-based Neural Model for Semantic Code Search
- Targeted Synthesis for Programming with Data Invariants
- Neural Program Generation Modulo Static Analysis