Skip to content

Lesson 2 of 4 · 4 min read

Prompt Optimisation with a Metric: DSPy, GEPA and MIPROv2

Prompt optimisation treats instructions and few-shot examples as parameters to search against a metric. In DSPy you give a program, a scoring function and training examples. MIPROv2 bootstraps candidate demonstrations, proposes instructions with a model and searches combinations with Bayesian optimisation. GEPA (2025, an ICLR 2026 oral) reflects on execution traces and textual feedback from the metric to evolve prompts, keeping a Pareto set of candidates that do best on different validation examples.

Reviewed By the AIAgentInterviews editorial team
free sign-in, no card required

Practise it as an interviewer asks it

Related lessons