NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Automatically Evolving Prompt Guidelines for Task-Specific Optimization

Cedric Richter, Salah Ghamizi, Mike PapadakisarXiv 2026

TL;DR

Prompt underspecification—where users omit crucial details and constraints—causes massive performance drops in Large Language Models (LLMs) that standard prompt optimization techniques cannot fix. This paper introduces AGOPS (Automatic Guideline Optimization via Prompt Simulation), a framework that automatically extracts task-specific prompt engineering guidelines from reference answers using an evolutionary algorithm. These guidelines significantly boost LLM accuracy by helping users write well-specified prompts or by enabling models to proactively ask targeted clarifying questions.

What Problem Does This Paper Address?

When interacting with LLMs, users frequently write underspecified prompts, omitting critical context, constraints, or assumptions. For instance, a user might ask for a Python function to "return all unique elements from a list" but forget to mention whether the original input order must be preserved. Faced with this ambiguity, LLMs typically guess the unstated assumptions rather than asking for clarification, often leading to silent failures and severe performance drops (up to 95.3%).

Existing prompt optimization methods (like APE or MIPROv2) try to optimize the prompt text directly, but they fail when the necessary underlying information simply isn't present in the user's initial query. Meanwhile, generic prompt engineering advice (e.g., "be specific" or "define pre-conditions") is often too vague to help a user who doesn't realize which specific details matter for their particular task.

Figure 1: Task-specific guidelines. (a) Users lack concrete direction on how to fully specify their prompts, e.g., omitting details such as order preservation of the output. (b) Task-specific guidelines provide concrete recommendations to the task (e.g. specifying concrete output constraints for coding problems) (c) Task-specific guidelines lead to better specified prompts than generic ones.

Methods

The authors propose AGOPS (Automatic Guideline Optimization via Prompt Simulation) to automatically synthesize task-specific prompt engineering guidelines from a small set of resolved training examples.

Figure 3: Overview. (a) Reference answers encode user knowledge such as assumptions (patient stability), context (symptoms and medical history), and output constraints (medication). (b) Candi- date guideline G, prompt writer WG decides what information (user knowledge) needs to be encoded in the prompt ρi, enabling the solver LLM to produce a correct answer. (c) The simulation succeeds if the solver produces the correct answer for a prompt that does not encode the reference answer verbatim. (d) Guidelines are optimized based on the scores and feedback obtained across simulations.

The framework operates via three core components:

  1. Prompt Simulation: To avoid expensive human-in-the-loop testing during optimization, AGOPS uses a "Prompt Writer" LLM. Given an underspecified query, a candidate guideline, and a reference answer (which implicitly contains the missing constraints), the writer simulates a well-informed user to generate a fully specified prompt.
  2. Leakage Constraint ($\lambda_q$): A major risk when utilizing reference answers during training is that the Prompt Writer might simply copy the solution into the prompt. AGOPS introduces an n-gram-based leakage constraint and rejection sampling to ensure the generated prompt clarifies the problem requirements without exposing the solution.
  3. Evolutionary Optimization: AGOPS leverages GEPA (a genetic algorithm) to iteratively mutate and refine the natural language guidelines based on the performance scores and textual feedback (e.g., compiler errors) of a downstream "Solver" LLM.

At inference time, these optimized guidelines can either help human users engineer better prompts or be embedded directly into a model's system prompt to drive Interactive Information Seeking (prompting the LLM to ask the user for missing details before answering).

Datasets

The authors evaluated AGOPS across four distinct domains using benchmarks modified to simulate real-world user underspecification:

  • MMLU-Math-Abstain: College and high school math queries stripped of all relevant context, leaving only the final question and four multiple-choice options.
  • GSM8K-Abstain: Grade-school math problems with all answer-relevant context removed.
  • MediQ-Initial: A medical question-answering dataset where patient queries miss critical clinical details (e.g., specific lab values or medical history).
  • MBPP-Incomplete: A Python programming dataset featuring incomplete problem descriptions.

To test generalization, they also evaluated the guidelines on standard, well-specified coding benchmarks: HumanEval+, MBPP+, and BigCodeBench.

Key Insights and Ideas

  • Missing Information Cannot Be Optimized Post-Hoc: Standard prompt optimization techniques fail on underspecified queries because they cannot generate information out of thin air. Eliciting latent user knowledge is fundamentally a user-side requirement.
  • Reverse-Engineering Intent from Solutions: Completed task examples (reference answers) implicitly encode the exact behavioral constraints and contextual assumptions that the user forgot to state.
  • Guidelines Over Templates: Instead of optimizing a rigid, single-use prompt template, evolving a natural language guideline provides actionable instructions that generalize effectively to entirely unseen tasks within the same domain.

Key Results

  • Massive Performance Recovery: Following AGOPS-generated guidelines consistently recovered the performance lost to underspecification, boosting downstream solver accuracy by 15.5% to 81.7% on average across all benchmarks.
  • Superior Conversational Clarification: When embedded as a system prompt for interactive information seeking over 10 conversational turns, AGOPS guidelines led to massive gains, achieving +33 Pass@1 on MBPP-Incomplete and +14 accuracy points on GSM8K-Abstain.
  • Fixing "Well-Specified" Benchmarks: Even on standard coding benchmarks like BigCodeBench, prompts engineered using AGOPS guidelines outperformed the benchmark's original instructions by 21.42%, proving that even curated developer benchmarks suffer from subtle underspecification.

Limitations and Future Work

  • Lack of Human User Study: The prompt-writing process was evaluated using an LLM simulator under an assumption of "perfect user knowledge." The authors note that actual human end-users might not follow guidelines precisely or provide accurate information.
  • Surface-Level Leakage Detection: The leakage constraint primarily catches verbatim copying via n-grams and explicit keyword indicators. It remains blind to semantic leakage, such as when a prompt writer paraphrases or subtly hints at the final answer.
  • Exploration of Broader Models: The optimization framework was primarily validated using two model families (GPT-4.1-mini and Qwen3 32B), leaving room to study how guidelines transfer across a wider variety of open-source architectures.

Summary updated

BibTeX
@misc{richter2026automatically,
  author = {Cedric Richter and Salah Ghamizi and Mike Papadakis},
  title = {{Automatically Evolving Prompt Guidelines for Task-Specific Optimization}},
  year = {2026},
  eprint = {2607.14105},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.14105},
}
Figure