AI can translate normal written text to code

Built off their famed GPT-3, OpenAI’s Codex can translate instructions from your language into programming.

There are two key considerations when it comes to coding, Greg Brockman, the chief technology officer and co-founder of AI research company OpenAI, told The Verge.

Part one is thinking about the problem, Brockman said, and really understanding it. The second part is figuring out how to solve that problem, using code. 

It’s this second aspect that OpenAI’s new system, called Codex, hopes to make easier, faster, and more accessible. 

Codex can go from text to code, taking commands written in plain English and bringing them to life.

Codex can go from text to code, taking commands written in plain English and bringing them to life. Type in “build a website with a menu on the left side and taskbar on the right,” to tweak The Verge’s example, and Codex will create it, without you having to type in any code. (Now, how well it creates it for you may take some tweaking.) 

Figuring out how to solve your problem with the proper code language is “probably the least fun part of programming,” OpenAI wrote on its blog announcing Codex; it’s also the highest barrier to entry.

Being able to go from text to code may not only make programmer’s lives easier, it could also open the door for people not fluent in the field’s crucial language — software.

From text to code: Language is something of a strong suit for OpenAI. The company has built powerful algorithms for natural language processing (NLP) — this is the kind of deep learning AI that allows Siri to understand you.

Their most robust AI language generator yet, GPT-3, was a phenomenon in AI circles when it debuted last summer; using essentially all of the written English on the internet as its learning material, GPT-3 is capable of cranking out pieces of writing that are startlingly human

According to OpenAI, Codex is a descendant of GPT-3, except that it isn’t built just on language, but also on the massive repositories of open-source computer code out on the internet — countless lines of code.

Armed with this knowledge base, Codex can go from text to code in a way similar to a conversation. WIRED’s Steven Levy got to see the AI in action, as Brockman and his other co-founder, Wojciech Zaremba, performed a live demo in San Francisco. 

“It … removes the drudge work.”

Greg Brockman

First, they had Codex build them a website, replete with copy and images, and put it online.

“Then, employing the casual language one might use in conversation, they built a simple game by grabbing web-based images of helicopters and getting them to fly across the screen and blast enemies,” Levy wrote.

OpenAI says Codex can be used to go from text to code for “essentially any programming task,” although they acknowledge that it may not do all those tasks very well. Rephrasing and tweaking the instructions may be necessary to get Codex to do exactly what you want, and — just like in typing out code yourself — sometimes an unexpected bug or two can slip in.

Not just for beginners: Being able to create games, apps, and websites in code without knowing it already or looking it all up is obviously a big help to beginners who haven’t done it all before.

But going from simple, conversational text to code would be an immense time saver for pro coders, too. During the WIRED demo, OpenAI CEO Sam Altman mentioned to Levy that Codex can do in seconds what would have taken him a half hour. 

“It takes people who are already programmers and removes the drudge work,” Brockman told The Verge. 

While Levy fears a potential loss of jobs and a cruel irony in people learning to code just as computers learn to do it for themselves, Code.org founder Hadi Partovi thinks automating the boring bits will improve computer science education, allowing us to train dreamers. 

Being able to go from text to code may not only make programmer’s lives easier, it could also open the door for people not fluent in the field’s crucial language — software.

“As the rote work of coding becomes easier, computer science education can focus on higher-level computational thinking concepts such as designing interfaces, algorithms, and data structures,” Partovi told Levy. (This is similar to how modern art schools work; they don’t teach students how to paint, per se.)

Text to code could be seen as the next step in the streamlining of computer programming, Zaremba told The Verge. What began as esoteric physical punch cards evolved into Short Code, BASIC, C, Python, Javascript, and all of the hundreds of digital programming languages. 

“These programming languages, they started to resemble English, using vocabulary like ‘print’ or ‘exit’ and so more people became able to program,” he said.

“Each of these stages represents programming languages becoming more high level. And we think Codex is bringing computers closer to humans, letting them speak English rather than machine code.”

Testing, tuning, and growing: Codex is still in private beta testing since its release in August. This period will be crucial to training Codex to be as competent as possible; the current iteration can only get about 37% of tasks right, Levy reported. 

“OpenAI Codex empowers computers to better understand people’s intent, which can empower everyone to do more with computers.”

Open AI

Eventually, Codex may not only help programmers, but serve as an interface — it can already run Windows, Spotify, and Google Calendar, The Verge reported.

“OpenAI Codex empowers computers to better understand people’s intent,” OpenAI wrote, “which can empower everyone to do more with computers.”

We’d love to hear from you! If you have a comment about this article or if you have a tip for a future Freethink story, please email us at tips@freethink.com.

Up Next
accent translator
Subscribe to Freethink for more great stories