Abstract
Large Language Models (LLMs) demonstrate impressive zero-shot capabilities but remain highly sensitive to prompt engineering. Generic instructions often fail to provide the necessary context for complex or domain-specific instances. We introduce PROMPTED, a framework that employs a meta-LLM to iteratively rewrite prompts for individual task instances. By observing initial model failures and injecting instance-specific hints, PROMPTED significantly boosts zero-shot performance across 13 datasets. Our findings show that PROMPTED outperforms standard baselines by at least 6% on average and reveals that weaker models (e.g., GPT-3.5) can effectively supervise and improve the performance of stronger models (e.g., GPT-4).
Introduction
While "trigger phrases" like "Let’s think step by step" (Zero-Shot Chain-of-Thought) have improved LLM reasoning, they suffer from a "specificity gap." A single task-level instruction often lacks the nuance required for difficult individual instances. Existing solutions typically focus on Output Refinement—correcting an answer after generation. However, this fails to address the root cause: a flawed initial reasoning path triggered by vague instructions. PROMPTED shifts the focus from fixing outputs to optimizing the instructions themselves through an "LLM-in-the-loop" approach.
The PROMPTED Framework
The PROMPTED framework utilizes two distinct components: a Task LLM ($M_{task}$) for execution and a Meta LLM ($M_{meta}$) for supervision. The process is divided into three iterative steps:
- Initial Generation: $M_{task}$ attempts the problem using a standard zero-shot prompt.
- Iterative Rewriting: $M_{meta}$ analyzes the original prompt and the resulting output. It identifies the reason for any failure and generates a "Better Prompt" containing targeted hints, domain knowledge, or stricter formatting constraints.
- Final Extraction: $M_{task}$ re-executes the task with the custom-tailored prompt. This cycle can iterate up to three times.
The Meta LLM is guided by task-agnostic few-shot demonstrations, teaching it the general principles of prompt engineering rather than domain-specific answers.
Experimental Evaluation
PROMPTED was evaluated across 13 datasets spanning 10 task types, including mathematical reasoning (GSM8K, MATH), logic (Logical Deductions, Penguins), knowledge-intensive domains (MedQA, CyNER), and safety (ToxicChats). The evaluation included "unseen" task types to test the Meta LLM's generalization capabilities.
Key Results and Insights
PROMPTED outperformed baselines—including Zero-Shot, Zero-Shot CoT, and Output Refinement—in 11 out of 13 datasets. On average, accuracy improved by at least 6%, with gains as high as 50% in specific logical reasoning tasks.
Weak-to-Strong Supervision
A significant finding is the efficacy of "weak-to-strong" supervision. GPT-3.5 proved capable of rewriting prompts for GPT-4, often matching or exceeding the performance of a loop where GPT-4 supervised itself. This suggests that evaluating failures and suggesting improvements is a distinct, potentially more accessible capability than core task execution.
Prompt Rewriting vs. Output Refinement
Unlike methods that patch logical errors locally, PROMPTED allows the model to explore entirely new reasoning paths by refining the initial instruction. This approach also naturally incorporates safety guardrails; when $M_{meta}$ detects toxic intent, it rewrites the prompt to include ethical constraints, forcing a safe response.
Conclusion and Future Work
PROMPTED demonstrates that instance-specific prompt engineering can be automated to significantly enhance LLM performance. While highly effective, the approach faces challenges in purely symbolic reasoning (e.g., string manipulation) and involves higher computational costs due to its iterative nature. Future research will focus on reducing token consumption and refining the supervision paradigm for tasks that exceed current human-level capabilities.
Summary updated