PromptEnhancer: Automated Prompt Optimization
- PromptEnhancer is a family of systems that automatically improve prompts using black-box, template synthesis, and continuous tuning methods.
- They employ techniques such as RL policy learning, clustering task descriptions, and embedding optimization to refine both system and user instructions.
- Empirical evaluations show measurable gains in instruction following, reasoning, code generation, and cross-modal tasks, enhancing overall model performance.
Across recent work, PromptEnhancer can be understood as a family of systems that automatically improve prompts—discrete instructions, few-shot exemplars, system–user prompt pairs, or continuous prompt embeddings—to increase alignment, correctness, or efficiency without necessarily updating the underlying model weights. In LLM settings, the optimized object may be a multipart prompt with output and a black-box optimizer that maps an input prompt to an optimized prompt (Zhang et al., 21 Jul 2025). In task-description settings, the input may instead be an abstract task description that is embedded, matched to a task cluster, and expanded into a composite prompt assembled from prompting techniques (Ikenoue et al., 20 Oct 2025). In RL-based systems, prompt generation is treated as a policy whose reward is downstream task performance, allowing the system to synthesize new instructions and even new few-shot exemplars (Batorski et al., 20 May 2025).
1. Conceptual scope and formalization
PromptEnhancer systems span at least three formal regimes. The first is black-box discrete optimization over natural-language prompts. In this regime, prompts are strings, the base model is queried only through API-style calls, and optimization relies on external feedback such as LLM-as-judge scores, execution-based correctness, or task metrics. P3 is exemplary: it treats the system prompt and user prompt as a coupled object, learns a black-box optimizer , and aims to improve both the global instruction and the query-specific complementary instruction under the same system prompt (Zhang et al., 21 Jul 2025).
The second regime is template synthesis from abstract task descriptions. Here the input is not a nearly finished prompt but a high-level description of a task. “Automatic Prompt Generation via Adaptive Selection of Prompting Techniques” constructs a knowledge base that maps task clusters—derived from embeddings, -means, and silhouette scoring—to constrained sets of prompting techniques, then synthesizes a full prompt from the matched cluster and the user’s description (Ikenoue et al., 20 Oct 2025). The optimized object is therefore a generated prompt template rather than a locally edited seed prompt.
The third regime is continuous prompt tuning. In this setting, prompts are learned vectors rather than discrete text. “Dynamic Prompting” formalizes prompt tuning as concatenation of a learnable prompt matrix with the input embeddings, then generalizes this by learning position, length, and prompt representation, potentially per instance (Yang et al., 2023). This setting broadens the meaning of PromptEnhancer from instruction rewriting to parameter-efficient representation learning over prompts themselves.
2. Major architectural families
Recent work decomposes PromptEnhancer systems into a small number of recurring architectures.
| Family | Representative systems | Core mechanism |
|---|---|---|
| Joint prompt optimization | P3 (Zhang et al., 21 Jul 2025) | Coupled optimization of system prompts and query-specific complementary instructions |
| Knowledge-base prompt synthesis | Adaptive selection of prompting techniques (Ikenoue et al., 20 Oct 2025) | Cluster task descriptions, assign techniques, synthesize composite prompts |
| Domain-specific refinement | ADIHQ (Cruz et al., 19 Mar 2025), Prochemy (Ye et al., 14 Mar 2025) | Structured code prompts or iterative execution-based prompt mutation |
| Unified optimization toolkits | GREATERPROMPT (Zheng et al., 4 Apr 2025) | Common API for APE, APO, PE2, TextGrad, and GReaTer |
| Interactive recommendation systems | PromptMind (Su et al., 2023), Promptor (Shen et al., 2023), PromptAid (Mishra et al., 2023) | Suggest, refine, evaluate, and track prompts in conversation or visual analytics |
| Continuous prompt tuning and refinement | SuperPos-Prompt (SadraeiJavaeri et al., 2024), Dynamic Prompting (Yang et al., 2023), TextRefiner (Xie et al., 2024) | Learn soft prompts, dynamic positions, or class-specific refinements from internal features |
| Text-to-image prompt rewriting | NeuroPrompts (Rosenman et al., 2023), PromptEnhancer for T2I (Wang et al., 4 Sep 2025) | Rewrite short user prompts into generator-friendly reprompts under learned reward models |
These families differ chiefly in the optimized object, the feedback signal, and whether prompt improvement occurs offline, online, or interactively. P3 and Prochemy amortize heavy search offline and deploy lightweight online inference; PromptMind and Promptor instead treat prompting as a turn-by-turn interaction layer; SuperPos-Prompt, Dynamic Prompting, and TextRefiner shift optimization into the continuous embedding space; NeuroPrompts and the T2I “PromptEnhancer” paper adapt the same general logic to diffusion-model prompt rewriting rather than LLM instruction following.
A plausible implication is that PromptEnhancer is best regarded not as a single algorithm but as a design pattern: prompt improvement can be performed by search, retrieval, supervised distillation, RL, visual analytics, or continuous prompt reparameterization, provided the system exposes a prompt-like control surface and a usable evaluation signal.
3. Optimization mechanisms
A central technical distinction is between feedback without gradients and feedback with gradients. P3 is entirely black-box: it uses LLMs to generate candidate complements and system prompts, LLM-as-judge scores , multi-round refinement, a quality threshold , and a hard-sample buffer 0 for system prompt optimization. Its online stage then either predicts a query-dependent complement with a finetuned small model or retrieves exemplars from 1 in the P3-ICL variant (Zhang et al., 21 Jul 2025).
Cluster-based synthesis uses a different mechanism. The adaptive-selection framework first embeds task descriptions, chooses the number of task clusters by maximizing silhouette score, assigns each cluster a short description and identifier, and then asks an LLM to select 3–4 prompting techniques under hard constraints: always include Role Playing, include exactly one emotional technique, exactly one reasoning technique, and optionally one additional technique. Runtime optimization reduces to embedding a new task description, computing cosine similarity to cluster vectors, retrieving the matched technique set, and synthesizing a composite prompt (Ikenoue et al., 20 Oct 2025).
Execution-based prompt refinement replaces LLM-as-judge scoring with test-suite outcomes. Prochemy iteratively mutates prompts with an LLM meta-prompt, evaluates each candidate by generating code and running tests, and scores candidates with a difficulty-aware weighted score
2
This makes tasks that few candidates solve count more heavily during selection, and the loop stops when the best score stabilizes for three iterations or reaches 3 (Ye et al., 14 Mar 2025).
RL-based PromptEnhancer systems formalize prompt generation as policy learning. PRL trains a Prompt Generator with GRPO to emit a structured output 5 and rewards it with a sum of formatting rewards and downstream task rewards such as classification accuracy, ROUGE, or SARI. The objective is to maximize expected reward of the generated prompt under a frozen Evaluation Model, and the method periodically performs Prompt Selection on a validation set to retain the best prompt found so far (Batorski et al., 20 May 2025).
Continuous prompt-enhancement methods alter the prompt parameterization itself. SuperPos-Prompt rewrites a prompt matrix as 4, where each prompt token is a linear superposition of sampled vocabulary embeddings rather than an unconstrained vector, and empirically rejects a softmax-constrained variant in favor of unconstrained linear combinations (SadraeiJavaeri et al., 2024). Dynamic Prompting makes position, length, and prompt representation learnable, including instance-dependent position selection through Gumbel-Softmax and prompt-pool mixtures (Yang et al., 2023). TextRefiner builds a local cache 5 from local image tokens and refines class text embeddings by aggregating cache entries into 6, then fusing 7 into 8 through a residual linear layer (Xie et al., 2024).
In text-to-image rewriting, the optimization target is alignment between a rewritten prompt and a generated image. The 2025 “PromptEnhancer” paper trains a Chain-of-Thought rewriter with GRPO against AlignEvaluator, a reward model built on a 24-point taxonomy spanning negation, counting, pronoun resolution, cross-entity binding, compositional relations, counterfactual scenes, and in-image text (Wang et al., 4 Sep 2025). NeuroPrompts uses a different combination—SFT on 600k DiffusionDB prompts, PPO against PickScore, and NeuroLogic constrained decoding—to force coverage of stylistic categories such as style, artist, format, boosters, vibes, and perspective (Rosenman et al., 2023).
4. Empirical performance across domains
General-purpose LLM prompt optimization shows that joint treatment of system and user prompts can materially improve both instruction following and reasoning. On averaged results over models for Alpaca-Eval 2.0, P3 reports Raw 34.04, PAS 47.52, P3 57.16, and P3-ICL 59.09; on GSM8K with GPT-4o as optimizer and GPT-3.5-turbo as base, Zero-shot CoT reaches 72.9%, P3-ICL 82.1%, and P3 84.8%; on GPQA, P3 reaches 57.1% against 55.0% for TextGrad and 53.5% for PAS (Zhang et al., 21 Jul 2025).
Prompt synthesis from task descriptions also yields measurable gains. On 23 BIG-Bench Extra Hard tasks, the adaptive cluster-and-technique method reports post-correction arithmetic mean scores of 23.9 for Original, 24.7 for Anthropic, 28.0 for Ours, and 28.5 for Ours (temperature-optimized), with harmonic means 9.7, 10.5, 12.5, and 13.3 respectively (Ikenoue et al., 20 Oct 2025).
Code-oriented PromptEnhancer methods separate two regimes. ADIHQ is a single-shot, structured instruction template emphasizing Analyze, Design, Implement, Handle, Quality, and Redundancy Check. On HumanEval, IBM Granite improves from Pass@1 0.05 and Pass@100 0.10 under zero-shot to Pass@1 0.41 and Pass@100 0.433 with ADIHQ, while using 237.58 tokens versus 326.58 for CoT; LLaMA Code attains Pass@100/token 0.44 with ADIHQ versus 0.36 with CoT (Cruz et al., 19 Mar 2025). Prochemy, by contrast, is iterative and execution-driven: on HumanEval, GPT-3.5-Turbo improves from 72.6 to 76.2 and GPT-4o from 90.2 to 92.1 under Zero-shot + Prochemy; on AVATAR Java-to-Python translation, GPT-4o improves from 74.5 to 84.1, and on Python-to-Java from 66.8 to 78.2 (Ye et al., 14 Mar 2025).
RL-based prompt generation is competitive beyond code. PRL reports an average classification accuracy of 82.14 across seven datasets, compared with 79.56 for APE, 79.42 for APO, and 81.14 for EvoPrompt (GA). On SAMSum, PRL reaches ROUGE-1 42.47, ROUGE-2 16.17, and ROUGE-L 37.73; on ASSET, it reaches SARI 52.26, exceeding both APE and EvoPrompt by wide margins (Batorski et al., 20 May 2025).
Continuous prompt-enhancement methods show that prompt parameterization itself is a major lever. SuperPos-Prompt reports average score gains of 9 over Residual Prompt on T5-Small and 0 on T5-Base, with faster convergence (SadraeiJavaeri et al., 2024). TextRefiner improves CoOp from 71.66% to 76.94% on 11 benchmarks and enables PromptKD to surpass LLaMP while remaining efficient in inference (Xie et al., 2024).
Cross-modal prompt enhancement is similarly effective. NeuroPrompts raises mean aesthetics score from 5.64 for the original prefix to 6.27 for the full system, exceeding even the original human-written prompts, and reports an average PickScore of 60%, interpreted as a predicted 60% preference over baseline prefix images (Rosenman et al., 2023). The T2I “PromptEnhancer” paper reports average prompt-following accuracy gains of 1 percentage points across 24 dimensions, from 65.9% to 71.0%, with especially large improvements on Similarity Relation, Counterfactual, Counting, Pronoun Resolution, Expression, and Cross-Entity Binding (Wang et al., 4 Sep 2025).
5. Human-in-the-loop systems and software platforms
A distinct branch of PromptEnhancer research treats prompt improvement as an interactive systems problem rather than a purely algorithmic optimization problem. PromptMind inserts a prompt-suggestion layer between the user and ChatGPT-3.5: a finetuned LLaMA-7B consumes the last four turns and proposes three next-question prompts, while clicked suggestions are stored as “good cases” for later supervised refinement. In a within-subject study with 24 participants across emotional support, advice acquisition, and task-oriented interactions, PromptMind significantly improved social presence, reduced NASA-TLX workload on five of six dimensions, and improved PSSUQ usability measures such as productivity and task completion (Su et al., 2023).
Promptor turns GPT-4 into a meta-level conversational prompt engineer through a parent prompt that encodes instructions, domain facts, a six-step interaction process, and examples. Its output is a structured “child” system prompt for GPT-3.5-based intelligent text entry. In a study with 24 designers across movie-ticket booking, restaurant reservation, and taxi booking, Promptor-designed prompts increased similarity by 35% and coherence by 22% relative to self-designed prompts; the detailed study also reports that self-designed prompts produced at least 30% incorrect-format outputs, whereas Promptor-designed prompts stayed below 5% incorrect format (Shen et al., 2023).
PromptAid addresses the same problem space through visual analytics rather than conversational meta-prompting. It combines prompt-space embeddings, keyword and paraphrase recommendations, KNN-selected few-shot examples, perturbation-sensitivity plots, provenance tracking, and instance-level diagnostic views. In a user study with 10 graduate students, PromptAid reduced cognitive effort and improved confidence relative to a text-only baseline, with Mann–Whitney results 2 for cognitive effort and 3 for confidence in the final prompt template (Mishra et al., 2023).
At the software-toolkit level, GREATERPROMPT unifies multiple prompt optimizers under a common API and Web UI. It supports APE, APO, PE2, TextGrad, and GReaTer; standardizes data ingestion through GreaterDataloader; supports both API-based and local models; and exposes a shared optimize(...) interface. Its empirical results show that all integrated optimizers improve over zero-shot Chain-of-Thought on BBH and GSM8K, with GReaTer notably reaching 71.6 average accuracy across five BBH subtasks for Llama-3-8B-Instruct versus 56.4 for ZS-CoT and 58.2 for TextGrad (Zheng et al., 4 Apr 2025).
6. Limitations, controversies, and open problems
PromptEnhancer systems differ sharply in cost profile, supervision source, and transferability, and those differences shape their limitations. P3 explicitly notes the offline expense of repeated strong-model calls for proposal, evaluation, and optimization, the risk of judge bias under LLM-as-judge scoring, and limited evidence on online optimizer scaling beyond a single 7B model (Zhang et al., 21 Jul 2025). The adaptive cluster-based method assumes that semantically similar task descriptions imply similar prompting techniques, yet also notes benchmark-specific knowledge bases, top-1 cluster matching, and the lack of explicit measured optimization over technique combinations (Ikenoue et al., 20 Oct 2025).
Domain-specific systems often inherit narrow evaluation scope. ADIHQ is evaluated only on HumanEval and two code-oriented LLMs, does not disclose the full literal prompt template, and offers no fine-grained section ablations, so its generality remains largely conceptual beyond the reported benchmark (Cruz et al., 19 Mar 2025). PRL requires task-specific RL training, careful reward design, and substantial compute—48 hours per model on A100 hardware in the reported setup—while the authors explicitly identify a universal prompt generator as future work rather than present capability (Batorski et al., 20 May 2025).
Cross-modal prompt rewriting raises its own issues. The T2I “PromptEnhancer” paper reports slight regressions on Interaction without Contact, Size, and Text Layout even while improving average alignment, suggesting that reward shaping over fine-grained taxonomies can still distort simpler cases (Wang et al., 4 Sep 2025). NeuroPrompts inherits diffusion-model biases, permits artist-name conditioning, and does not describe a dedicated safety-filtering layer, so prompt enhancement may also amplify undesirable outputs if not paired with moderation (Rosenman et al., 2023).
Continuous prompt-enhancement methods expose another tension: richer prompt parameterizations are more expressive but can be more brittle. TextRefiner is sensitive to cache size 4 and to the balancing coefficients on semantic-alignment and regularization losses, with too-large caches fragmenting visual attributes and overly strong alignment causing overfitting to seen samples (Xie et al., 2024). Dynamic Prompting likewise reports greater optimization difficulty when instance-dependent prompt vectors and instance-dependent prompt positions are combined, and its experiments are confined to encoder-based LLMs, ViT, and CLIP-style systems rather than decoder-only generation models (Yang et al., 2023).
Interactive systems remain limited by context and user modeling. PromptMind uses only the last four rounds of dialogue and does not maintain an explicit long-term user profile, so personalization remains local and implicit rather than persistent (Su et al., 2023). More broadly, a recurring open problem is how to combine offline prompt optimization, runtime adaptation, interpretable user control, and reliable evaluation signals without excessive infrastructure or reward misalignment. The recent literature suggests that PromptEnhancer is most effective when prompt optimization is treated neither as a purely manual craft nor as a single universal algorithm, but as a layered engineering problem combining search space design, feedback design, evaluation, and deployment constraints.