AI Hints
Home›MLOps Tutorial›LLMOps
MLOps · Lesson 30 of 80

Evaluating LLM Apps

Judging free text.

⏱ 2 min read▶ Video at 1:13:40🎓 Free
Watch this lesson in the MLOps courseWatch on YouTube ↗Full MLOps course

How do you grade an essay by machine? That is the problem of evaluating language model apps. There is no single right answer to compare against. Still, you can build a reliable evaluation, with a mix of simple checks, and careful judging. Let's see the options, from cheapest to richest.

Evaluating LLM Apps
From the video: Evaluating LLM Apps
  • No single right answer
  • Mix cheap checks and judging
  • Build a golden set

A ladder of evaluation methods

There is a ladder of methods. At the bottom, simple rules. Does the answer contain the needed fact? Is it short enough? Does it avoid forbidden words? These are fast, cheap, and exact. Next, reference comparison, how similar is the answer to a known good one. Then, model graded evaluation, where another language model scores the answer, against a rubric, like correct, grounded, polite. This scales well, but must be checked against human judgement. And at the top, human review, slow and expensive, but the final authority. Use the cheap methods on everything, and the expensive ones on samples.

MethodSpeed and costBest for
Rules and checksfast, nearly freefacts, length, format
Reference similarityfastanswers with a known good form
Model-graded (LLM judge)mediumtone, helpfulness, grounding
Human reviewslow, costlyfinal judgement, calibration

Building a golden set

Everything rests on a good golden set, a collection of realistic questions, with the behaviour you expect. Start with real user questions, from logs, with private data removed. Include easy cases, hard cases, and traps, like questions the model should refuse, or answers that are not in your documents. Add every bug you ever fix as a new test, so it can never return. Keep the set versioned, and grow it steadily. Even fifty good cases are far better than none.

Real questionsfrom logs, anonymised
Easy, hard, and trapsrefusals and unknowns too
Every fixed bugbecomes a permanent test
Versioned and growingstart with fifty

The pitfalls of LLM judges

Model graded evaluation is powerful, but has pitfalls. Judges tend to prefer longer answers. They may favour answers written in their own style. They can be inconsistent, so run them several times, or use low randomness. And they can share the same blind spots as the model being judged. To stay honest, write a clear rubric, calibrate the judge against a few hundred human labels, and measure how often they agree. Treat the judge as a measuring instrument, that itself needs testing.

Known judge biases

  • Prefers longer answers
  • Favours its own style
  • Can be inconsistent
  • Shares blind spots

How to stay honest

  • Write a clear rubric
  • Calibrate with human labels
  • Low randomness, repeat runs
  • Test the judge itself

Summary

Wonderful. Evaluate with a ladder of methods, cheap rules for everything, judges for scale, humans for the final word. Build a golden set from real questions, and add every bug as a test. Next, running L L M apps safely, with guardrails, retrieval, cost control, and monitoring.

Key takeaways
  • Ladder: rules, similarity, judge, human
  • Golden set from real questions
  • Calibrate your judge
Next up: Running LLM Apps — guardrails, cost, and monitoring