A DARPA-funded stab at AI-driven software development
Connecting state and local government leaders
Bayou uses deep learning to help programmers write snippets of code that contain Java application programming interfaces.
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.