Skip to main content
QUICK REVIEW

[Paper Review] Synthetic Datasets for Neural Program Synthesis

Richard Shin, Neel Kant|arXiv (Cornell University)|Dec 27, 2019
Software Engineering ResearchComputer Science16 citations
TL;DR

This paper proposes a principled methodology for generating synthetic datasets in neural program synthesis by explicitly modeling and homogenizing key random variables—such as program length, control flow depth, and input complexity—to reduce bias and improve cross-distribution generalization. By retraining models on these controlled distributions, the authors achieve significant accuracy gains (up to +5.92pp) on out-of-distribution test sets in both the Karel and Calculator domains, demonstrating that synthetic data bias severely limits generalization in neural program synthesis.

ABSTRACT

The goal of program synthesis is to automatically generate programs in a particular language from corresponding specifications, e.g. input-output behavior. Many current approaches achieve impressive results after training on randomly generated I/O examples in limited domain-specific languages (DSLs), as with string transformations in RobustFill. However, we empirically discover that applying test input generation techniques for languages with control flow and rich input space causes deep networks to generalize poorly to certain data distributions; to correct this, we propose a new methodology for controlling and evaluating the bias of synthetic data distributions over both programs and specifications. We demonstrate, using the Karel DSL and a small Calculator DSL, that training deep networks on these distributions leads to improved cross-distribution generalization performance.

Motivation & Objective

  • To identify and address unintended biases in synthetic datasets used for training neural program synthesizers.
  • To improve model generalization beyond in-distribution performance by controlling the distribution of key program and input features.
  • To develop a systematic methodology for defining and manipulating synthetic data distributions using hand-crafted salient random variables.
  • To evaluate the impact of distributional control on model performance in both complex (Karel) and simple (Calculator) domains.
  • To demonstrate that current synthetic data generation practices lead to poor out-of-distribution generalization despite strong in-distribution accuracy.

Proposed method

  • Define a set of salient random variables that capture key structural features of programs and inputs, such as program length, number of operations, and parenthetical depth.
  • Construct synthetic data distributions by controlling the marginal distribution of each salient random variable, using homogenization to reduce bias.
  • Apply homogenization to individual variables (e.g., length, max depth) with a small epsilon (ε=0.025) to ensure uniformity across values.
  • Retrain neural synthesis models on the new, homogenized data distributions and evaluate performance on both in-distribution and out-of-distribution test sets.
  • Use a mixture of unhomogenized distributions (T2T, DCFG, RCFG, BAL) as a standard evaluation benchmark for cross-distribution generalization.
  • Compare model performance across different homogenization strategies to isolate the impact of each controlled variable on generalization.

Experimental results

Research questions

  • RQ1How do common synthetic data generation strategies introduce distributional biases that impair model generalization in program synthesis?
  • RQ2To what extent can homogenizing specific salient random variables in synthetic datasets improve cross-distribution generalization in neural program synthesis?
  • RQ3Why do state-of-the-art models fail on simple, out-of-distribution test cases despite high in-distribution accuracy?
  • RQ4How does the complexity of the domain (e.g., Karel vs. Calculator) affect the impact of distributional control on model performance?
  • RQ5Can a principled, feature-based approach to synthetic data generation lead to more robust and generalizable neural program synthesizers?

Key findings

  • Homogenizing the DCFG distribution led to a 5.92 percentage point (pp) increase in test accuracy on the Calculator domain, the largest improvement observed.
  • Homogenizing the T2T distribution improved accuracy by 4.35 pp, indicating strong gains even on commonly used sampling strategies.
  • In the Karel domain, models trained on standard synthetic data distributions achieved less than 5% generalization accuracy on certain test distributions, highlighting severe distributional failure.
  • The Karel domain showed a more dramatic effect from distributional control than the Calculator domain, likely due to greater structural complexity and richer control flow.
  • Models trained on homogenized distributions showed improved generalization at the cost of a minor decrease in in-distribution accuracy, indicating a trade-off favoring robustness.
  • The study demonstrates that current synthetic data generation methods embed hidden biases that prevent models from learning full DSL semantics, even when they perform well on standard benchmarks.

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.