A DARPA-funded stab at AI-driven software development
- By Susan Miller
- Apr 27, 2018
A team of computer scientists from Rice University's Intelligent Software Systems Laboratory have created an application that uses deep learning to help programmers write code snippets that contain Java application programming interfaces.
Programmers can code to fill in gaps in their programs by querying the application, called Bayou, for either an API method call that the generated program should use or an API data type they want the generated code to use. According to a tutorial on the program, Bayou then makes a judgment call about what kind of program it’s being asked to write.
Bayou uses a technique called neural sketch learning, which trains an artificial neural network to recognize high-level patterns in hundreds of thousands of examples, officials at Rice said. It does this by creating a “sketch” for each Java program it reads and then associates this sketch with the “intent” for the program that it gets from the user's input.
Bayou was trained with data from GitHub's online source code repositories. The Java programs in the training data are annotated with a label, which may contain information such as the set of API calls, library functions or the types used in the code and its metadata. When a user queries Bayou based on those labels, it refers to its sketches to find the most likely matches.
“Based on that guess, a separate part of Bayou, a module that understands the low-level details of Java and can do automatic logical reasoning, is going to generate four or five different chunks of code,” said Bayou co-creator Chris Jermaine. “It’s going to present those to the user like hits on a web search. ‘This one is most likely the correct answer, but here are three more that could be what you’re looking for.'”
The scientists think Bayou is a major improvement over previous attempts to build systems to write code. “You usually need to give a lot of details about what the target program does, and writing down these details can be as much work as just writing the code,” co-creator Swarat Chaudhuri said. “A developer can give Bayou a very small amount of information -- just a few keywords or prompts, really -- and Bayou will try to read the programmer’s mind and predict the program they want.”
"Modern software development is all about APls," Bayou architect Vijay Murali said. "These are system-specific rules, tools, definitions and protocols that allow a piece of code to interact with a specific operating system, database, hardware platform or another software system. There are hundreds of APIs, and navigating them is very difficult for developers. They spend lots of time at question-answer sites like Stack Overflow asking other developers for help."
Bayou will answer such questions instantaneously. "That immediate feedback could solve the problem right away, and if it doesn't, Bayou's example code should lead to a more informed question for their human peers," Murali said.
The team's primary goal is to get developers to help extend Bayou, which has been released under a permissive open-source license. "The more information we have about what people want from a system like Bayou, the better we can make it," Jermaine said. "We want as many people to use it as we can get."
Bayou was created through an initiative funded by the Defense Advanced Research Projects Agency and has been released under a permissive open-source license.
The live web demo is available here and the full paper here.
Susan Miller is executive editor at GCN.
Over a career spent in tech media, Miller has worked in editorial, print production and online, starting on the copy desk at IDG’s ComputerWorld, moving to print production for Federal Computer Week and later helping launch websites and email newsletter delivery for FCW. After a turn at Virginia’s Center for Innovative Technology, where she worked to promote technology-based economic development, she rejoined what was to become 1105 Media in 2004, eventually managing content and production for all the company's government-focused websites. Miller shifted back to editorial in 2012, when she began working with GCN.
Miller has a BA and MA from West Chester University and did Ph.D. work in English at the University of Delaware.
Connect with Susan at firstname.lastname@example.org or @sjaymiller.