iStock / crispyicon

Artificial intelligence has taught itself to create its own encryption and produced its own universal 'language'. Now it's writing its own code using similar techniques to humans.

A neural network, called DeepCoder, developed by Microsoft and University of Cambridge computer scientists, has learnt how to write programs without a prior knowledge of code.


First reported by the New Scientist, the system works by taking lines of code from existing programs and combining them.

The system is only able to produce short, five-line, pieces of code at present but this has been enough to test it against real-world problems used by trainee developers. "We have found several problems in real online programming challenges that can be solved with a program in our language," the research paper says.

Read next Covid-19 has shown how easy it is to automate white-collar work Covid-19 has shown how easy it is to automate white-collar work

The authors add that they have "made significant progress" in being able to solve online programming competition problems. For example, the system was able to create a program that could compare two people's exam results and count how many questions one person got more marks on than the others.

Within the work, the researchers decided a programming language such as Python or C++ was too complex due to the array of options possible within them. Instead, they focused on Domain Specific Languages, which are more closed-off and specific to the desired outcome. The team says its DSL is "loosely inspired" by the SQL or LINQ languages.


The code in these systems has high-level functions that can be used in sequences to alter data in the problems they are trying to solve. Once the code had been chosen, a dataset of existing examples was created.

Subscribe to WIRED

The dataset was then fed into a machine learning system that deeply searched through the source code and selected which elements may be useful for solving the problem it had been tasked with. "After observing inputs and outputs," the paper said, it "can be used to search for a program that matches the input-output examples".


Thus, the hybrid code was born. Armando Solar-Lezama, a Massachusetts Institute of Technology researcher, told the New Scientist that creating a large amount of code is difficult but a piece-by-piece development could help to automate the creation of some programs.

The Microsoft and Cambridge computer scientists say DeepCoder is only tackling the "simplest problems" in coding, but they see a bright future. "We foresee many extensions of DeepCoder...and are optimistic about the future prospects of using machine learning to synthesise programs."

This isn't the only attempt to create code using artificial intelligence, though. Benjamin Tran Dinh, from Mapbox, has experimented with neural networks and Python to produce code in the past.