LLM Eval-Driven Development: Build Software Where Tests Lead the Way

LLM Eval-Driven Development: Build Software Where Tests Lead the Way

LLM eval-driven development is a way of building language model applications in which evaluations come first: you write the test, watch it fail, make the change, and watch the test pass. It borrows the discipline of test-driven development from traditional software and adapts it to a world where outputs are not deterministic and correctness is a matter of degree. The central question is simple: how do you know a change made things better? Eval-driven development answers it by making the evaluation the definition of better, written down before the work begins.

Traditional software has a luxury that LLM applications do not: a function either returns the right answer or it does not. A language model returns an answer that is partly right, mostly right, right but too long, or right in substance but wrong in tone. Without a written evaluation, every change becomes a matter of taste, and the person with the strongest opinion wins. With one, the team argues about evidence instead, and the evidence is a score that anyone can reproduce.

Key takeaways

  • LLM eval-driven development writes the evaluation before the change, so improvement is measured, not assumed.
  • The eval loop is: define the behaviour, write the test, watch it fail, change the system, watch it pass.
  • Small, fast evals run on every change; larger suites run nightly and before release.
  • Every production failure becomes a new test case, so regressions cannot return silently.
  • Eval-driven development fails when the evals are weak, stale or ignored, so guard the tests as carefully as the code.

What eval-driven development means for LLMs

Eval-driven development, often shortened to EDD, treats evaluations the way test-driven development treats unit tests. Before changing a prompt, a model, a retrieval step or a tool, you first write or update the evaluation that describes the behaviour you want. The evaluation fails against the current system, because the behaviour does not exist yet or is broken. You then make the change, run the evaluation, and keep working until it passes. The evaluation is the specification, and the score is the proof that the specification is met.

This is a bigger shift than it sounds. Most LLM work starts with a prompt in a playground, a few promising outputs, and a feeling that the change is good. That feeling is unreliable: a prompt that looks better on five examples can be worse on five hundred. Eval-driven development replaces the feeling with a number, and replaces five examples with a dataset that represents the real workload.

The approach also changes how teams talk about quality. Instead of debating whether an answer is good, the team debates whether the test captures what good means. That is a far more productive argument, because it ends with a concrete artefact, a test case or a rubric, rather than a stalemate. Our guide to building an LLM evaluation framework covers the dataset and scoring pieces that an eval-driven workflow depends on.

The eval-driven loop

The loop has five steps, and it repeats for every change. First, describe the desired behaviour in plain language: what the system should do, what it should not do, and what a good answer looks like. Write it down, because a behaviour nobody has written down cannot be tested.

Second, turn the description into test cases. Write prompts that exercise the behaviour, and for each one define how the output will be judged: an expected answer, a checklist of required facts, a rubric, or a comparison against a reference. Include cases where the behaviour should not trigger, so the test also catches over-eager changes.

Third, run the tests against the current system and confirm they fail, or at least score lower than the target. This step matters more than it seems. A test that passes before you change anything cannot tell you whether your change did anything. If the test already passes, the behaviour is already there, the test is too easy, or the test is broken.

Fourth, make the change. Adjust the prompt, swap the model, change the retrieval settings, or add a guardrail. Keep the change as small as possible, because a small change has a clear effect and a large change has a muddled one.

Fifth, run the tests again and compare. If the score improved without breaking other tests, keep the change. If it improved one metric but damaged another, decide whether the trade-off is acceptable, and say so explicitly. If nothing improved, undo the change and try something else. Best for: teams that change prompts and models frequently, and need a reliable way to tell improvement from churn.

Fast evals and slow evals

Not every evaluation belongs in the same loop. Fast evals are small, cheap and quick: a few dozen cases, scored by rules or simple checks, running in seconds or minutes. They run on every change, in the same way unit tests run on every commit. Their job is to catch obvious regressions immediately.

Slow evals are larger and richer: hundreds of cases, scored by a judge model or a human reviewer, taking minutes or hours. They run nightly and before every release. Their job is to catch the subtle regressions that fast evals miss, such as a gradual drift in tone, a rise in hallucination on hard cases, or a new failure mode in a rare category.

The two layers protect each other. Fast evals keep the development loop moving, so developers actually run them. Slow evals keep the fast evals honest, because a team that only runs fast tests will eventually tune its system to pass them while quality elsewhere decays.

Comparing development approaches

Approach How quality is judged Main strength Main weakness
Eval-driven development Written tests run before and after each change Improvements are measured and reproducible Needs good evals, which take effort to build
Playground-driven development A developer reads a few outputs and judges them Fast and intuitive Unreliable; small samples mislead
Vibes-based review Team members discuss whether outputs feel good Captures taste and nuance Subjective and unrepeatable
Benchmark-only development Public benchmark scores guide changes Comparable across models Benchmarks may not match your users
Production-only feedback User complaints and ratings guide changes Measures real impact Slow; users find the failures first

