PromptAgent: Strategic Planning with Language Models Enables Expert-level Prompt Optimization

Xinyuan Wang, Chenxi Li, Zhen Wang, Fan Bai, Haotian Luo +4 more
2/12/2026

No official code found. Best implementation: maitrix-org/PromptAgent (354 stars, Apache-2.0, last commit 2025-07-17). 1 more below.

Abstract

Highly effective, task-specific prompts are often heavily engineered by experts to integrate detailed instructions and domain insights based on a deep understanding of both instincts of large language models (LLMs) and the intricacies of the target task. However, automating the generation of such expert-level prompts remains elusive. Existing prompt optimization methods tend to overlook the depth of domain knowledge and struggle to efficiently explore the vast space of expert-level prompts. Addressing this, we present PromptAgent, an optimization method that autonomously crafts prompts equivalent in quality to those handcrafted by experts. At its core, PromptAgent views prompt optimization as a strategic planning problem and employs a principled planning algorithm, rooted in Monte Carlo tree search, to strategically navigate the expert-level prompt space. Inspired by human-like trial-and-error exploration, PromptAgent induces precise expert-level insights and in-depth instructions by reflecting on model errors and generating constructive error feedback. Such a novel framework allows the agent to iteratively examine intermediate prompts (states), refine them based on error feedbacks (actions), simulate future rewards, and search for high-reward paths leading to expert prompts. We apply PromptAgent to 12 tasks spanning three practical domains: BIG-Bench Hard (BBH), as well as domain-specific and general NLP tasks, showing it significantly outperforms strong Chain-of-Thought and recent prompt optimization baselines. Extensive analyses emphasize its capability to craft expert-level, detailed, and domain-insightful prompts with great efficiency and generalizability.

View on arXivView PDF

Code Implementations(2)

Apache-2.0

This is the official repo for "PromptAgent: Strategic Planning with Language Models Enables Expert-level Prompt Optimization". PromptAgent is a novel automatic prompt optimization method that autonomously crafts prompts equivalent in quality to those handcrafted by experts, i.e., expert-level prompts.

35445PythonNov 3, 20231 years agoApache-2.0
llmnlpprompt-engineeringpython

补充了RAG功能的基于蒙特卡洛树搜索(MCTS)的提示词优化,参考文章:Wang X, Li C, Wang Z, et al. Promptagent: Strategic planning with language models enables expert-level prompt optimization[J]. arXiv preprint arXiv:2310.16427, 2023.

00PythonJun 6, 20251 years ago

Similar Papers

Cite this paper

@article{wang2026promptagent,
  title  = {PromptAgent: Strategic Planning with Language Models Enables Expert-level Prompt Optimization},
  author = {Xinyuan Wang and Chenxi Li and Zhen Wang and Fan Bai and Haotian Luo and Jiayou Zhang and Nebojsa Jojic and Eric P. Xing and Zhiting Hu},
  year   = {2026},
  eprint = {2310.16427},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2310.16427},
  journal = {ICLR 2023 2023}
}

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/2310.16427.svg)](https://codeofpaper.com/paper/2310.16427)

Discussion