System Design Interview Roadmap

System Design Interview Roadmap

Eval Systems: Automating Quality Checks for LLM Outputs

System Design Interview Roadmap · Section 9: AI & LLM Infrastructure · Article 236

Dec 04, 2026
∙ Paid

What the machine actually does

Treat it as a test suite whose assertions are fuzzy. You can’t assert output == "partitions", because “they’re split into partitions” is also right. So equality gets replaced by graders: functions that take an input, an output and a reference, and return a score between 0 and 1.

A working eval system has five parts, run in this order:

  1. A golden dataset. Versioned inputs with reference answers, each tagged with a slice (long-context, numeric, unanswerable).

  2. The system under test. A specific model, prompt template and retrieval config, fingerprinted by hash so any run can be reproduced.

  3. A grader stack, cheapest first. Exact match, token F1, regex and JSON-schema checks cost microseconds. Embedding similarity costs milliseconds on a CPU. Model-graded checks (an NLI model or an LLM judge) cost real seconds and real money, so they run last and only on cases the cheap graders couldn’t settle.

  4. An aggregator that turns per-case verdicts into pass rates per slice, not just one overall number.

  5. A gate that compares the candidate against a stored baseline on the same cases and answers ship or block.

The gate is where most teams go wrong. They compare two averages. Averages hide exactly the failure in the opening paragraph: if a candidate fixes four easy cases and breaks four long-context ones, the overall pass rate doesn’t move at all. The gate has to reason about paired outcomes (case 17 passed before, fails now) and about slices.

Two design decisions matter more than which grader you pick. First, combine graders with AND, not with an average. A fluent hallucination can score 0.8 on semantic similarity; it still has to fail, so a case passes only if it matches the reference and the judge finds it supported by the context. Second, store every raw output. Scores are derived data. When you fix a grader, you re-grade old runs for free instead of paying for generation again.

User's avatar

Continue reading this post for free, courtesy of System Design Roadmap.

Or purchase a paid subscription.
© 2026 SystemDR Inc · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for writing, podcasting, and media founders.