Loading…

Neural networks could help computers code themselves: Do we still need human coders?

The next big revolution in coding practice might be closer than we think, and it involves helping computers to code themselves. By utilizing natural language processing and neural networks, some researchers think that within a few years we can remove humans entirely from the coding process. If you work as a coder, you'll be glad to hear that they are wrong.

Article hero image

When I was in college, we had to write out code by hand on computer science exams.

On paper. With pens.

If you learned to code anytime in the past ten years, you probably think that sounds barbaric, inefficient, and just plain stupid. And you'd be right. But there is also a serious point here: that the technologies we use for computer programming are constantly evolving, and are doing so pretty fast. I count myself lucky that my exams didn't involve punched cards.

The next big revolution in coding practice might be closer than we think, and it involves helping computers to code themselves. By utilizing natural language processing and neural networks, some researchers think that within a few years we can remove humans entirely from the coding process.

If you work as a coder, you'll be glad to hear that they are wrong. We are going to need human coders for a long while yet. In this article, I'll explain why.

Neural networks and coding

First, let's look at this new generation of coding tools, and see what they can do. The idea of using neural networks, machine learning, and AI tools in programming has been around for decades, but its only now that the first usable, practical tools are emerging. These tools can be broken down into three types.

The first is tools that aim to automatically identify bugs. This has been one of the most successful applications of neural networks to programming and has certainly been extremely useful for some coders. Swiss-based company DeepCode has been leading the way in this type of tool, but even their offering has serious limitations, which I will come to shortly.

Secondly, there is a range of tools that aim to produce basic code by themselves, or which can autocomplete code for programmers. These tools are now being released across many popular development platforms. Facebook has made a system called Aroma that autocompletes small programs, and DeepMind has developed a neural network that can come up with more efficient versions of simple algorithms than those devised by humans.

Then there is the most exciting application of neural networks to programming: the research being done by a team from Intel, MIT, and the Georgia Institute of Technology. These researchers have developed a system called Machine Inferred Code Similarity, or MISIM, which they claim is able to extract the "meaning" of a piece of code in the same way that NLP systems can read a paragraph of human-generated text.

This MISIM system promises to be a revolutionary tool if its full potential can be realized. Because it is language-independent, the system could read code as it is being written and automatically write modules to achieve common tasks. Much of the code that is used for automating cloud backups is the same across many programs, and compliance processes are also a major time-sink for many coders.

Systems like MISIM promise to make the process of writing code far more efficient than it is currently, but they still have significant limitations. Let's look at some.

The limitations

Coding tools based on neural networks are unlikely to replace human coders anytime soon. To see why let's look at the limitations inherent in the three main ways that these tools are being used.

First, ML and AI programs that are designed to catch bugs in human-created code are extremely useful, but only up to a point. At the moment—and as you will be painfully aware of if you've used one of these programs—they tend to produce an enormous number of false positives: features that the AI thinks might be bugs, but are not. The fact that these tools err on the side of caution is, of course, great from an infosec perspective, but is also an indication of their limited ability to understand the complexities of contemporary programming.

Second, tools like Aroma and OpenAI’s GPT-3 language model can churn out simple pieces of code, even from natural language descriptions, but only under the direction of humans. They perform extremely well when given a limited, controlled problem to solve, but are (so far) incapable of looking at a design brief and working out the best approach to take.

The third type of tool I've mentioned above—MISIM and it's related systems—is undoubtedly the most innovative use of neural networks in coding, and holds the most promise to make a real difference to the way we work. However, it should be noted that this system is still in the early stages of development, and is a long way from even a public beta. I'll withhold judgment on its limitations, therefore, until I get my hands on a version.

Finally, though, it's also worth pointing out that there is a more fundamental limitation implicit within all of these tools: creativity.

In other words, while these tools are great at completing code given a prompt, they are not going to win any design awards, either for coding or design. Even the best web design software has tried and failed to implement AI-driven aesthetic tools—there is a good reason for that: humans know what looks good to other humans.

Using this aesthetic, creative capacity has been a major focus of coding paradigms over the past few decades. It is one of the reasons, for instance, why many of the best front end development frameworks around today are so visually-oriented. Humans are great at spotting patterns in seemingly unrelated data, and AIs are great at performing repetitive, time-consuming tasks.

Collaboration and creativity

This inability to create new solutions is why, ultimately, neural networks are not going to replace humans. Instead, we need to identify which tasks are best done by AIs, and which are best done by humans, then build a collaborative approach to coding that draws on the strengths of both.

There are a couple of clear ways forward when it comes to doing this. One is to use AI coding tools to train human developers in a much more flexible, efficient, targeted way than is currently possible in our education system. It could be, for instance, that automated recommendation systems could be used to teach programming security for beginners, by providing detailed guidance on securing real-life systems as they are being coded.

Secondly, AIs are showing great promise when it comes to tracking the activities of human coders and making their work more efficient. A good example of this is the automatic invoices that many companies now use, in which an ML system is used to track the activities of human employees. Indeed, providing each human coder with an AI assistant that learns how they work, and then makes recommendations based on their previous solutions, would be of great benefit to the majority of developers.

Third, systems like MISIM, even if they are not able to fully automate the writing of code, may have a slightly unexpected benefit: they can be used to rewrite legacy systems. Because tools like MISIM are platform-independent, they could potentially teach themselves to understand ancient (and now pretty obscure) coding languages like COBOL and then re-write these programs in a usable format like Python. Who still uses COBOL, you ask? Well, the US Government, for one.

All of these approaches do not seek to replace human coders with machine analogs. In fact, they are all informed by a different paradigm: that when it comes to coding, humans, and machines can work together as colleagues, rather than as rivals.

The bottom line

That might sound like a vision of utopia, but take a longer view and you'll see that it is one that is eminently feasible. In many ways, the advent of AI and ML tools in coding mirrors the prior development of graphical coding tools and even programming languages themselves. Neither your front-end development tools nor your python scripts interact with your hardware on a fundamental level: everything, lest we forget, needs to be translated to binary machine code.

Seeing coding as a process of "translation" might be out of fashion now, but it was an approach that certainly informed my own training. Two decades ago, we were explicitly taught the way in which our code would be converted into assembly language; nowadays, this approach would seem to be a total waste of time.

Ultimately, this is what the development of AI coding tools seeks to extend. The end goal here is that systems like MISIM will be able to take a description of a computer program—or even a description of a problem to be solved—and produce a program on their own. But it's important to remember that the description will still be given by a human.

Add to the discussion

Login with your stackoverflow.com account to take part in the discussion.