Microsoft patents method for LLMs to critique and improve their own prompts
Microsoft has filed a patent application for a system that automatically improves instructions given to large language models. The method uses one AI model to identify flaws in a current prompt based on incorrect answers, then uses another model to rewrite the prompt to fix those issues.
In the filing’s own words
Systems and methods are provided for implementing automatic prompt optimization using textual gradients. In various embodiments, a feedback prompt, input into a large language model (“LLM”), is used to generate textual gradients that criticize a current prompt. The feedback prompt includes the current prompt and predictions that are incorrect compared with corresponding labels associated with minibatch data processed by the LLM using the current prompt. The textual gradients and current prompt are used in an editing prompt to the LLM to obtain a set of optimized prompts, which may be expanded using a paraphrasing prompt that is input into the LLM to generate a set of paraphrased prompts. A selection algorithm is used to select one or more optimized prompts from the set of optimized prompts and/or the set of paraphrased prompts, and the process is repeated with the selected one or more optimized prompts replacing the current prompt.
What exactly they claim (claim 1)
1. A system for implementing automatic prompt optimization using textual gradients, the system comprising: at least one processor; and memory storing instructions that, when executed by the at least one processor, cause the system to perform operations comprising: providing, as input to a large language model (“LLM”), a feedback prompt requesting one or more textual gradients, each textual gradient including a description of one or more flaws in an initial prompt resulting in errors in LLM predictions; receiving, as output from the LLM in response to the feedback prompt, the one or more textual gradients; providing, as input to the LLM, an editing prompt requesting a set of optimized prompts based on the initial prompt and the one or more textual gradients; receiving, as output from the LLM, the set of optimized prompts; and selecting an optimized prompt from the set of optimized prompts based on evaluation of prompt performance using a secondary LLM that is finetuned based on a curated dataset for a specific subject area.
Facts
- Company
- Microsoft (Microsoft Technology Licensing, LLC)
- Official title
- AUTOMATIC LANGUAGE MODEL (LM) INPUT OPTIMIZATION USING TEXTUAL GRADIENTS
- Publication number
- US20260260061A1
- Application number
- 19653905
- Filed
- Apr 21, 2026
- Published
- Sep 3, 2026
- Inventors
- 7
- Claims
- 20
Classified under
G06F 40/20 Physics & computingG06F 40/166 Physics & computingG06F 16/90 Physics & computingMore from Microsoft in AI & software
- Microsoft patents method to check AI answers against verified facts Oct 20, 2026
- Microsoft patents AI that presents PowerPoint slides for you Sep 3, 2026
- Microsoft patents method to check if LLM answers are based on real data Sep 10, 2026
- Microsoft patents system to blend multiple AI agents into one chat Oct 1, 2026
- Microsoft patents system that answers questions using your screen history Oct 15, 2026
Summaries are simplified from the filing’s own abstract and first claim. A patent filing is not a product announcement.
Patent data and drawings: U.S. Patent and Trademark Office (USPTO). Nebula is not affiliated with or endorsed by the USPTO.