Get the newsletter
Amazon · AI / ML · Filed May 22, 2025 · USPTO published Nov 26, 2026 · This week's release

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.

An AI exploring different ways to solve a problem tests several options and returns to an earlier starting point if it gets stuck. Drawing from patent filing US 2026/0377158 A1.
An AI exploring different ways to solve a problem tests several options and returns to an earlier starting point if it gets stuck.All 11 drawings ↓
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.

From the filing · CLAIM 1
… 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.

From the filing · THE ABSTRACT
… 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.

There are more where this came from

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

Cloud and local setups running the code repair tool, drawing sheet 1 from US 2026/0377158 A1
Sheet 1 Cloud and local setups running the code repair tool
How the tool spots freezes and restores past steps, drawing sheet 2 from US 2026/0377158 A1
Sheet 2 How the tool spots freezes and restores past steps
Breaking a big programming update into smaller choices, drawing sheet 3 from US 2026/0377158 A1
Sheet 3 Breaking a big programming update into smaller choices
Three ways the system tests solutions and rewinds dead ends, drawing sheet 4 from US 2026/0377158 A1
Sheet 4 Three ways the system tests solutions and rewinds dead ends
Managing teams of digital assistants assigned to specific tasks, drawing sheet 5 from US 2026/0377158 A1
Sheet 5 Managing teams of digital assistants assigned to specific tasks
Saved checkpoints recording untried paths and failed attempts, drawing sheet 6 from US 2026/0377158 A1
Sheet 6 Saved checkpoints recording untried paths and failed attempts
Steps for fixing broken code and trying backup routes, drawing sheet 7 from US 2026/0377158 A1
Sheet 7 Steps for fixing broken code and trying backup routes
An actual run undoing bad fixes until zero errors remain, drawing sheet 8 from US 2026/0377158 A1
Sheet 8 An actual run undoing bad fixes until zero errors remain
Show the other 3 sheets
Connecting user devices to cloud computing resources, drawing sheet 9 from US 2026/0377158 A1
Sheet 9 Connecting user devices to cloud computing resources
Cloud servers delivering remote storage and computing power, drawing sheet 10 from US 2026/0377158 A1
Sheet 10 Cloud servers delivering remote storage and computing power
Computer hardware that runs the code transformation software, drawing sheet 11 from US 2026/0377158 A1
Sheet 11 Computer hardware that runs the code transformation software
Patent filing page

Reader comments

No comments yet

Start the discussion

Real name or a handle, either is fine. Comments are read by a person before they appear, so allow a little time. Keep it about the filing.