Bayesian Sketch Learning for Program Synthesis

By Vijayaraghavan Murali, Swarat Chaudhuri, C. Jermaine. 2017

38 citations recorded by the source corpus.

We present a Bayesian statistical approach to the problem of automatic program synthesis. Our synthesizer starts by learning, offline and from an existing corpus, a probabilistic model of real-world programs. During synthesis, it is provided some ambiguous and incomplete evidence about the nature of the programming task that the user wants automated, for example sets of API calls or data types that are relevant for the task. Given this input, the synthesizer infers a posterior distribution over type-safe programs that assigns higher likelihood to programs that, according to the learned model, are more likely to match the evidence. We realize this approach using two key ideas. First, our learning techniques operate not over code but syntactic abstractions, or sketches, of programs. During synthesis, we infer a posterior distribution over sketches, then concretize samples from this distribution into type-safe programs using combinatorial techniques. Second, our statistical model explicitly models the full intent behind a synthesis task as a latent variable. To infer sketches, we first estimate a posterior distribution on the intent, then use samples from this posterior to generate a distribution over possible sketches. We show that our model can be implemented effectively using the new neural architecture of Bayesian encoder-decoders, which can be trained with stochastic gradient descent and yields a simple inference procedure. We implement our ideas in a system, called Bayou, for the synthesis of API-heavy Java methods. We train Bayou on a large corpus of Android apps, and find that the trained system can often synthesize complex methods given just a few API method names or data types as evidence. The experiments also justify the design choice of using a latent intent variable and the levels of abstraction at which sketches and evidence are defined.

Subfields: Information Systems, Software, Probabilistic & Bayesian Methods, Code Generation & Program Synthesis

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Information Systems

  1. Uri Alon
  2. Eran Yahav
  3. Nan Duan
  4. Daya Guo
  5. Neel Sundaresan
  6. Alexey Svyatkovskiy
  7. Satish Chandra
  8. Omer Levy

In Software

  1. Neel Sundaresan
  2. Alexey Svyatkovskiy
  3. Daya Guo
  4. Nan Duan
  5. Koushik Sen
  6. Colin B. Clement
  7. Uri Alon
  8. Swarat Chaudhuri

In Probabilistic & Bayesian Methods

  1. Sebastian Nowozin
  2. Eran Yahav
  3. Uri Alon
  4. Omer Levy
  5. Matthew Amodio
  6. Thomas W. Reps
  7. Ryota Tomioka
  8. Diane Bouchacourt

In Code Generation & Program Synthesis

  1. Koushik Sen
  2. Swarat Chaudhuri
  3. Uri Alon
  4. Ge Li
  5. Eran Yahav
  6. Thomas W. Reps
  7. Hongyu Li
  8. Omer Levy

Citations in the corpus