Eval-Based Development

To eval, or not to eval

Compared to two years ago, programming as a craft feels like a whole new paradigm. My daily role has become one of prompts and plans, rather than code structure and unit tests. This has had adverse effects on the enjoyment which I feel from well-crafted code written by a machine. One change I'm getting used to as LLMs become more common is eval-driven development (EDD). Similar to test-driven development, this technique involves creating a clear set of evaluation metrics, ideally graded with a binary outcome, but also potentially with an LLM judge. The test cases themselves are normally designed 'by hand', in the sense that you have a strong understanding of either the code outcome or the business value you're trying to produce. You can also combine these deterministic tests with non-deterministic cases to create a more fully fledged evaluation suite (e.g. latency/performance metrics + A/B tests). Once you've defined the evals, you can either record the baseline results in a Markdown file or publish them as metrics to facilitate tracking.

This feels like the direction programming is heading, given the speed and accuracy with which models can now produce code. As the input/output token economy continues to optimise, it will only become easier for multi-service codebase changes to take place from a single agent. If your infrastructure ideally enables cloud deployments for specific versions of applications, offline evaluations also become possible with much smaller iteration periods, and eval runs can occur in parallel.

This gives you the freedom to then target a swarm of agents at your codebase, define the given functions/services that it can optimise, and the constraints it must work within, and quickly see meaningful results. Testing them becomes a matter of deploying different versions of the applications and repeatedly running the eval cases until you see statistically significant improvements. See below for an example of an eval I've been developing in a recent work project. By asking agents to then investigate improvement scopes, I'm confident that the baseline eval tests I have provide a strong indication of the correct behaviour. By manually reviewing the code, I am also able to ensure they're not being gamed, and from this I'm making fast incremental improvements.

Evaluation dashboard comparing pass rates across five techniques, with technique and category names redacted.

Caveat - this clearly requires some manual oversight, given the likelihood of optimising for a local maximum, and ideally you can introduce a grader for the agent itself to check whether the improvements generalise to new cases. The speedup I'm seeing in projects for my day-to-day is tremendous, and the focus is now shifting in the early parts of my projects from longer design sessions to defining a strong early grading set.