Information-theoretic User Interaction: Significant Inputs for Program Synthesis

Ashish Tiwari, Arjun Radhakrishna, Sumit Gulwani, Daniel PerelmanarXiv 2020

Abstract

Programming-by-Example (PBE) systems often struggle with intent ambiguity, where a small number of user-provided examples can be satisfied by a vast number of potential programs. This paper proposes an information-theoretic framework that treats program synthesis as an active learning problem. By identifying "significant inputs"—questions that maximize information gain—the system can proactively ask users for clarification, significantly reducing the number of iterations required to converge on the correct program while minimizing errors.

Introduction

Programming-by-Example (PBE) technologies, such as Excel's Flash Fill, allow users to create complex data transformation scripts using only input-output examples. Despite their utility, these systems face a fundamental challenge: intent ambiguity. For instance, if a user provides the example ("12 in" -> "12"), the system might interpret this as "extract the first two characters," "extract all digits," or "remove the last three characters."

In traditional passive PBE systems, the burden is on the user to manually inspect the dataset, identify where the system's current guess is incorrect, and provide a corrective example. This paper addresses the Significant Questions Problem: how can a synthesizer automatically identify the specific input that, when answered by the user, provides the maximum amount of information to narrow down the search space?

Methodology: Synthesis as a Game of 20 Questions

The authors frame the interaction between the user and the synthesizer as an information-theoretic game. The goal is to select inputs that minimize the conditional entropy of the distribution of possible programs.

1. Greedy Information Gain

The system calculates which input $i$ in the dataset has the highest uncertainty regarding its output. Intuitively, the most valuable question to ask the user is the one the system is most "confused" about. By resolving this uncertainty, the system can prune the largest possible portion of the program search space.

2. Sampling Program Learner

Because the space of possible programs is often astronomically large (exceeding $10^{20}$), calculating exact probabilities is computationally infeasible. The researchers employ a Monte Carlo approach, sampling a representative set of programs. This set includes:

  • Top-k Programs: The highest-ranked programs according to the synthesizer's internal heuristics.
  • Random Programs: A diverse set of randomly sampled programs to ensure the system considers edge cases and avoids "groupthink" bias.

3. Input and Output Clustering

To ensure real-time performance on large datasets, the system uses clustering to reduce the number of candidate questions. Inputs are grouped based on syntactic features (e.g., date formats) and output features. Output-based clustering is particularly effective: if all candidate programs produce the same output for two different inputs, asking about both is redundant. This allows the system to prune the question space effectively.

Experimental Evaluation

The framework was evaluated on 791 string transformation scenarios sourced from real-world data wrangling tasks and the Microsoft PROSE benchmarks. The active learning approach was compared against a passive baseline where the user manually identifies errors.

Key Results

  • Accuracy: The combination of top-k and random sampling proved highly effective. Across the entire dataset, the active learner reduced the number of false negatives from 4,840 to just 3.
  • Efficiency: The system significantly outperformed the baseline in terms of convergence. For example, the variant using output clustering solved 409 scenarios in one iteration or less, compared to only 11 scenarios for the passive baseline.
  • Performance: The system maintained a median processing time of 0.8 seconds per iteration, demonstrating its viability for real-time interactive applications.

Discussion and Future Work

While the framework effectively minimizes the number of questions asked, it does not yet account for the cognitive load placed on the user. Some "significant" inputs may be more difficult for a human to process than others. Future research will focus on balancing information gain with the ease of user response and expanding the framework beyond string transformations to more complex data structures and program invariants.

By transforming the synthesizer from a passive observer into an active learner, this research provides a path toward more reliable and less frustrating end-user programming tools.

Summary updated

BibTeX
@misc{tiwari2020information,
  author = {Ashish Tiwari and Arjun Radhakrishna and Sumit Gulwani and Daniel Perelman},
  title = {{Information-theoretic User Interaction: Significant Inputs for Program Synthesis}},
  year = {2020},
  eprint = {2006.12638},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.12638},
}
Figure