A Google Brain Program Is Learning How to Program

Synced
Synced
Apr 11, 2019 · 3 min read
Image for post
Image for post

The idea of using machine learning to teach programs how to automatically write or modify code has always been tempting for computer scientists. The feat would not only greatly reduce engineering time and effort, but could also lead to the creation of novel and advanced intelligent agents. In a new paper, Google Brain researchers propose using neural networks to model human source code editing. Effectively this means treating code editing as a sequence and having a machine learn how to “write code” like in a natural language model — by analysing a short paragraph of editing, the model can extract intent and leverage that to generate subsequent edits.

To understand the intent behind developers’ source code editing actions, the main challenge was how to learn from earlier editing sequences in order to predict upcoming edits. Researchers explain the AI models needed to understand “the relationship of the change to the state” rather than “the content of the edits” or “the result of the edit.”

To develop a good representation that captures the desired intent information and scales the sequence length, Google Brain researchers proposed two editorial characterizations: explicit characterization and implicit characterization. Explicit characterization clarifies the result of each edit in an instantiated sequence, while implicit characterization instantiates complete initial state and subsequent editing in a more compact, diff-like characterization.

Image for post
Image for post

In implicit characterization, researchers created a simple sequence-to-sequence model and a two-headed attention-based model that has a pointer network head for generating editing positions and a content head for generating editing content. The models weigh different problem formulations and then provide a design for future editing sequence models.

Researchers used synthetic data to test models’ ability to learn editing patterns, then collected and trained the models on large datasets from Google Sources, which contain millions of fine-grained edits from thousands of Python developers.

From a modeling perspective, researchers concluded that the new combination of attention and pointer network components provides the best overall performance and scalability. The results also open up various potential AI-powered opportunities for future machine-human collaboration on coding.

Read the paper Neural Networks for Modeling Source Code Edits on arXiv.


Author: Reina Qi Wan | Editor: Michael Sarazen


2018 Fortune Global 500 Public Company AI Adaptivity Report is out!
Purchase a Kindle-formatted report on Amazon.
Apply for Insight Partner Program to get a complimentary full PDF report.

Image for post
Image for post

Follow us on Twitter @Synced_Global for daily AI news!


We know you don’t want to miss any stories. Subscribe to our popular Synced Global AI Weekly to get weekly AI updates.

Image for post
Image for post

SyncedReview

We produce professional, authoritative, and…

Synced

Written by

Synced

AI Technology & Industry Review — syncedreview.com | Newsletter: http://bit.ly/2IYL6Y2 | Share My Research http://bit.ly/2TrUPMI | Twitter: @Synced_Global

SyncedReview

We produce professional, authoritative, and thought-provoking content relating to artificial intelligence, machine intelligence, emerging technologies and industrial insights.

Synced

Written by

Synced

AI Technology & Industry Review — syncedreview.com | Newsletter: http://bit.ly/2IYL6Y2 | Share My Research http://bit.ly/2TrUPMI | Twitter: @Synced_Global

SyncedReview

We produce professional, authoritative, and thought-provoking content relating to artificial intelligence, machine intelligence, emerging technologies and industrial insights.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store