Most teams use a mix, and that is fine. Eval-driven development does not forbid reading outputs or listening to users. It insists that those signals are checked against written tests before a change ships, so that a good impression on five examples cannot override a bad score on five hundred. Our guide to LLM evaluation benchmarks explains where public benchmarks fit in this picture and where they mislead.

A developer at a desk with a laptop showing a test results screen and a notebook beside it
Write the test first, watch it fail, then make the change. A test that passes before you start proves nothing.

What makes a good eval for this workflow

A good eval for eval-driven development has four qualities. It is fast enough to run often, specific enough to catch the behaviour it targets, stable enough that the same system scores the same way twice, and sensitive enough that a real improvement moves the score. An eval that fails any of these tests will be ignored, and an ignored eval is worse than no eval, because it creates false confidence.

Speed usually means keeping the fast suite small and the scoring simple. Rule-based checks, exact matches and short rubrics belong here. Judge models are slower and costlier, so reserve them for the nightly suite unless the behaviour genuinely needs judgement to score.

Stability is the hardest quality to achieve with language models, because outputs vary between runs. Reduce the noise by fixing the sampling settings during evaluation, using a low temperature for the system under test, and scoring with checks that tolerate wording differences.

Common eval-driven development mistakes

The first mistake is writing evals after the change. It is tempting to build the feature, see what it does, and then write a test that it passes. That test proves nothing. The discipline of writing the test first is the whole point, and it is also the hardest part to maintain under time pressure.

The second mistake is letting the eval suite go stale. Products change, and a test that described good behaviour six months ago may describe the wrong behaviour now. Review the suite regularly, retire cases that no longer apply, and add cases for every new failure found in production.

The third mistake is optimising for the eval instead of for the user. When a score becomes the target, teams tune prompts until the score rises, even if real quality does not. The defence is to keep a held-out set that nobody tunes against, and to check the system against fresh production samples regularly. If the held-out score and the tuned score diverge, the team is gaming the test.

The fourth mistake is having too many evals, or evals that are too slow. A suite that takes hours to run will not be run, and a suite with hundreds of noisy, overlapping tests produces results nobody can interpret. Keep the fast suite small and sharp, and let the slow suite carry the breadth.

Eval-driven development checklist

  • The desired behaviour is written down before any change is made.
  • Test cases and scoring rules exist for the behaviour, including cases where it should not trigger.
  • The tests fail, or score below target, against the current system.
  • Changes are small, and each one is followed by a test run.
  • A fast suite runs on every change; a larger suite runs nightly and before release.
  • Evals and scoring code live in the same repository as the application.
  • Eval results appear in the pull request alongside the change.
  • A held-out set exists that nobody tunes prompts against.
  • Every production failure becomes a new test case.
  • Sensitivity is checked: deliberately worsening the system must lower the score.

Frequently asked questions

What is the difference between eval-driven development and test-driven development?

Test-driven development writes unit tests before code, and the tests give a definite pass or fail. Eval-driven development writes evaluations before changing a language model system, and the results are scores rather than a simple pass or fail. The discipline is the same; the measurement is fuzzier, because language model outputs vary and quality is a matter of degree.

How do I start eval-driven development on an existing project?

Pick one behaviour that matters, write a small dataset of twenty to fifty cases for it, and run it against the current system. Use that suite for the next change to that behaviour, and grow the suite from production failures. Starting small is better than designing a grand framework nobody uses.

Which tools support eval-driven development?

Frameworks such as Promptfoo and DeepEval run evaluations in continuous integration, while platforms such as Langfuse, LangSmith and Braintrust store datasets and results. The workflow matters more than the tool: any setup that runs tests on every change and records the results will work.

How do I handle non-deterministic model outputs in tests?

Fix the sampling settings during evaluation, use low temperatures for the system under test, and score with checks that tolerate wording differences. Where noise remains, run the suite more than once and compare averages, or require a larger margin before calling a change an improvement.

Can eval-driven development work for retrieval systems?

Yes. Write tests for retrieval quality as well as answer quality, checking that the right documents are retrieved before the answer is judged. A change to chunking or ranking should be tested on retrieval scores first, then on end-to-end answer scores.

What if my evals disagree with user feedback?

Trust the users and fix the evals. A disagreement means the tests are not measuring what users care about. Investigate the gap, add test cases that capture it, and update the scoring rules so the evals reflect real quality.

Latest articles

Scroll to Top