LOGO

OpenAI Codex Upgrade: New AI Coding Capabilities

August 10, 2021
OpenAI Codex Upgrade: New AI Coding Capabilities

OpenAI's Codex: A New Era in AI-Assisted Coding

Significant advancements have recently been implemented by OpenAI to Codex, the AI coding assistant initially unveiled last month. The system is now capable of accepting instructions expressed in everyday English and generating functional, executable code in real-time. This allows for the creation of applications, such as games or web apps, without the need for manual variable naming.

Accessing the Codex API

A select group of developers, and potentially non-coders, will have the opportunity to test the capabilities of the new Codex API through a complimentary private beta program.

Codex: GPT-3 Reimagined for Code

Codex is fundamentally an adaptation of OpenAI’s powerful language model, GPT-3, but specifically trained on a vast dataset of code rather than general written text. This specialized training enables it to perform tasks like code completion and the generation of entire code segments.

Initially, interacting with Codex required a degree of coding expertise. However, this has changed with the introduction of the new API.

Natural Language Interaction

The new API interprets common requests articulated in natural language, such as “make the ball bounce off the screen edges” or “retrieve and sort data from a public API by date,” and translates them into working code in one of twelve supported programming languages.

A Live Demonstration of Codex in Action

A live demonstration was conducted by OpenAI co-founders Greg Brockman (CTO) and Wojciech Zaremba (Codex lead). During the demo, they constructed a basic game from scratch, illustrating the underlying processes.

The Focus on Creative Problem Solving

“Programming centers around formulating a vision and breaking it down into manageable components, followed by the actual coding of those components,” Brockman explained. The goal of Codex is to empower developers to dedicate more time to the initial conceptualization phase.

A substantial portion of coding involves replicating or adapting existing code. While creativity is essential, basic tasks like setting up a test web server shouldn’t require extensive imagination. Brockman demonstrated this by simply instructing the system to “create a webpage displaying that text.”

Within seconds, the system generated a dozen lines of JavaScript to accomplish this task in a standard manner.

Reducing Repetitive Coding Tasks

“This represents the most tedious aspect of programming,” Brockman stated. “I’ve likely written similar code dozens of times, yet I consistently struggle to recall the precise implementation. I don’t need to memorize these APIs; Codex simplifies the process, reducing keystrokes and interactions.”

Leveraging the Power of GitHub and GPT-3

Trained on a comprehensive collection of public code from platforms like GitHub, Codex possesses knowledge of established coding practices. It recognizes common patterns, such as the implementation of web servers, keyboard controls, and object animations.

Furthermore, the system’s natural language processing capabilities, inherited from GPT-3, allow it to maintain context and understand references within user requests. For example, when instructed to “make it smaller and crop it,” followed by “control its horizontal position with the left and right arrow keys,” the system correctly identifies “it” as the same object.

Maintaining Coding Context

Codex also retains several kilobytes of coding context, enabling it to adhere to established naming conventions, existing constraints, and implicit user intentions.

Understanding General Coding Principles

The system demonstrates an understanding of general principles embedded within the code corpus. When Brockman requested that “the boulder fall from the sky,” Codex didn’t inquire about the definition of “sky,” despite it not being previously defined. It positioned the boulder at the top of the screen and simulated realistic falling acceleration, drawing upon its understanding of gravity and spatial relationships.

Expanding Software Interaction

“We believe this offers a novel approach to interacting with existing software,” Zaremba commented, referencing a limited version he developed for his doctoral research. They showcased a Codex plugin for Microsoft Word.

Automating Complex Formatting Tasks

While word processors offer automation features, Codex can address complex formatting issues. For instance, it can rectify inconsistencies in text size and font across a document by responding to the prompt: “make all the text the same size and font, and make double spaces single.” It intelligently identifies and corrects stray styles, selecting the most appropriate font and size.

Further instructions, such as “make all the headings 24-point and bold,” are executed swiftly and efficiently.

Accessibility and Inclusivity

This technology offers significant benefits to a wide range of users, particularly those with disabilities. Individuals who rely on voice commands or assistive devices can perform complex tasks with greater ease.

A visually impaired coder, for example, can establish a standard public test server, but the process of searching Stack Overflow, adapting code snippets, and verifying syntax can be time-consuming.

Code Conversion and Portability

Codex can also convert and port code between different programming languages, functioning similarly to a translation engine that converts Spanish to French.

The Future of AI-Assisted Coding

Brockman emphasized that they are only beginning to explore the potential of Codex and anticipate being surprised by the innovations developers will create. The beta program, similar to the one for GPT-3, will be invite-only, with developers able to apply and describe their projects for consideration. The API will eventually be offered as a paid public service, with pricing and timing to be determined.

#OpenAI#Codex#AI coding#code generation#natural language AI#developer tools