General Program Synthesis Using Guided Corpus Generation and Automatic Refactoring

Program synthesis aims to produce source code based on a user specification, raising the abstraction level of building systems and opening the potential for non-programmers to synthesise their own bespoke services. Both genetic programming (GP) and neural code synthesis have proposed a wide range of approaches to solving this problem, but both have limitations in generality and scope. We propose a hybrid search-based approach which combines (i) a genetic algorithm to autonomously generate a training corpus of programs centred around a set of highly abstracted hints describing interesting features; and (ii) a neural network which trains on this data and automatically refactors it towards a form which makes a more ideal use of the neural network’s representational capacity. When given an unseen program represented as a small set of input and output examples, our neural network is used to generate a rank-ordered search space of what it sees as the most promising programs; we then iterate through this list up to a given maximum search depth. Our results show that this approach is able to find up to 60% of a human-useful target set of programs that it has never seen before, including applying a clip function to the values in an array to restrict them to a given maximum, and offsetting all values in an array.

[1]  Alex Graves,et al.  Neural Turing Machines , 2014, ArXiv.

[2]  Sumit Gulwani,et al.  Neural-Guided Deductive Search for Real-Time Program Synthesis from Examples , 2018, ICLR.

[3]  Roman V. Yampolskiy,et al.  Why We Do Not Evolve Software? Analysis of Evolutionary Algorithms , 2018, Evolutionary bioinformatics online.

[4]  Sebastian Nowozin,et al.  DeepCoder: Learning to Write Programs , 2016, ICLR.

[5]  Sumit Gulwani,et al.  Automating string processing in spreadsheets using input-output examples , 2011, POPL '11.

[6]  Geoffrey E. Hinton,et al.  Distilling the Knowledge in a Neural Network , 2015, ArXiv.

[7]  Yan Liu,et al.  Deep residual learning for image steganalysis , 2018, Multimedia Tools and Applications.

[8]  Sergio Gomez Colmenarejo,et al.  Hybrid computing using a neural network with dynamic external memory , 2016, Nature.

[9]  Mark Harman,et al.  Genetic Improvement of Software: A Comprehensive Survey , 2018, IEEE Transactions on Evolutionary Computation.

[10]  Sanjay Chaudhary,et al.  A Survey on Techniques of Improving Generalization Ability of Genetic Programming Solutions , 2012, ArXiv.

[11]  Lukasz Kaiser,et al.  Neural GPUs Learn Algorithms , 2015, ICLR.

[12]  Yoshua Bengio,et al.  Depth with Nonlinearity Creates No Bad Local Minima in ResNets , 2019, Neural Networks.

[13]  Dawn Xiaodong Song,et al.  Towards Synthesizing Complex Programs From Input-Output Examples , 2017, ICLR.

[14]  Isil Dillig,et al.  Program synthesis using conflict-driven learning , 2017, PLDI.

[15]  Westley Weimer,et al.  Neutrality and epistasis in program space , 2018, GI@ICSE.

[16]  Isil Dillig,et al.  Synthesizing data structure transformations from input-output examples , 2015, PLDI.

[17]  Sumit Gulwani,et al.  Spreadsheet table transformations from examples , 2011, PLDI '11.