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

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

25 Oct 2023arXiv:2310.16427archive 2025-07-28

Xinyuan Wang, Chenxi Li, Zhen Wang, Fan Bai, Haotian Luo, Jiayou Zhang, Nebojsa Jojic, Eric P. Xing, Zhiting Hu

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2310.16427")

Code

Syntology Ran 4 of 19 code samples harvested from 2 repositories linked to this paper; 15 have no recorded run. Of those that ran: 4 ran with no contract checked.

By repository: official repository: 5 samples from 1 repository, 4 ran; community (archive-listed): 14 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

xinyuanwangcs/promptagent officialmentioned in papermentioned on GitHubApache-2.0 report
karayanni/structurease mentioned on GitHubMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

19 samples harvested; 4 ran; 0 honoured the contract we drafted; 15 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran
15unverified

Licence: 0 of the 19 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

create_logger xinyuanwangcs/promptagent/src/prompt_optim_agent/utils.py official repository ran Apache-2.0 (permissive) · ff90ff7b4449ccf2 · report
is_chunk_end xinyuanwangcs/promptagent/src/tasks/ncbi.py official repository ran Apache-2.0 (permissive) · e4736e9992d1de49 · report
is_chunk_start xinyuanwangcs/promptagent/src/tasks/ncbi.py official repository ran Apache-2.0 (permissive) · 405fd06f23bf2a87 · report
split_tag xinyuanwangcs/promptagent/src/tasks/ncbi.py official repository ran fingerprinted Apache-2.0 (permissive) · f9a22a5ce23105fd · report
parse_model_args xinyuanwangcs/promptagent/src/prompt_optim_agent/utils.py official repository unverified Apache-2.0 (permissive) · 7aff0c6a7e5e52d0 · report
ImprovePrompt karayanni/structurease/PromptCreationFlow/PromptImprovementStep.py community (archive-listed) unverified MIT (permissive) · 4f76d3cd1e441183 · report
InitialGenerateClassificationPrompt karayanni/structurease/PromptCreationFlow/ClassificationPromptGeneration.py community (archive-listed) unverified MIT (permissive) · 1d17c85bcc65edb6 · report
classification_using_llm karayanni/structurease/Evaluation/EvaluatePrompt.py community (archive-listed) unverified MIT (permissive) · 5332965d29e0a6d6 · report
evaluate_classification_accuracy karayanni/structurease/Evaluation/EvaluateOutputFile.py community (archive-listed) unverified MIT (permissive) · ea3228b60ee75404 · report
evaluate_classification_accuracy karayanni/structurease/Evaluation/temp.py community (archive-listed) unverified MIT (permissive) · e041cf790e68003b · report
evaluate_manual_to_llm_df karayanni/structurease/Evaluation/EvaluateCurrentPromptOnEntireDS.py community (archive-listed) unverified MIT (permissive) · 725d28343ca4ee57 · report
evaluate_manual_to_llm_df karayanni/structurease/PromptCreationFlow/ChooseLabelingData.py community (archive-listed) unverified MIT (permissive) · 0787b09ede80ffb2 · report
exponential_backoff_retry karayanni/structurease/Evaluation/EvaluateCurrentPromptOnEntireDS.py community (archive-listed) unverified MIT (permissive) · d614ff0573a148ab · report
exponential_backoff_retry karayanni/structurease/PromptCreationFlow/ClassificationPromptGeneration.py community (archive-listed) unverified MIT (permissive) · acadf8a5b1c39943 · report
exponential_backoff_retry karayanni/structurease/PromptCreationFlow/EvaluateCurrentPrompt.py community (archive-listed) unverified MIT (permissive) · 822eda707ef35c73 · report
extract_classification_number karayanni/structurease/Evaluation/EvaluateCurrentPromptOnEntireDS.py community (archive-listed) unverified MIT (permissive) · f13ea50d50bffac3 · report
extract_classification_number karayanni/structurease/Evaluation/EvaluatePrompt.py community (archive-listed) unverified MIT (permissive) · 1089b70c19023e24 · report
extract_classification_number karayanni/structurease/PromptCreationFlow/ChooseLabelingData.py community (archive-listed) unverified MIT (permissive) · 5270fe06945781dd · report
extract_classification_number karayanni/structurease/PromptCreationFlow/EvaluateCurrentPrompt.py community (archive-listed) unverified MIT (permissive) · e0b75026e83eb284 · report

Tasks

Navigate

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections