Constrained Program Inference Using Metropolis-Hastings Sampling
Date
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
Conditional Program Generation (CPG) is a Sketch program generation technique that uses clues given by the user to generate the required Sketch. The CPG model generates a Sketch by sampling from the learned probability distribution P(sketch|clues). However, it cannot guarantee that the generated Sketch will incorporate all of the given clues. In practice, we find that when the CPG model assigns vanishingly low probabilities to every Sketch program in the Sketch program space that incorporates all of the given clues, it often returns a high-probability Sketch program that does not contain the clues. Such scenarios arise when the user wants to generate a novel program and gives clues that are significantly different from any set of clues the model was trained on. In this thesis, we introduce Constrained Program Inference (CPI), a method that treats constrained Sketch program generation as an inference problem, rather than a training problem. It guarantees every generated program will incorporate all of the given clues. Our method uses the Metropolis- Hastings algorithm to treat clues as hard constraints, thus enabling CPI to generate novel programs. We find that CPI is able to produce higher-quality programs than CPG.
Description
Advisor
Degree
Type
Keywords
Citation
Chilukuri, Meghana Vasudha Oris. "Constrained Program Inference Using Metropolis-Hastings Sampling." (2021) Master’s Thesis, Rice University. https://hdl.handle.net/1911/110375.