9 / 11
Part 9 Automatic Prompt Optimization
Meta-prompting
IntermediateIn short: Use the model to write and improve prompts.
What is: Use the model itself to generate or improve prompts. It's what tools like Anthropic's "Prompt Improver" do, the model applies the techniques in this guide automatically to your draft.
When to use: When you have a draft prompt and want to optimize it without memorizing every technique.
When to avoid: Trivial prompts, meta-prompting becomes overhead.
Instead of you memorizing everything, the model applies the techniques.
💡 Tip: Give the meta-prompt the target model's context (Claude? GPT reasoning?), best practices diverge across families.
APE, OPRO, DSPy and friends
AdvancedIn short: The machine optimizes the prompt automatically against data.
What is: Frameworks that optimize prompts programmatically against an evaluation set with ground truth. You don't write the perfect prompt, the machine discovers it by testing variations.
When to use: You have a labeled dataset and an objective metric, and the prompt runs at scale (worth automating).
When to avoid: No dataset/metric, stick with manual meta-prompting.
OPRO beat human-written prompts by up to 50% on some benchmarks.
💡 Tip: Even without a framework you can do it manually: define the metric, generate K variations, measure, take the best and iterate (hill climbing).