Predictive Synthesis of API-Centric Code (AI column)
I continue to explore topics related to AI in SDLC, which leads me to articles like “AI”Predictive Synthesis of API-Centric Code" 2022 years. In this article, Daye Nam and others introduce a new approach, enumerative program synthesis, to work with data processing APIs such as PyTorch, NumPy, and Pandas. This approach combines human programming intuition with automated synthesis using a combination of deep learning. (deep learning) and traditional search methods. Below I will give some key points of the article.
1) Composite model for predicting API sequences The key idea is that API-oriented code can be synthesized by predicting sequences of API function calls in a compositional manner. The authors offer two variants of models: - First-of-Sequence (FOS): Predicts the first API function in a sequence based on the properties of input/output tensors. **- Full-Sequence (FUS)**Generates the entire sequence of API calls required to convert input data over the weekend. Both models use recurrent neural networks. (RNNs) tensor-coding (tensor shapes) and API embeddings, which allows them to learn patterns from examples of input and output data.
2) Integration with enumeration search (Enumerative Search) ML models are integrated into a list synthesizer to reduce search space. By prioritizing API sequences predicted by neural models, synthesis time is shortened in 6–10 compared to basic methods such as DeepCoder.
3) Processing complex data structures The work presents graph codings (graph-based encodings) dataframe (dataframes) It also allows neural networks to understand structural transformations. This is especially important for APIs such as pandas, where operations include changing the form of data, combining and aggregating tables.
Implementation details Dataset: Models are trained on synthetic examples of input and output generated by performing random sequences of API calls. For pandas, AutoPandas uses 1.4 millions of data points covering 119 functions. Embedding Layers: Encode API functions and tensor shapes into dense vectors. RNN Layers: Processing embedding sequences to predict the next API call or the entire sequence. Graph Neural Networks (GNNs): Represent data frames as graphs with nodes (columns) ribs (relationship).
Improvements to the search algorithm The approach combines symbolic performance (symbolic execution) with ML-oriented prioritization. For each API call candidate, the system checks for semantic correctness. (For example, compatibility of tensor shapes) It uses model confidence estimates to prioritize the study.
Interestingly, this whitepaper influenced subsequent work. 1. Development of ML-oriented program synthesis The methodology influenced tools like AutoPandas, which uses neural network-based generators to synthesize data frame transformations. 2. Type inference (Type Inference) and autocompletion Later works such as Type4Py and DeepInfer build on the idea of using ML for semantic predictions.
Limitations and open issues Generalization to unknown APIsModels have difficulty processing APIs not included in training data; this requires retraining models. Scalability for long sequences: Prediction accuracy decreases for longer sequences 3–4 step (What is solved by hierarchical reinforcement learning) - InterpretabilityThe black box of neural models makes debugging difficult; this stimulates research into explainable synthesis.
Interestingly, this whitepaper was written before the dominance of autoregression models such as GPT of all versions and relied more on the RNN network, getting decent results.
#AI #ML #Engineering #Software #Architecture #SystemDesign #DistributedSystems