PromptWizard: Task-Aware Prompt Optimization Framework

Eshaan Agarwal, Joykirat Singh, Vivek Dani, Raghav Magazine, Tanuja Ganu +1 more
5/28/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: microsoft/PromptWizard (3,899 stars, MIT, last commit 2025-10-13).

Abstract

Large language models (LLMs) have transformed AI across diverse domains, with prompting being central to their success in guiding model outputs. However, manual prompt engineering is both labor-intensive and domain-specific, necessitating the need for automated solutions. We introduce PromptWizard, a novel, fully automated framework for discrete prompt optimization, utilizing a self-evolving, self-adapting mechanism. Through a feedback-driven critique and synthesis process, PromptWizard achieves an effective balance between exploration and exploitation, iteratively refining both prompt instructions and in-context examples to generate human-readable, task-specific prompts. This guided approach systematically improves prompt quality, resulting in superior performance across 45 tasks. PromptWizard excels even with limited training data, smaller LLMs, and various LLM architectures. Additionally, our cost analysis reveals a substantial reduction in API calls, token usage, and overall cost, demonstrating PromptWizard's efficiency, scalability, and advantages over existing prompt optimization strategies.

View on arXivView PDF

Code Implementations(1)

MIT

Task-Aware Agent-driven Prompt Optimization Framework

3,899338Python, MakefileMay 30, 20241 years agoMIT

Cite this paper

@article{agarwal2024promptwizard,
  title  = {PromptWizard: Task-Aware Prompt Optimization Framework},
  author = {Eshaan Agarwal and Joykirat Singh and Vivek Dani and Raghav Magazine and Tanuja Ganu and Akshay Nambi},
  year   = {2024},
  eprint = {2405.18369},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.18369v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.18369.svg)](https://codeofpaper.com/paper/2405.18369)

Discussion