OpenAI's GPT-3 and Codex learn to edit, not just autocomplete
Curated by the Inblix editorial team
OpenAI just gave its flagship models a fundamental new skill: the ability to revise existing text and code, not just tack more words onto the end. The company released new versions of GPT-3 and Codex that can both insert content into the middle of a body of text and edit existing passages based on an instruction. This is a shift away from the pure autocomplete paradigm that defined these models at launch.
Think about how writing actually works. You don’t just append sentences endlessly—you go back, rework a paragraph, refactor a messy function. That iterative process was previously invisible to the API. Now, with the new ‘insert’ capability, a model can fill in the gap between two section headers by considering the context of what comes after, not just what came before. OpenAI’s blog post shows a clear example: without future context, the model rambles off-topic. With it, the generated text ties the two sections together logically. Codex uses this same trick to complete a missing function while importing the right libraries, something impossible if it couldn’t see the code calling that function downstream.
A separate ‘edits’ endpoint takes a different approach. You feed it existing text and a natural language instruction—say, ‘rewrite this poem in the first person’ or ‘convert this JSON to YAML.’ The model then returns a revised version. OpenAI demoed this by taking a ranked list of cities in JSON, stripping out the rank field, expanding state abbreviations, and then converting the whole thing into a Python function that returns YAML. That’s multiple, specific transformations handled in sequence. GitHub Copilot is already piloting the insert feature with what OpenAI calls ‘promising early results,’ though no hard data on success rates was shared.
The insert feature is available now in beta on the completions endpoint, priced the same as the existing Davinci models. The edits endpoint is also in public beta and is currently free to use. Making editing free during the beta is a smart move—it encourages developers to kick the tires and find edge cases. The real question is how reliably these models follow nuanced instructions. Changing a poem’s perspective is cute, but getting a model to consistently refactor production code without introducing subtle bugs is a much higher bar. If the early Copilot results hold up, this could change how developers interact with AI assistants, moving them from a fancy autocomplete to a tool that can actually rewire existing logic on command.
💡 Key Takeaways
- GPT-3 and Codex can now insert text mid-document by considering both preceding and following context, fixing a major limitation of the original forward-only architecture.
- A new edits endpoint lets developers issue natural language instructions to transform existing text, from changing tone to refactoring code across programming languages.
- The edit functionality is in free public beta, while the insert capability costs the same as standard Davinci calls, signaling OpenAI wants rapid adoption and real-world testing.
Keep reading: See related articles below for more coverage on this topic.
Get smarter about AI
The sharpest AI news, curated daily. Delivered free to your inbox.