LearnQuestion bank

GEPA, a reflective prompt optimiser in DSPy, reports beating GRPO fine-tuning with far fewer rollouts. When would you optimise prompts automatically instead of fine-tuning, and what could go wrong?

Applied LLMTechnicalHard

Answer it yourself first, out loud or on paper, then compare.

Answer

Model answer, written in a candidate's voice

In short

  • Core point: use prompt optimisation when the bottleneck is expensive rollouts and the change should stay inspectable, not when the bottleneck is per-call cost or behaviour prompts cannot reach.
  • Mechanism: run the program, collect traces and feedback, let a model reflect in natural language on failures, propose new instructions, and keep a Pareto set of candidates per task instance.
  • Evidence with care: the revised paper reports roughly 6% average and up to 20% gains over GRPO with up to 35x fewer rollouts on specific tasks and models, and over 10% over MIPROv2.
  • Prefer prompt optimisation for scarce data, expensive rollouts, closed weights, or when interpretability of the change matters; prefer fine-tuning for latency, cost per call, or behaviours prompts cannot reach.
  • Risks: overfitting to a small eval set, prompts breaking on the next model version, reliance on a strong reflection model, and leakage between optimisation and test splits.
  • Mitigations: held-out evaluation, re-running optimisation on model upgrades, and hand-reviewing the evolved prompt.

In full

I would optimise prompts automatically when the expensive part is rollouts and the change needs to stay inspectable: run the program, collect traces and feedback, have a model reflect in natural language on failures, propose new instructions, and keep a Pareto set of candidates per task instance. The evidence is promising but should be read as reported, not universal: the revised paper reports about 6% average and up to 20% gains over GRPO with up to 35 times fewer rollouts on specific tasks and models, and over 10% over MIPROv2. I would choose this over fine-tuning when data is scarce, rollouts are expensive, weights are closed, or the team needs to understand and audit the change; I would choose fine-tuning when latency, cost per call, or behaviours prompts cannot reach are the real constraints. The main risks are overfitting to a small eval set, prompts that break on the next model version, reliance on a strong reflection model, and leakage between optimisation and test splits. So I would validate on a held-out set, re-run optimisation after model upgrades, and review the evolved prompt by hand before shipping.

Checked against sources by an independent AI reviewer.

What a strong answer covers

  • Explains the mechanism: run the program, collect traces and feedback, have a model reflect in natural language on failures, propose new instructions, keep a Pareto set of candidates per task instance.
  • Quotes the evidence with care: the revised paper reports about 6% average and up to 20% gains over GRPO with up to 35 times fewer rollouts on specific tasks and models, and over 10% over MIPROv2.
  • Prefers prompt optimisation when data is scarce, rollouts are expensive, weights are closed or interpretability of the change matters; prefers fine-tuning for latency, cost per call or behaviours prompts cannot reach.
  • Names risks: overfitting to a small eval set, prompts that break on the next model version, reliance on a strong reflection model, and leakage between optimisation and test splits.
  • Proposes held-out evaluation, re-running optimisation on model upgrades and reviewing the evolved prompt by hand.

Common mistakes

  • Treating the result as proof that prompt optimisation always beats RL, regardless of task, model and budget.

Follow-ups

  • How large and how diverse must the optimisation set be before you trust the gain?