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.
Logic-Q: Improving Deep Reinforcement Learning-based Quantitative Trading via Program Sketch-based Tuning
Nanyang Technological University(南洋理工大学);Hong Kong Polytechnic University(香港理工大学);Chinese University of Hong Kong(香港中文大学);Singapore Management University(新加坡管理大学);Peng Cheng Lab(鹏城实验室)
ANPL: Towards Natural Programming with Interactive Decomposition
Institute of Computing Technology, CAS(中国科学院计算技术研究所);University of Chinese Academy of Sciences(中国科学院大学);Institute of Software, CAS(中国科学院软件研究所);Autodesk Research(欧特克研究院)
CERT: Continual Pre-Training on Sketches for Library-Oriented Code Generation
Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所);Microsoft Research Asia(微软亚洲研究院);Korea University(高丽大学);University of Chinese Academy of Sciences(中国科学院大学);Microsoft Azure AI(微软Azure人工智能)