Skip to main content
QUICK REVIEW

[Paper Review] Selecting Representative Examples for Program Synthesis

Yewen Pu, Zachery Miranda|arXiv (Cornell University)|Nov 9, 2017
Software Engineering ResearchComputer Science14 citations
TL;DR

This paper proposes a greedy, neural network–guided method to select a small, representative subset of input-output examples for program synthesis, improving scalability and stability. By iteratively adding the least probable (most surprising) example conditioned on the current subset, the approach reduces constraint solver overhead while maintaining correctness, outperforming baselines in synthesis time and variance on programmatic drawing and automaton induction tasks.

ABSTRACT

Program synthesis is a class of regression problems where one seeks a solution, in the form of a source-code program, mapping the inputs to their corresponding outputs exactly. Due to its precise and combinatorial nature, program synthesis is commonly formulated as a constraint satisfaction problem, where input-output examples are encoded as constraints and solved with a constraint solver. A key challenge of this formulation is scalability: while constraint solvers work well with a few well-chosen examples, a large set of examples can incur significant overhead in both time and memory. We describe a method to discover a subset of examples that is both small and representative: the subset is constructed iteratively, using a neural network to predict the probability of unchosen examples conditioned on the chosen examples in the subset, and greedily adding the least probable example. We empirically evaluate the representativeness of the subsets constructed by our method, and demonstrate such subsets can significantly improve synthesis time and stability.

Motivation & Objective

  • To address the scalability challenge in program synthesis caused by large sets of input-output examples.
  • To reduce the computational overhead of encoding and solving large constraint satisfaction problems (CSPs).
  • To improve synthesis stability and speed by selecting a minimal yet representative subset of examples.
  • To provide a method that outperforms CEGIS and random sampling by selecting examples that maximally prune the search space.
  • To enable efficient program synthesis on large datasets by focusing on semantically constraining examples.

Proposed method

  • The method uses a pre-trained neural network to estimate the conditional probability of unselected examples given the current subset of selected examples.
  • It greedily selects the example with the lowest predicted probability (most surprising) to add to the subset, as it is expected to most effectively constrain the search space.
  • The algorithm iteratively expands the subset until all examples have sufficiently high conditional probability, indicating they are well-explained by the current subset.
  • The neural network is trained on a neighborhood function that captures local spatial relationships between input-output pairs, particularly effective in domains like image rendering and automaton induction.
  • The approach is applied as a preprocessing step before running a constraint solver, replacing the need for iterative CEGIS refinement in many cases.
  • The method is evaluated on two domains: automaton induction and programmatic drawing synthesis, with comparisons to full, CEGIS, and random sampling baselines.

Experimental results

Research questions

  • RQ1Can a neural network effectively identify which input-output examples are most informative for constraining the program synthesis search space?
  • RQ2Does selecting a small, representative subset of examples improve synthesis time and stability compared to using all examples or random subsets?
  • RQ3How does the performance of the proposed method compare to CEGIS and its variants in terms of solution time and variance?
  • RQ4To what extent can the method reduce the number of examples needed while still enabling correct program synthesis?
  • RQ5Is the method robust across different domains, such as image rendering and automaton induction?

Key findings

  • The proposed method significantly reduces average synthesis time compared to full example sets and random sampling, achieving the best average performance on programmatic drawing synthesis.
  • The method matches the low variance of the full set and the heuristic-based h1+cegis method, indicating high stability in solving time.
  • On average, the method selects fewer than 20% of the total examples while maintaining high representativeness, outperforming random subsets of any size in both time and stability.
  • CEGIS performs well on the drawing domain due to a coincidental alignment with boundary-detecting counterexamples, but this is not generalizable; the proposed method avoids such dependence.
  • The neural network’s conditional probability predictions effectively identify the most constraining examples, enabling efficient pruning of the search space.
  • The method demonstrates strong generalization across domains, showing consistent improvement over strong baselines in both time and variance metrics.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.