A publication released in December 2017 by the U.S. Department of Energy’s Oak Ridge National Laboratory suggests that programming trends in software development will undergo “radical change” in the near future. It states that by 2040 artificial intelligence, not humans will write most of the code in use. The combination of machine learning, artificial intelligence, natural language processing and code generating technologies has led to rapid developments in this technology.
“The major technologies that will drive the creation and adoption of machine-generated code (MGC) already exist, either at research institutions or in the marketplace,” the paper says.
The main advancement in AI technology that made all this possible is called Deep Learning. Deep Learning is a part of a spectrum of machine learning methods based on learning data representations, as opposed to task-specific algorithms. The machines can learn unsupervised with sampled data without being explicitly programmed. Deep Learning is made possible by Artificial Neural Networks (ANNs) or connectionist systems. ANNs are partially inspired by the biological neural networks that constitute animal brains. When input or data is received, (like a picture or sound bite) a collection of connected units or nodes called artificial neurons transmit the input to other artificial neurons, and process the input.
An example would be a picture of a cat labeled "cat." The ANN identifies the details that make up a cat, such as fur, tails, whiskers and cat-faces. It then uses that learned information and applies it to other images to recognize cats in future images.
This same concept can be applied to code. We show the machine what code is and give it examples of code. The machine takes the examples and inputs to learn what each line does, and then applies what it learned to make new code that is more efficient.
AI-Generated Code is Already Here
The director of AI at Tesla, Andrej Karpathy, generated the first code via a Recurrent Neural Network back in 2015. He combined a large sum of Linux source files into one document and used this code to train the RNN. After running all night, the RNN created its own code, but not without errors. There were missing variables and new variables that were not earlier declared in the code. But overall, the AI-generated code included functions, declarations, parameters, loops, comments and indents. This shows that basic code functions can be automatized, but the creativity needed to navigate complex variables in code still requires human input. You can view the GitHub repository here.
A sample of the code that was produced by the AI.
Microsoft and Cambridge University are developing AI that can write code and that can learn from other parts of existing code. The project, known as DeepCoder, searches an extensive database of code, finds possible arrangements and improves its efficiency.
Marc Brockschmidt of Microsoft research says, “Such a system could be of great utility to non-coders. They only have to describe their program idea and wait for the system to create it. We might end up having such system in the next few years. But for now, DeepCoder’s capabilities are limited to programs consisting of five lines of code.”.
A Growing Concern
In a 2016 study by Evans Data Corporation, 29.1% of the 550 software developers polled said their fear is that their own obsolescence will be spurred by artificial intelligence.
“Another dimension to this finding is that over three-quarters of the developers thought that robots and artificial intelligence would be a great benefit to mankind, but a little over 60% thought it could be a disaster,” said Janel Garvin, CEO of Evans Data. “Overlap between two groups was clear, which shows the ambivalence that developers feel about the dawn of intelligent machines. There will be wonderful benefits, but there will also be some cataclysmic changes culturally and economically.”
No Need to Worry... For Now
Many experts say there will always be a need for developers. AI will merely be another tool in the developer’s toolbox to help write code and streamline the process. Carlos E. Perez, author of The Deep Learning AI Playbook says, “I’m not sure that software engineering, in the near future at least, will be completely different from what we do now. Yes, we’ll have help from deep learning neural network systems, but they’ll help us do our current job better rather than replace us entirely.”