Amazon Patents an AI Code Fixer That Backs Up When It Gets Stuck
Amazon's patent gives an AI code fixer an undo button. When a fix leads nowhere, it rewinds to an earlier save point and takes a different route.

- Publication number
- US 2026/0377158 A1(US20260377158A1)
- USPTO patent title:
- State Based Correction Mechanism for Code Transformation Using Generative Artificial Intelligence
- Applicant
- Amazon Technologies, inc.
- Filed · Published
- May 22, 2025 · Nov 26, 2026
- Inventors
- Jiangtao ZHANG, Gaurav GUPTA, Luke Jun HUAN, Anoop DEORAS, Rahul TONGIA, Alexis HENRY, Jasmeet CHHABRA, Harshad Vasant KULKARNI
- Status when we published
- Waiting for an examiner
- Document
- 20 claims
- US classification
- 717/140
What Amazon's rewind-and-retry code fixer does
Imagine your company needs to move a huge, decades-old program from one programming language to another, say COBOL to Java. An AI does the first pass and leaves 12 errors behind. It fixes some, then hits a wall with 3 stubborn ones it can't crack.
Today, the patent says, these AI helpers usually move in one direction only. Once they pick a path, they can push ahead or start the whole job over, which burns a lot of computing time and sometimes never finishes.
Amazon's patent adds a rewind button. After each step, the system saves a checkpoint, like a save point in a video game. If a step leads to a dead end, it jumps back to an earlier save, checks a list of what already failed, and tries a different route instead of repeating the same mistake.
… determining an error that cannot be resolved by progressing to a subsequent step of the code transformation plan; returning state to a state that occurred prior to the first step; attempting step that is different than the first step from the state that occurred prior to the first step.
Translation: When an error gets stuck, the system rolls back its progress and tries a completely different approach.
How the checkpoints and failure list work
The filing covers a service that takes a request to transform code (for example, COBOL to Java, Java 8 to Java 17, or one cloud setup to another) and first generates a plan: a sequence of steps for fixing the errors the first conversion leaves behind. Each step has a defined input, a defined output and success criteria, so the system can tell whether it worked.
For every step, an orchestrating AI agent (a software helper with a specific job) picks which agents or tools should do the work. It decides using three things:
- The current state of the code
- An historical observation, a record of what happened on earlier attempts
- A reward, a score that ranks the possible next moves
After a step succeeds, the system writes a checkpoint: the code at that moment, paths not yet tried, a timestamp, the reward and dependency graphs (maps of which errors and files depend on which). When a step can't finish, the next step can be a previously executed one. The system restores a checkpoint and tries an alternative, while a failed-attempts list keeps it from repeating known bad paths.
The filing walks through an example that starts with 12 errors, drops to 3, stalls, backs up, tries several other branches, and eventually gets down to 2. It keeps going until there are zero errors or the budget runs out.
… determining one or more agents and/or tools to execute the step based on a current state of the code, an historical observation-based input, and a reward, executing the step using the determined one or more agents or tools, and determining a next step of the plan to perform, wherein the next step is one of a subsequent step or a previously executed step.
Translation: It decides which AI helpers or software tools to use based on past results and what the code looks like now.
Why this matters for old software upgrades
Moving old software to a newer language or version is slow, expensive work, and AI helpers that stall mean wasted computing time and full restarts. A system that can back up and try another route could finish more of these jobs without a person stepping in.
The claims describe this running as a transformation service inside a multi-tenant cloud (one pool of hardware shared by many customers), next to a storage service, which fits how Amazon sells cloud tools. You would likely never see it directly. At most you'd see its effect as companies finishing upgrades of the systems behind everyday services faster. It is still a patent application, so nothing here says it will ship.
This is the 12th Amazon filing we've tracked in Enterprise AI since May, adding to work like one scoring AI model updates and one routing requests between models.
Source: US 2026/0377158 A1 at the USPTO (PDF). Full patent text and figures are in the official publication.
Get our take in your Top Stories
Liked this breakdown? Add Patentlyze as a preferred source on Google, and our plain-English take shows up more often in your Top Stories the next time Amazon patent news breaks.
We read the new patents from Big Tech, carmakers and more and send you the ones worth knowing. Plain English, free, every week.
The drawings · 11 sheets
11 drawing sheets from US 2026/0377158 A1 · click any drawing to enlarge

No comments yet