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.
free sign-in, no card required
Practise it as an interviewer asks it
How do you approach an agentic system design interview? Give the method you would use on any prompt.How do you compare agent frameworks? Name what every one of them has in common and the questions that separate them.An agent task costs too much and takes 90 seconds. How do you cut both systematically?A teammate rewrote the agent's tool guidance and says it is better because the demo task now passes. How do you decide?A frontier model improves your agent's accuracy by 2 points but triples inference cost. How do you decide?Design the reward for training a coding agent with reinforcement learning. What makes it useful?