[Paper Review] Deep API Programmer: Learning to Program with APIs
This paper introduces Dapip, a deep learning-based Programming-By-Example system that automatically learns to synthesize programs using a domain-specific language (DSL) centered on API functions for data transformation. It employs a cross-correlational encoder and a recursive-reverse-recursive neural network (R3NN) to encode input-output examples and search the DSL space, achieving 45% accuracy on real-world FlashFill benchmarks—significantly outperforming enumerative baselines.
We present DAPIP, a Programming-By-Example system that learns to program with APIs to perform data transformation tasks. We design a domain-specific language (DSL) that allows for arbitrary concatenations of API outputs and constant strings. The DSL consists of three family of APIs: regular expression-based APIs, lookup APIs, and transformation APIs. We then present a novel neural synthesis algorithm to search for programs in the DSL that are consistent with a given set of examples. The search algorithm uses recently introduced neural architectures to encode input-output examples and to model the program search in the DSL. We show that synthesis algorithm outperforms baseline methods for synthesizing programs on both synthetic and real-world benchmarks.
Motivation & Objective
- To address the limitations of existing PBE systems that rely on rigid, low-level DSLs with limited expressiveness for semantic data transformations.
- To reduce the need for manual heuristic design in program synthesis by automatically learning a neural synthesis algorithm from data.
- To enable efficient, scalable program synthesis for complex data transformation tasks using function-based DSLs and deep neural networks.
- To improve generalization and extensibility in program synthesis by modeling APIs as first-class constructs with learnable representations.
Proposed method
- Design a domain-specific language (DSL) where programs are composed of three API families: regular expression-based, lookup, and transformation APIs for syntactic and semantic transformations.
- Use a cross-correlational encoder based on bidirectional LSTMs to generate fixed-dimensional vector representations of input-output examples.
- Employ a recursive-reverse-recursive neural network (R3NN) to model incremental program derivation and predict valid expansions in the DSL.
- Train the encoder and R3NN end-to-end on thousands of synthetic programs and their input-output examples to learn a neural synthesis policy.
- Use the learned model to perform neural program search in the DSL, generating programs consistent with input-output examples without manual rule engineering.
- Enable generalization to real-world benchmarks by leveraging the expressive power of API compositions and neural generalization.
Experimental results
Research questions
- RQ1Can a neural network-based synthesis algorithm effectively learn to generate programs in a DSL centered on function APIs rather than low-level string operations?
- RQ2To what extent can a learned neural search strategy outperform traditional enumerative search methods in program synthesis for data transformation tasks?
- RQ3Can a neural model generalize across diverse data wrangling patterns, including semantic transformations like date-to-month-name or state abbreviation?
- RQ4How does the use of API-first DSLs with compositional structure affect the scalability and accuracy of neural program synthesis?
Key findings
- Dapip achieves 45% accuracy on 238 real-world FlashFill benchmarks, significantly outperforming baseline enumerative search methods.
- The neural synthesis approach generalizes well to unseen data wrangling tasks, including semantic transformations such as name abbreviation and address parsing.
- The cross-correlational encoder effectively captures input-output relationships, enabling accurate program prediction from minimal examples.
- The R3NN architecture enables efficient, incremental program construction by modeling partial derivations and predicting valid API expansions.
- The system demonstrates that end-to-end training of neural components can replace manually engineered heuristics in program synthesis, reducing engineering overhead.
- The DSL design with first-class APIs allows for more concise and expressive programs compared to traditional PBE DSLs, improving model generalization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.