AlphaCode can solve complex problems and create code using AI

The software system competed against human coders in programming contests.
Brittney Grimes
A software engineer looking at code on a large wall screen.
A software engineer looking at code on a large wall screen.


A novel system called AlphaCode uses artificial intelligence (AI) to create computer code, and has recently participated in programming competitions, using critical thinking, algorithms, and natural language comprehension. The AI system performed extremely well in competitions.

AlphaCode can create code quickly and efficiently

AlphaCode is an AI software system created by DeepMind, a subsidiary of the company Alphabet, the parent company of Google. The software generates code in Python or C++, while filtering out any bad coding. It has the ability to generate code at an exceptional rate.

The system was trained to solve problems and generate code solutions. It filters out bad code through a process that involves keeping only 1% of the programs that pass the test cases. Then, to narrow down the results even further, it groups together all of the good code based on similar input and output generated from algorithms it receives.

It submits the generated programs based on each clustered group, starting with the largest and eventually narrows the programs down to 10 submissions, which is the approximate number of submissions from human competitors participating in the contests.

AlphaCode compared to Codex, another other AI coding system

The ability to create numerous codes at a fast rate also makes this AI standout. There are a few AI coding systems, with another well-known system for coders called Codex. The coding system Codex was created by OpenAI, the makers of DALL-E and ChatGPT.

OpenAI had initially created the AI software system in 2021 as a successor of GPT-3, however there were limitations, including the amount of code it could create and poor performance when assessing complex problems. However, it can assist with translating natural language into code. It is proficient in a dozen programming languages and powers GitHub copilot, a software company that offers an online repository service, a location for storing and managing data.

The ability to solve complex problems

DeepMind created AlphaCode as a powerful code generator and problem-solving tool. It was created to assist programmers by generating code, while also solving more complicated problems. AlphaCode was created to try to solve issues that arose in other AI coding systems, specifically having the ability to solve difficult problems that require analysis and logic on a deeper level.

In order to achieve good performance for coding, DeepMind discovered three key points that needed to be incorporated — an extensive and clean competitive programming dataset for training and evaluation, large and efficient-to-sample transformer-based architectures, and large-scale model sampling to explore the search space, followed by filtering based on program behavior to a small set of submissions, according to the company website.

The results from the research were published on Dec. 8 in Science.

Programming competition results

According to the study, after AlphaCode was trained, it solved about 34.2% of the problems it was given. In order to further test the skill and expertise of the AI system, DeepMind entered AlphaCode into online coding competitions. In competitions with 5000 programmers or more, AlphaCode ranked in the top 54.3%.

AlphaCode has the ability to generate millions of programs using trained transformer-based networks — a neural network used for processing sequential data — and then filters the programs into a maximum of 10 submissions, comparable to the number of human submissions. “We filter, cluster, and rerank those solutions to a small set of 10 candidate programs that we submit for external assessment. This automated system replaces competitors’ trial-and-error process of debugging, compiling, passing tests, and eventually submitting,” the researchers said on their website.

The first time AI has performed competitively in programming contests

The results are unprecedented, being the first-time artificial intelligence software has performed competitively in programming contests.  AlphaCode can evaluate and produce complex programs at a competitive level, something that has never been done before.

In the future, AlphaCode could potentially assist programmers when creating code. “AI coding might have applications beyond winning competitions,” Yujia Li, a computer scientist at DeepMind and paper co-author, told Science. “It could do software grunt work, freeing up developers to work at a higher, or more abstract level, or it could help noncoders create simple programs.”

Add Interesting Engineering to your Google News feed.
Add Interesting Engineering to your Google News feed.
message circleSHOW COMMENT (1)chevron
Job Board