: Better Prompt Optimization with Fewer Prompts
Organizations: Sid · Cornell University · Microsoft · Harvard University ·
Abstract
Prompt optimization improves language models without updating their weights by searching for a better system prompt, but its effectiveness varies widely across tasks. We study what makes a task amenable to prompt optimization. We show that the reward variance across different system prompts can be decomposed into two components: variance among responses, which captures generation stochasticity, and variance among system prompts, which captures differences in system prompt quality. Prompt optimization succeeds when variance among system prompts is sufficiently large, but fails when variance among responses dominates the variance of the system prompts. Surprisingly, we further show that scaling to more user prompts can hurt optimization by reducing variance among system prompts, especially on heterogeneous datasets where different user prompts favor different system prompts. Motivated by this insight, we propose , a simple user prompt filtering method that selects a small subset of user prompts with high variance across candidate system prompts. This subset of user prompts allows one to distinguish a good system prompt from a bad one, making system optimization easier. Experiments on reasoning benchmarks show that substantially improves prompt optimization over training on the full dataset and outperforms strong baselines such as GEPA. Notably, training on only two prompts from AIME 24 yields a system prompt that generalizes well to other reasoning benchmarks.
Figures & tables
| Method | Training | AIME 25 | AIME 26 | HMMT 25 | HMMT 26 | |||
|---|---|---|---|---|---|---|---|---|
| Reward Imp. | ||||||||
| Qwen3-4B-Instruct-2507 | base | / | / | / | 47.03 | 54.38 | 40.68 | 27.89 |
| GEPA | 15/15 | / | / | 46.87 | 54.22 | 40.57 | 27.08 | |
| GEPA | [1,23]/28 | / | / | 46.72 | 53.49 | 40.10 | 27.46 | |
| GEPA | 28/[1,23] | / | / | 46.35 | 53.91 | 40.21 | 27.32 | |
| RL | all 30 | 1 | 0 | 47.24 | 54.58 | 40.26 | 27.04 |
| Method | Training | IFBench | ||
| Reward Imp. | ||||
| Qwen3-4B-Instruct-2507 | ||||
| base | / | / | / | 35.03 |
| GEPA | 32/32 | / | / | 39.12 |
| RL | 64 | 2 | 0.15 | 39.46 |
| 16 | 8 | 0.18 | 37.41 | |
Appendix figures & tables22 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Training Dataset Card | Evaluation Dataset Card | Generation Length ( ) |
|---|---|---|---|
| IFBench | allenai/IF_multi_constraints_upto5 | allenai/IFBench_test | |
| AIME | math-ai/aime24 | math-ai/aime25 |
| Prompt | |
|---|---|
| Meta prompt for on IFBench | You are designing a system prompt for a large language model (LLM) whose primary goal is precise instruction following. The LLM should be optimized to correctly handle tasks with strict formatting, stylistic, and content constraints. Directly generate a high-quality system prompt that instructs an LLM to reliably solve instruction following problems. Generate the system prompt only. |
| Meta prompt for on AIME | Directly generate an effective system prompt for a large language model (LLM) designed specifically to solve competition-level math problems. Instruct the model to think and reason like a human. |
| Prompt for | {System Prompt} {Prompt} |
| Dataset | Training Dataset Card | Generation Length ( ) | Generation Length ( ) |
|---|---|---|---|
| Qwen3-4B-Instruct-2507 | Qwen3-1.7B | ||
| IFBench | allenai/IF_multi_constraints_upto5 | ||
| AIME | math-ai/aime24 |
| Prompt | |
|---|---|
| Meta prompt for on IFBench | You are designing a system prompt for a large language model (LLM) whose primary goal is precise instruction following. The LLM should be optimized to correctly handle tasks with strict formatting, stylistic, and content constraints. Directly generate a high-quality system prompt that instructs an LLM to reliably solve instruction following problems. Generate the system prompt only. |
| Meta prompt for on AIME | Directly generate an effective system prompt for a large language model (LLM) designed specifically to solve competition-level math problems. Instruct the model to think and reason like a human. |
| Prompt for | {System Prompt} {Prompt} |
| Setting | Parameters | |
|---|---|---|
| GEPA | maximum training time: 3 days | reflection minibatch size: 4 |
| RL & Qwen3-4B-Instruct-2507 | : 16 learning rate: 1e-6 maximum training time: 3 days temperature : 0.6 top_p : 0.95 top_k : -1 | training temperature : 1 training top_p : 1 training top_k : -1 validation temperature : 0.6 validation top_p : 0.95 validation top_k : -1 |
| RL & Qwen3-1.7B | : 16 learning rate: 1e-6 maximum training time: 3 days temperature : 0.6 top_p : 0.95 top_k : 20 | training temperature : 1 training top_p : 1 training top_k : -1 validation temperature : 0.6 validation top_p : 0.95 validation top_k : -1 |
Automatic Prompt Optimization
Automatic prompt optimization uses model or task feedback to revise instructions for stronger, more reliable language-model performance.
See all 103 papers