Deep Learning for Program Repair

Slides:



Advertisements
Similar presentations
Tuomas Sandholm Carnegie Mellon University Computer Science Department
Advertisements

Chapter3: Language Translation issues
CHAPTER 12 ADVANCED INTELLIGENT SYSTEMS © 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang.
Analysis of a Neural Language Model Eric Doi CS 152: Neural Networks Harvey Mudd College.
Mastering the Pipeline CSCI-GA.2590 Ralph Grishman NYU.
CSC321 Lecture 24 Using Boltzmann machines to initialize backpropagation Geoffrey Hinton.
Deep Learning Overview Sources: workshop-tutorial-final.pdf
Mastering the Pipeline CSCI-GA.2590 Ralph Grishman NYU.
1 Deep Recurrent Neural Networks for Acoustic Modelling 2015/06/01 Ming-Han Yang William ChanIan Lane.
Fill-in-The-Blank Using Sum Product Network
Attention Model in NLP Jichuan ZENG.
TensorFlow– A system for large-scale machine learning
Convolutional Sequence to Sequence Learning
Learning linguistic structure with simple and more complex recurrent neural networks Psychology February 2, 2017.
RNNs: An example applied to the prediction task
End-To-End Memory Networks
CS 388: Natural Language Processing: LSTM Recurrent Neural Networks
Deep Feedforward Networks
Summary of “Efficient Deep Learning for Stereo Matching”
Deep Learning Amin Sobhani.
Data Mining, Neural Network and Genetic Programming
Convolutional Neural Fabrics by Shreyas Saxena, Jakob Verbeek
CLASSIFICATION OF TUMOR HISTOPATHOLOGY VIA SPARSE FEATURE LEARNING Nandita M. Nayak1, Hang Chang1, Alexander Borowsky2, Paul Spellman3 and Bahram Parvin1.
Neural Machine Translation by Jointly Learning to Align and Translate
Syntax Analysis Chapter 4.
Deep Learning: Model Summary
Inception and Residual Architecture in Deep Convolutional Networks
Neural Networks CS 446 Machine Learning.
Classification with Perceptrons Reading:
Intro to NLP and Deep Learning
Basic machine learning background with Python scikit-learn
Mini Presentations - part 2
Neural networks (3) Regularization Autoencoder
Machine Learning Basics
with Daniel L. Silver, Ph.D. Christian Frey, BBA April 11-12, 2017
A brief introduction to neural network
Master’s Thesis defense Ming Du Advisor: Dr. Yi Shang
Deep Learning based Machine Translation
RNNs: Going Beyond the SRN in Language Prediction
Goodfellow: Chap 6 Deep Feedforward Networks
COS 518: Advanced Computer Systems Lecture 12 Mike Freedman
Wei Liu, Chaofeng Chen and Kwan-Yee K. Wong
Final Presentation: Neural Network Doc Summarization
Word Embedding Word2Vec.
Code Completion with Neural Attention and Pointer Networks
Image to Image Translation using GANs
Deep Learning and Mixed Integer Optimization
Neural Networks Geoff Hulten.
المشرف د.يــــاســـــــــر فـــــــؤاد By: ahmed badrealldeen
Machine Translation(MT)
Report by: 陆纪圆.
Presented by Wanxue Dong
RNNs: Going Beyond the SRN in Language Prediction
Attention.
实习生汇报 ——北邮 张安迪.
Neural networks (3) Regularization Autoencoder
Martin Schrimpf & Jon Gauthier MIT BCS Peer Lectures
Please enjoy.
Deep Learning Authors: Yann LeCun, Yoshua Bengio, Geoffrey Hinton
Attention for translation
Deep Learning Libraries
Attention is not Explanation
Neural Machine Translation - Encoder-Decoder Architecture and Attention Mechanism Anmol Popli CSE 291G.
VERY DEEP CONVOLUTIONAL NETWORKS FOR LARGE-SCALE IMAGE RECOGNITION
Neural Machine Translation using CNN
CSC 578 Neural Networks and Deep Learning
Neural Machine Translation by Jointly Learning to Align and Translate
CS249: Neural Language Model
An introduction to neural network and machine learning
Patterson: Chap 1 A Review of Machine Learning
Presentation transcript:

