PrefPO: Pairwise Preference Prompt Optimization
Organizations: Distyl AI
Abstract
Prompt engineering is effective but labor-intensive, motivating automated optimization methods. Existing methods typically require labeled datasets, which are often unavailable, and produce verbose, repetitive prompts. We introduce PrefPO, a minimal prompt optimization approach inspired by reinforcement learning from human feedback (RLHF). Its preference-based approach reduces the need for labeled data and hyperparameter tuning-only a starting prompt and natural language criteria are needed. PrefPO uses an LLM discriminator to express pairwise preferences over model outputs and provide feedback to an LLM optimizer, iteratively improving performance. We evaluate PrefPO on 9 BIG-Bench Hard (BBH) tasks and IFEval-Hard, a newly-curated, challenging subset of IFEval. PrefPO matches or exceeds SOTA methods, including GEPA, MIPRO, and TextGrad, on 6/9 tasks and performs comparably to TextGrad on IFEval-Hard (82.4% vs 84.5%). Unlike other methods, PrefPO can optimize in both labeled and unlabeled settings. Without labels, PrefPO closely matches its labeled performance on 6/9 tasks, proving effective without ground truth. PrefPO also improves prompt hygiene: we find existing methods produce prompts 14.7x their original length or with 34% repetitive content; PrefPO reduces these issues by 3-5x. Furthermore, both LLM and human judges rate PrefPO's prompts higher than TextGrad's. Finally, we identify prompt hacking in prompt optimizers, where methods game evaluation criteria, and find PrefPO is susceptible at half the rate of TextGrad (37% vs 86%), generating fewer brittle, misaligned prompts.
Figures & tables
| Method | Object Counting | Movie Recommendations | Causal Judgment | Geometric Shapes | Disambiguation |
|---|---|---|---|---|---|
| GPT-4o (zero shot) | |||||
| GPT-4o (few-shot + CoT) | |||||
| GPT-5 (zero shot) | |||||
| TextGrad | |||||
| MIPROv2 | |||||
| GEPA |
| worst@20 | average@20 | |
|---|---|---|
| TextGrad | ||
| PrefPO | ||
| PrefPO -Elo | ||
| PrefPO -Minimal |
| Method | Length Ratio | Repetition Increase | Similarity | Hygiene Grade (LLM, n=148) | Total |
|---|---|---|---|---|---|
| Readability / Specification Quality / Maintainability | |||||
| TextGrad | 1.23 / 0.63 / 0.90 | 2.76 | |||
| PrefPO | / / | 5.16 | |||
| PrefPO -Minimal | / / | ||||
| PrefPO -Elo | – | – | |||
| Method | Hygiene Grade (Human, n=10) | Total | Hygiene Grade (LLM, n=10) | Total |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Task | Type | Samples | Description |
|---|---|---|---|
| object_counting | Exact Match | 250 | Count objects listed in a question |
| movie_recommendation | MC | 250 | Recommend a movie based on preferences |
| causal_judgement | Binary | 187 | Judge whether a causal claim is correct |
| geometric_shapes | MC | 250 | Identify shapes from SVG path commands |
| disambiguation_qa | MC | 250 | Disambiguate pronoun references in context |
| logical_deduction_seven_objects | MC | 250 | Deduce ordering of objects from clues |
| Examples | Discriminator Accuracy | Optimizer Accuracy | Mean Improvement |
|---|---|---|---|
| 5 | |||
| 10 | |||
| 15 | |||
| 20 | |||
| 30 | |||
| 40 |
| Task | Examples | Discriminator Accuracy | Optimizer Accuracy | Mean Improvement |
|---|---|---|---|---|
| Disambiguation | 5 | |||
| Disambiguation | 10 | |||
| Disambiguation | 15 | |||
| Disambiguation | 20 | |||
| Disambiguation | 30 | |||
| Disambiguation | 40 |
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