Stanford used AI to fix robot software and lifted task success 4.5x
A coding AI watched robots fail in simulation, then rewrote the software directing them. No new training was needed, though real-world tests are still to come.

The short version
- Stanford researchers had a coding AI watch simulated robots fail, then rewrite the software that directs them. The robot's own AI got no new training.
- Average success in new scenes rose from 9.7% to 43.3%, a gain of 4.5x, after at most 5 rounds of fixes.
- It hasn't been tested on real robots yet, but it shows another way to adapt robots to new jobs.

What the researchers did
Teaching a robot a new job usually means collecting fresh demonstrations and retraining its AI, a process called fine-tuning. It is slow, and it often has to be repeated for each new task or machine.
A Stanford team tried another route, in a paper posted on October 30. They left the robot's trained AI untouched and focused on the ordinary code around it. This code decides when to ask the robot's AI for a move, when to use a camera tool and when to steer the arm directly. Engineers normally write it by hand, through repeated trial and error.
Their system, RoboArchitect, hands that job to a coding AI. The robot tries a set of tasks and every step is recorded. The coding AI reads the recordings, works out what went wrong and rewrites the control code. A new version is kept only if it beats the last one. The team ran this for at most 5 rounds.
They then tested the result on situations it had never seen. Success rose from 9.7% to 43.3% in new scene layouts. In entirely new tasks, it rose from 12.7% to 40.2%.
What the AI came up with
The fixes look a lot like what a good engineer would write, and each one can be read and checked. Nobody told the coding AI how to divide the work between the code and the robot's AI. It worked that out from the recordings. Its fixes included:
- Spotting a jammed arm and lifting it clear before trying again.
- Reaching in sideways when a shelf blocked the path from above.
- Pushing harder when the arm was pressing too gently on a door.
- Remembering what worked, such as how deep to grip an object, and using it later.
The biggest gains came where the robot's AI was furthest from what it had trained for. In one setup, the robot's AI kept its gripper open the whole time, so it could never pick anything up. The system learned to ignore that AI and steer from the camera. Success on its practice runs went from 0% to 100%. It then reached 87.5% in new scenes and 66.7% in new tasks.
In several tests this rewritten code beat a version of the same AI that had been retrained for the job. It lost in one case, on new tasks for one robot.
What is new here
Recent robot work had already shown that good control code can make a big difference, but people still wrote it by hand for each setup. The new step is automating that work.
The first attempt was often not enough. Some first versions did worse than the robot's AI alone in new situations. Later rounds, which learned from the failures of earlier versions, improved on nearly all of those results.
What it means for your company
Manufacturers and warehouse operators often run mixed equipment and switch products. If each change needs new demonstrations and retraining, the cost can decide whether automation makes sense at all. Faster adaptation could bring smaller production runs within reach.
These are early results. All of this ran in simulation. Testing on real robots is listed as future work. A 43.3% success rate also means the robot still fails more often than it succeeds, which no factory would accept. The tasks were mostly picking up and placing objects. One shared version built to run across different robots reached just 28.8% on tests it hadn't seen.
What to do next
- Ask your robot suppliers whether their systems keep full step-by-step recordings. Without those, this kind of automatic fixing can't work.
- Find out who can see and change the control code around your robots. Your team needs permission to change it.
- Pick one repetitive job that fails in known ways, and test AI-written fixes in simulation before anything touches the factory floor.
- Require a person to review any AI-written control code before it reaches a machine, with safety checks that the code can't change.
- Compare the cost of this approach with retraining when you plan your next product changeover.
