Obsidian Metadata
| type | concept |
| sources | Source - AI Evals FAQ, Source - GEPA, Source - Show Me The Prompt |
Prompt Optimization (Automated Prompt Engineering)
Should you stop writing prompts by hand? Be skeptical, especially early.
- Writing a prompt forces you to clarify assumptions and externalize requirements. “Good writing is good thinking” (Paul Graham, Writes and Write-Nots). Delegating too early means you may never fully understand your requirements or the model’s failure modes.
- Optimizers hill-climb a predefined metric. They improve on known failures but can’t discover new ones. That needs Error Analysis.
- Evaluation criteria shift after you review outputs (Criteria Drift). Evaluation is an iterative, human-driven sensemaking process, not a static target to hand off.
Pragmatic approach: use LLMs to improve your prompt based on your open-coding notes, which keeps a human in the loop. Once you have a high-quality set of evals, optimization works well for the last mile.
Optimizing judge prompts
- GEPA (Genetic-Pareto; Agrawal et al., 2025) reflects on trajectories in natural language, proposes prompt updates, and keeps a Pareto frontier. It beats GRPO by ~6% on average (up to 20%) with up to 35× fewer rollouts, and beats MIPROv2 by >10%.
- For judges, a tuner changes the evaluator’s prompt and checks whether agreement with human labels on the dev set improves. It can take hundreds or thousands of evaluations, so a fast, cheap classifier (e.g., Jev) makes it much cheaper.
- Inspect disagreements manually first. Tuning too early hides non-prompt problems: missing context, bad labels.
- Give the optimizer (or agent) one specific failure and a measurable target. “Find all errors and keep improving” is too vague.
- Keep the test set out of the loop.
- Hamel’s historical experience: he usually adjusts prompts by hand and “hasn’t had much luck with DSPy”. Eugene Yan’s AlignEval is a simple alternative.
Look at the prompt
Frameworks that write prompts for you (guardrails libraries, DSPy, LangChain experimental chains, Instructor validators) can hide many API calls and odd prompts. Intercept the calls (e.g., with mitmproxy) and read the actual prompt before trusting it (see Source - Show Me The Prompt). DSPy’s “minimal” quickstart made hundreds of API calls over 30+ minutes.

