Jul 2, 2021 - Technology

Programs that write programs

Illustration of an infinite, recursive tunnel of laptops.
Illustration: Shoshana Gordon/Axios

A new AI tool can work with human programmers to analyze computer code they've written and generate new matching code to complete programs.

Why it matters: The tool can help take some of the scutwork of programming off human experts' hands, leaving them freer to focus on the more creative parts of their jobs. But it also opens the door to a world in which programs could one day fully write programs, which may be bad news for some of the humans that currently do it.

What's happening: Called Copilot, the new tool was launched this week by Microsoft, the collaborative coding platform Github and OpenAI, a machine-learning company that developed the text-generating model GPT-3.

  • GPT-3 is a natural-language model trained on a massive quantity of text, which it can use to predict the relationship among words and sentences, allowing it to generate astoundingly convincing text when given a prompt.
  • Copilot was built on a algorithm called OpenAI Codex that works like GPT-3, but for computer code instead of human language.

How it works: Codex was trained on terabytes of openly available code pulled from Github, and uses that training to recommend code for software developers to use as they program.

  • Github CEO Nat Friedman told CNBC that Copilot works like an automated version of a pair programmer — someone who works with a coder at the keyboard and provides a second set of eyes and suggestions.
  • Copilot can look at code that has been written as well as the location of the cursor and offer up new lines to add.
  • As the human programmer accepts or rejects those recommendations, Copilot can improve itself over time.

By the numbers: According to one study, programmers spend half their work time not programming but debugging, at a cost of about $312 billion per year.

  • Automated programming tools could help cut that waste.

The catch: Some programmers have expressed concerns that Copilot may sometimes recommend code taken verbatim from the system's open-source training set, which would essentially mean that code meant to be free was being repackaged in a commercial model.

  • A study by Github, though, found that verbatim training code ended up in generated code just 0.1% of the time.

The bottom line: In its current form, Copilot is an example of assistive automation — making individual humans more productive by automating some, but not all, of their workload.

  • But as Copilot and other software automation tools improve, they could become substitutive — automating human programmers altogether — which would definitely be ironic.
Go deeper