Deep Learning for Program Repair Aditya Kanade Indian Institute of Science Dagstuhl Seminar on Automated Program Repair, January 2017

A Probabilistic Perspective on Program Repair Specification = A set of examples = { (x, y) | x is a faulty program and y is its fixed version } Represent the faulty and fixed programs as sequences of tokens x = x1, x2, …, xn and y = y1, y2, …, yk Learn a conditional probability distribution P(Y = y | X = x) Repair procedure: To fix an unseen program x, generate a y such that y = argmax P(Y = y’ | X = x)

Seq2seq Neural Net with Attention Mechanism Attention mechanism to focus on diff. parts of input sequence With fixed-size context vector

Neural Network Architecture Encoder Decoder

DeepFix: Fixing Common Programming Errors Common programming errors: Unlike logical errors, these are not specific to a programming task at hand, but relate to the overall syntax and structure of the programming language Analogous to grammatical errors in natural languages. Both experienced developers and novice students make them Detected by compilers as syntactic errors, but are neither accurately localized nor fixed by the compilers

Example Input faulty program with attention weights Program as repaired by DeepFix

The Iterative Repair Strategy of DeepFix An end-to-end deep learning solution where the neural net learns to both localize and fix the faults.

Experimental Setup Identifiers (variable and method names) are canonicalized Resulting vocabulary size is 129, tokens embedded in 50-dimensional vectors Seq2seq w/ attention network implemented in TensorFlow Both encoder and decoder are 4 stacked GRU layers of 300 cells in each layer Dropout at the rate of 0.2 on non-recurrent connections Training configuration Trained using ~150K examples created synthetically Stochastic gradient descent using Adam optimizer with mini-batch of 128 Gradients clipped at [-1,1] Training time of 1-2 hours per epoch Select the model with peak validation performance over 20 epochs

Results Evaluated on 6971 faulty C programs submitted to 93 programming tasks in an introductory programming tasks Fixed 27% programs completely such that the programs compile w/o errors Fixed additional 19% programs partially Evaluated on 9230 C programs with seeded faults Fixed 56% programs completely Fixed additional 17% programs partially Localization accuracy on seeded faults: Top-1 = 79%, Top-5 = 89% Types of errors fixed: missing delimiters, extraneous symbols, swapped symbols, missing variable declarations, etc.

Some Plots PCA projects of vector-representations of correct (circles) and faulty (triangles) programs Distribution of fixed programs by tasks

Lightweight Machine Learning

Statistical Correlation to Search for Likely Fixes Given a test suite and a potential faulty location, how to search for expressions that are likely to appear in the fixed version? Use symbolic execution to obtain desired expression values Enumerate a set of expressions and their values on all executions Rank expressions using statistical correlation with the desired values Used for synthesis of repair hints in MintHint [ICSE’14]

Clustering Programs for Large-Scale Feedback Generation on Student Code ? ? ? ? ? ? ? ? ? ? Clustering ? ? ? ? ? ? ? ? by solution strategy ? ? ? ? ? ? ? ? ? Instructor certifies one submission from each cluster as correct Student programs ?  ?  ? ?     ?  Verified feedback ?    ?  ?   ?   ? ? Used in CoderAssist [FSE’16] to generate feedback on student programs

Acknowledgements DeepFix: Fixing common C language errors by deep learning Rahul Gupta, Soham Pal, Aditya Kanade, Shirish Shevade AAAI’17 Semi-supervised verified feedback generation Shalini Kaleeswaran, Anirudh Santhiar, Aditya Kanade, Sumit Gulwani FSE’16 MintHint: Automated synthesis of repair hints Shalini Kaleeswaran, Varun Tulsian, Aditya Kanade, Alessandro Orso ICSE’14 Some images taken from the Deep Learning book by Goodfellow, Bengio and Courville

Discussion Points Improving performance of DeepFix, e.g., using a copying mechanism? Fixing more challenging programming errors? Handling larger programs? Learning better dependences? General-purpose deep nets versus special-purpose deep nets designed for program text? How to obtain high-quality training data? Mutation strategies?