The Research Report
Stop Writing Prompts by Hand. Start Optimizing Them with Preferences.
You know the drill. You write a prompt. The model ignores half of it. You tweak the wording. It gets worse. You add more instructions. The prompt balloons to 2,000 characters. The model still messes up. You go back to the drawing board.
Prompt engineering is the most common way to adapt LLMs to new tasks. It is also the most tedious. The field has produced automated optimizers like TextGrad, MIPROv2, and GEPA that can outperform hand-crafted prompts. But they come with problems most papers do not talk about: bloated outputs, repetitive instructions, and prompts that game the evaluation instead of doing the actual task.
PrefPO, a new framework from Distyl AI accepted at the ICLR 2026 AIWILD workshop, takes a different approach. It borrows the core idea behind RLHF and applies it to prompt optimization. The result is a system that matches state-of-the-art performance without requiring labeled data and produces prompts that are actually readable.
The Problem with Current Optimizers
Automated prompt optimizers work. That is not the issue. The issue is what they produce.
TextGrad takes a 350-character starting prompt and turns it into a 4,000-character monster packed with self-check routines, banned character lists, and redundant formatting instructions. On some tasks, TextGrad prompts ballooned to roughly 10,000 characters. MIPROv2 prompts contained over 34% repetitive content.
Both achieve high pass rates. Both are nightmares to debug, maintain, or hand off to another team.
Then there is what the PrefPO authors call "prompt hacking." TextGrad optimized a task requiring at least 50 sentences by inflating the requirement to 65. It banned far more words than the task specified. These hacked prompts look reasonable on the surface but change outputs in ways you never asked for. The authors found TextGrad exhibited hacking behavior in 86% of evaluated cases. PrefPO: 37%.
These are not edge cases. They are structural problems with how current optimizers work.
How PrefPO Works
PrefPO takes its inspiration from reinforcement learning from human feedback, the technique that powers ChatGPT's alignment training. The key insight from RLHF research: pairwise comparisons ("Is A better than B?") produce more reliable signals than absolute scores ("Rate this from 1 to 10").
The loop is simple:
- Start with a pool of candidate prompts. One prompt is fine. PrefPO generates a variant automatically.
- Sample two prompts from the pool and generate outputs from the task model.
- An LLM discriminator compares the two outputs against natural language criteria you provide. It picks a winner and explains why the loser fell short.
- An LLM optimizer takes the losing prompt and the discriminator's feedback, then produces an improved version.
- The improved prompt goes back into the pool. Repeat.
That is the entire algorithm. No labeled data required. The natural language criteria replace labels entirely. You describe what you want in plain English, and the discriminator uses that as its rubric.
There are two modes. Instruction mode optimizes a shared prompt across a dataset of inputs. Standalone mode optimizes prompts where the prompt itself is the task, like "Write a 300-word summary of renewable energy." Standalone mode needs no dataset at all.
A variant called PrefPO-Minimal adds a single instruction to the optimizer: make minimal edits. That one change further improved prompt hygiene and reduced hacking.
The Results
The authors evaluated PrefPO on two benchmarks:
- BIG-Bench Hard (BBH): 9 reasoning subtasks. PrefPO ranked first on more individual tasks (4 of 9) than any other method, including MIPROv2, GEPA, and TextGrad. On 6 of 9 tasks, PrefPO running without any labels showed no meaningful difference from its labeled performance. On two tasks, the unlabeled version outperformed all labeled methods.
- IFEval-Hard: A new benchmark the authors curated by filtering IFEval for examples that are particularly challenging for GPT-4o. 148 instruction-following tasks. PrefPO scored 82.4% compared to TextGrad's 84.5%, a small gap given PrefPO does not need labels.
The hygiene numbers tell the clearest story. Existing methods produced prompts 14.7 times their original length. PrefPO reduced that by 3 to 5 times. Existing methods generated prompts with up to 34% repetitive content. PrefPO cut that too. Human judges rated PrefPO's prompts higher on readability and clarity.
And the hacking problem? PrefPO showed hacking behavior in 37% of evaluated cases. TextGrad hit 86%. PrefPO-Minimal was even cleaner.
Why It Matters
Most prompt optimizers require a labeled dataset. That is a dealbreaker for most real-world tasks. You do not always have ground truth answers sitting around. PrefPO lets you start with a prompt and a description of what you want. That is it.
The preference-based approach also captures dimensions of quality that accuracy alone misses. A customer service response needs correct information and the right tone. A medical summary needs sound reasoning, not just the right answer. Pairwise comparison against natural language criteria captures these nuances in a way that scoring against a single correct answer cannot.
The open-source release makes it practical. The code runs on Python 3.11+ and uses litellm for model routing. You can swap in any provider. The discriminator and optimizer default to GPT-5 but work with any model that supports structured JSON output. The task model can be anything litellm supports.
The Broader Pattern
PrefPO is part of a shift in how we think about LLM optimization. RLHF moved alignment training from absolute scoring to pairwise preference. Direct Preference Optimization simplified that further. Now the same pattern is moving into prompt engineering.
The pattern is consistent: stop asking models for scores. Ask them to choose. The comparison signal is cleaner, the optimization is more stable, and the outputs are more aligned with what you actually want.
For prompt optimization specifically, this means you can iterate faster. No dataset curation. No hyperparameter tuning on evaluation metrics. Just describe what good looks like and let the loop run.
Getting Started
PrefPO is open-source at github.com/DistylAI/prefpo under an MIT license. The IFEval-Hard benchmark is available at huggingface.co/datasets/rahul-singhal/IFEval-Hard. The paper is at arxiv.org/abs/2603.19311.
Install with:
pip install -e .
For IFEval support:
pip install -e ".[ifeval]"
Set your API key as an environment variable. Then configure your task model, initial prompts, and criteria. The README includes full examples for both instruction and standalone modes.
If you have been writing prompts by hand, or watching automated optimizers produce unreadable garbage, PrefPO is worth a look. The preference-based approach produces cleaner prompts, works without labels, and avoids the worst optimization hacks. That combination has not existed in a single framework before.
Citations
- Singhal, R., Tambwekar, P., & Maamari, K. (2026). PrefPO: Pairwise Preference Prompt Optimization. arXiv:2603.19311. Accepted at ICLR 2026 AIWILD workshop. https://arxiv.org/abs/2603.19311
- PrefPO GitHub repository: https://github.com/DistylAI/prefpo
- IFEval-Hard dataset: https://huggingface.co/datasets/rahul-singhal/IFEval-Hard
- Distyl AI blog post on PrefPO: https://distylai.substack.com/p/prefpo-optimizing-prompts-through
- OpenReview submission: https://openreview.net/forum?id=dA8c3rqto6
- BIG-Bench Hard: Suzgun et al. (2022). Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Them. arXiv:2210.09261.
- TextGrad: Yuksekgonul et al. (2024). TextGrad: Automatic "Differentiation" via Text. https://github.com/zou-group/textgrad
- MIPROv2/GEPA: DSPy framework. https://dspy.ai
Suggested Title
Stop Writing Prompts by Hand. Start Optimizing Them with Preferences.
Word Count
977
Fact-Check Notes
- All performance numbers (6/9 tasks, 82.4% vs 84.5%, 14.7x, 34%, 37% vs 86% hacking) come directly from the paper abstract and Distyl blog post. Verified against arXiv abstract and OpenReview.
- The "ICLR 2026 AIWILD workshop" venue is confirmed via OpenReview listing.
- PrefPO-Minimal description (single-line instruction to optimizer) is from the blog post. The paper may have more detail on this variant.
- The blog post references GPT-4o and GPT-5 as task/discriminator models. The GitHub README defaults discriminator/optimizer to "openai/gpt-5". The paper's exact model configurations should be verified if specifics matter for publication.
- The IFEval-Hard benchmark being a "newly-curated" subset is per the paper abstract. The exact curation method is described in the paper but not fully detailed in the sources I accessed.
- The claim "first preference-based prompt optimizer validated at a major venue" from the brief is reasonable given no prior preference-based prompt optimizer appears in the literature at ICLR/ICML/NeurIPS, but I did not exhaustively verify this against all workshop proceedings.