Microsoft Open-Sources PromptWizard, Prompt Engineers May Be Unemployed
How PromptWizard Simplifies and Automates Prompt Optimization
PromptWizard is designed to automate and simplify prompt optimization, leveraging iterative feedback, efficient exploration, and refinement techniques to craft high-performing prompts within minutes
This article summarizes the core concepts of the paper PROMPTWIZARD: TASK-AWARE PROMPT OPTIMIZATION FRAMEWORK[1] from arXiv.
At its core, PromptWizard employs self-evolution and adaptive mechanisms. A large Language Model (LLM) iteratively generates, critiques, and refines prompts and examples. This feedback-based process ensures continual improvement and enables comprehensive optimization tailored to specific tasks.
Evaluated across 45+ tasks, PromptWizard demonstrates superior accuracy, efficiency, and adaptability compared to state-of-the-art methods such as Instinct, InstructZero, APE, PromptBreeder, EvoPrompt, DSPy, APO, and PromptAgent.

Key Components of PromptWizard
Overview

- Feedback-Driven Improvement:
The backbone of PromptWizard is its iterative feedback loop, where the LLM generates, critiques, and refines its prompts and examples. This continuous improvement ensures that each iteration outperforms the last, leading to highly effective prompts and examples. - Joint Optimization of Examples and Prompts:
PromptWizard produces robust, diverse, and task-aware synthesized examples. Optimizing prompts and examples simultaneously ensures they work harmoniously to meet specific task requirements effectively. - Self-Generated Chain-of-Thought (CoT) Steps:
By incorporating CoT reasoning, PromptWizard enhances problem-solving capabilities. Using selected few-shot examples, it generates detailed reasoning chains for each instance, fostering meticulous, step-by-step solutions.
How Works
PromptWizard begins with user-provided input, including a task description, initial prompt instructions, and training examples.
Its output is a refined and optimized set of prompt instructions paired with carefully curated few-shot examples. These outputs include reasoning chains, task intents, and expert-level details that connect human-like reasoning with AI-generated responses.
Phase One: Refining Prompt Instructions
The first phase focuses on refining the task description in the prompt. PromptWizard generates multiple candidate instructions, evaluates them using LLM feedback, and iteratively synthesizes improved versions. This process balances exploration (trying various ideas) with exploitation (perfecting the most promising ones).
For instance, if the initial instruction yields suboptimal results, PW identifies its shortcomings through feedback and generates improved versions. After three to five iterations, the cycle converges to an optimal state.

Phase Two: Joint Optimization of Instructions and Examples
The refined prompt from Phase One combines carefully selected examples for joint optimization. Through critique and synthesis, PromptWizard ensures alignment between prompts and examples while synthesizing new examples to enhance task performance.
This structured approach makes PromptWizard highly versatile and capable of adapting to various tasks, from solving mathematical problems to generating creative content.

How to Use PromptWizard
Microsoft has also open-sourced a PromptWizard project[2], which provides detailed usage guidance in its README.
References
- [1] PROMPTWIZARD: TASK-AWARE PROMPT OPTIMIZATION FRAMEWORK: https://arxiv.org/pdf/2405.18369
- [2] PromptWizard project: https://github.com/microsoft/PromptWizard