Microsoft Patents a System That Rewrites AI Instructions Using the AI's Own Mistakes
Getting an AI to do exactly what you want often requires painstaking trial and error with the instructions you give it. Microsoft has patented a system that automates that whole process by asking the AI itself to figure out what's wrong with its own instructions.
What Microsoft's self-correcting AI prompt system does
A developer sits down to build an AI tool that summarizes legal contracts. They type in a set of instructions for the AI, run some test documents through it, and half the summaries come back wrong. The usual fix is to manually tweak the instructions, guess again, and repeat for hours.
Microsoft's patented system takes that guessing game away from the human. It feeds the AI's own errors back to it, asks the AI to explain what was wrong with the instructions that caused those errors, and then uses that explanation to generate a fresh batch of improved instructions automatically. It's a feedback loop where the AI critiques itself.
A second AI, trained specifically for the subject area at hand, scores the new batch of instructions and picks the best one. That winner becomes the starting point for the next round. The process keeps iterating until the instructions are good enough.
How textual gradients drive the rewriting loop
The system centers on what the patent calls textual gradients (a term borrowed from machine learning, where a "gradient" is a signal that tells you which direction to adjust something). Here, instead of numbers, the gradient is a written critique: a description of exactly where the current AI instructions failed and why.
The process works in several stages:
- Feedback prompt: The system sends the AI its current instructions alongside a sample of outputs that came out wrong. It asks the AI to write a critique explaining the flaws in those instructions.
- Editing prompt: The system sends the AI the original instructions plus the critique and asks it to generate a set of improved instruction candidates.
- Paraphrasing prompt: To widen the search, the system also asks the AI to rephrase those improved candidates in different ways, producing even more options.
- Selection: A secondary AI, fine-tuned on curated data for the specific task domain, evaluates all the candidates and picks the best-performing one.
The selected prompt then replaces the original and the loop restarts. Microsoft's run of AI-tooling filings reflects a pattern of automating the work developers do to prepare and tune AI systems, rather than just improving the AI models themselves.
What this means for people building AI-powered tools
For anyone building an AI-powered product, the quality of the instructions you feed the AI (usually called a "prompt") can make or break how well it works. Right now, getting those instructions right is largely a manual, time-consuming process that requires a lot of expertise. A system that automates that tuning loop could meaningfully lower the barrier to building reliable AI tools, especially in specialized fields like legal, medical, or financial software where accuracy matters most.
For end users, the payoff is indirect but real: AI features in apps built this way should produce fewer embarrassing or wrong answers. The failure this prevents is the one you've probably already seen, an AI assistant that confidently gives you a bad answer because no one had time to properly tune its instructions.
Microsoft's 20th filing we've tracked since May on AI models working together builds on earlier applications covering reusing predictions and two models sharing chat work.
The most honest thing to say about this patent is that it solves a real, everyday pain point rather than a theoretical one. Anyone who has spent an afternoon trying to get an AI chatbot to reliably do one specific thing will immediately recognize the problem Microsoft is addressing.
The clever move is using the AI as its own critic. Instead of a human writing the critique of bad AI output, the system asks the AI to do it, then uses that critique to rewrite the instructions. That closes the loop in a way that scales.
The selection step, where a second AI trained on domain-specific data picks the winner, is where the practical value concentrates. Generic prompt improvements are easy to get; improvements that hold up in a specific industry are harder, and that fine-tuning step is what would make this useful in a production setting rather than a research demo.
There are more where this came from
We read every patent application Big Tech publishes and send you the ones worth knowing. Plain English, free, every week.
The drawings
15 drawing sheets from US 2026/0260061 A1 · click any drawing to enlarge
Want this weekly breakdown for a company we don't cover? Patentlyze Pro →