AN Alpesh Nakrani
BlogBooksPraiseAbout Work with me →
Back to the blog
Blog / Jun 12, 2026 · 20 min

LLM Evaluation: Measuring What Will Break

LLM evaluation is the harness that gates a real deploy. Learn what to measure, which metrics lie, when to trust an LLM judge, and who should own it.

LLM evaluation is the discipline of measuring whether a language model's output is good enough to ship, using a fixed set of inputs, a defined rubric, and a number you trust before a customer finds the failure for you. It is not unit testing, which checks exact outputs. It is statistical: you sample real cases, score them against a standard, and gate the deploy on the result.

That definition is the easy part. The hard part is that most eval suites measure the wrong thing with great precision, pass every check, and then break in production anyway. I have watched it happen at company after company. The fix is not a better tool. It is better judgment about what to measure, applied by the people who own the model's behavior.

This is the thesis of everything I write: AI does the work, and the human evaluates. When generation gets cheap, evaluation becomes the scarce, defensible skill. So this guide is tool-neutral on purpose. The vendors writing eval content are selling an eval platform, and their advice bends toward their feature list. I am going to give you the harness instead, the one that gates a deploy, with the trade-offs named and the revenue consequence attached.

When generation is cheap, value migrates to whoever can tell good output from bad. Evaluation is that skill.

Key takeaways

  • LLM evaluation measures whether a probabilistic model's output is good enough to ship, using a frozen set of real inputs, a written rubric, and a scorer you trust.
  • The common failure is sampling, not metrics: a suite that passes at 95% can sit on a production reality near 70% because the test set never looked like real traffic.
  • Reference-overlap scores like BLEU and ROUGE lie; task-anchored metrics (correctness, relevance, faithfulness, safety) and model-versus-human disagreement on a frozen set tell the truth.
  • LLM-as-a-judge is reliable enough for scale only after you calibrate it against human labels; uncalibrated, it measures its own preferences, with documented position, verbosity, and self-preference bias.
  • Senior engineers who own a model's behavior own its eval suite. Evaluation is the work, not plumbing a platform team does on the side.

What LLM evaluation actually is

LLM evaluation is how you turn a probabilistic system into one you can make a decision about. A model gives a different answer to the same question on different runs. Temperature, context order, and a model version bump all shift the output. You cannot assert a single correct string and call it a test. So you measure distributions: across a representative set of inputs, how often is the output good enough, by a standard you wrote down in advance?

Three pieces make up any honest eval. First, a dataset of inputs that reflects what users actually send, not what you imagined they would. Second, a rubric or metric that defines "good enough" for your task. Third, a scorer, which can be exact-match logic, a human rater, or another model acting as a judge. Change any one of the three and the number changes. That is the whole game, and it is why a single accuracy figure rarely tells you what you think it does.

The reason this matters now is economic. A demo proves a model can do the task once. Evaluation proves it does the task reliably enough that you can put your name on it. I argue in the judgment economy that this gap is where the margin lives. Anyone can generate. Few can reliably tell the good generation from the plausible-but-wrong one at scale, and that capability is what you are actually building when you build an eval suite.

Why eval suites pass and then fail in production

The most common eval failure is not a bad metric. It is a sampling problem dressed up as a measurement problem. Your suite passes at 95% and production runs at 70%, and the gap is not the model getting worse. It is that your test set never looked like real traffic.

Most suites are built bottom-up. A developer writes cases while building the feature. A PM adds a few edge cases during review. The set accumulates into a distribution that reflects the team's imagination, not the user base. Those two distributions diverge, and they diverge most on exactly the inputs that cause incidents: the frustrated user phrasing things oddly, the code-switching query, the malformed paste. The offline-to-production gap is often far larger than teams expect, and it is structural, not bad luck (Label Studio documents the same 95-to-70 pattern across deployments).

The fix is mechanical but demands discipline: sample your eval set from real production traffic, freeze it, version it, and stop letting it grow organically. I cover the full harness in evals that predict production, the cornerstone essay this guide expands on. The short version: a moving eval set is not a ruler. It is a rubber band, and the number it reports is a fact about the test, not the model.

Your suite passed because it was easy. Production failed because it was real. That gap is a sampling decision, not a model defect.

Freezing the set has an uncomfortable implication that teams resist. Your score on a frozen set can only go down, because you cannot sneak in new easy cases to prop the number back up. That is the point. You want a fixed ruler. The reward is something most AI teams cannot honestly claim: a straight historical comparison. Is the model you are about to deploy better or worse than the one you shipped six months ago, on exactly the same questions, scored by exactly the same rubric? Freeze the set and you can answer that. Let it drift and you cannot.

The metrics that matter and the ones that lie

Most published eval metrics are reference-based scores that correlate poorly with whether a real user was helped. BLEU, ROUGE, and exact-match compare output to a gold string. They were built for translation and summarization, and they punish a correct answer phrased differently from the reference. A model can score badly on ROUGE and be right, or score well and be uselessly verbose. These metrics lie by being precise about the wrong thing.

The metrics that matter are task-anchored. For most generation tasks, you want some version of: correctness (is the claim true), relevance (does it answer the actual question), faithfulness (is it grounded in the source you gave it, not invented), and safety (does it refuse what it should). Each is scored against your rubric, not a gold string. None reduces to a single clean number across tasks, and any vendor promising one composite "quality score" is selling you comfort.

Here is the discipline that separates a real metric from a vanity one. A real metric moves when the model changes and holds still when the model holds still. If your number jumps because you reworded the rubric or swapped the rater pool, you measured the test, not the model. I take each metric apart, with the failure mode it hides, in the companion piece on the LLM evaluation metrics that matter, and I dig into which ones survive contact with production in A Field Guide to Evals.

Metric typeWhat it claimsWhat it actually measuresTrust it for
Exact-match / BLEU / ROUGEOutput qualityString overlap with one referenceNarrow extraction, classification
Aggregate accuracyHow good the model isSampling + rubric + raters + model, mixedCoarse trend only
Faithfulness / groundednessNo hallucinationClaims supported by provided contextRAG, summarization
Human-vs-model disagreementProduction readinessDivergence from calibrated humans on a frozen setGo / no-go gating

The trap is aggregate accuracy. It is affected by your sampling strategy, your rubric, your rater pool, and the model, four variables at once. When the number moves you often cannot say which variable moved it. That makes it a poor basis for a ship decision and a great basis for fooling yourself.

Building an LLM evaluation framework

An evaluation framework is a process, not a product you install. The build-your-own discipline has five parts, and the order matters.

One, define the failure that costs money. Before you write a single test, name what breaking in production actually costs. A wrong SKU on an order. A hallucinated policy in a support reply. A refused query that should have converted. The metric you build should track that failure, not a generic benchmark score. This is the step teams skip, and it is why their dashboards are green while revenue leaks.

Two, sample the dataset from production. Pull real traffic, stratify it by intent, and over-weight the hard slices. Freeze it as a named artifact. The set is the foundation; a perfect rubric on a fake dataset measures nothing.

Three, write the rubric in plain language. A rubric a senior engineer can read and apply in under a minute beats a clever scoring function nobody understands. Ambiguity in the rubric shows up later as rater disagreement, which is a signal, not noise.

Four, choose the scorer per metric. Use exact logic where the answer is deterministic. Use a model judge where it is calibrated and cheap. Use calibrated humans where the margin is hard and the cost of a miss is high. Most teams reach for one scorer for everything; the right answer is a mix.

Five, gate the deploy on a threshold set in advance. Setting the bar after you see the result is not evaluation. It is rationalization. The product and engineering teams agree on the threshold before the run, and the run either clears the gate or it does not. That gate is the offline half of the picture; what you measure after release is the online half, and I draw the line between them in offline vs online evaluation.

The framework that gates a real deploy looks more like a controlled experiment than a CI badge. I walk through the harness end-to-end, including stratified sampling and versioning, in the cornerstone eval essay, and the step-by-step build in how to build an LLM evaluation framework. The point of the framework is not coverage. It is a defensible decision.

If you would rather have this built into a system from day one than retrofit it after the first incident, that is the work a Devlyn AI engineering pod does, with the eval harness gating the deploy. The judgment about what to measure still stays with your team. A pod just builds the rails that let your engineers hold it.

LLM-as-a-judge: when to trust the model grading the model

LLM-as-a-judge means using a strong model to score another model's output against a rubric. Used well, it agrees with human reviewers around 85% of the time on many tasks, which is higher than two humans typically agree with each other (Confident AI reports this range across applications). That makes it the only practical way to score at the volume production demands. It is also where most teams quietly lose the plot.

Trust the judge when three conditions hold. The rubric is concrete and the task has a clear notion of correct. You have calibrated the judge against human labels on a sample and measured agreement, ideally a Krippendorff's alpha near 0.8. And you control for the known biases. Without that calibration step, you are not measuring quality. You are measuring the judge's preferences.

The biases are well documented and they are not subtle. Judges show position bias, favoring the first option in a pairwise comparison. They show verbosity bias, rewarding longer answers regardless of correctness. They show self-preference, scoring outputs from their own model family higher. A 2026 RAND study found no judge is uniformly reliable across benchmarks, with frontier models exceeding 50% error on hard bias tests and consistency breaking on changes as small as reformatting or paraphrasing (Adaline's summary; the underlying scoring-bias work is on arXiv).

An LLM judge does not measure quality until you calibrate it against humans. Before that, it measures its own preferences.

The honest trade-off: a model judge buys you scale and costs you a ceiling. Calibrated humans catch the confident, plausible, wrong answer that a judge waves through, because a domain expert knows the answer is wrong and the judge only knows it sounds right. My rule is to judge with a model where volume demands it, audit a sample with humans on a fixed cadence, and never let the judge grade the hardest 10% of cases unsupervised. That is also a revenue rule: the cases a judge mis-grades are disproportionately the ones that cost you a customer. I go deeper on the calibration protocol and the bias controls in when to trust LLM-as-a-judge, and on how to spend that scarce human attention on the flagged tail in human-in-the-loop evaluation that scales.

Building a golden eval set from production traffic

A golden set is a frozen, versioned collection of real inputs with trusted reference answers, used as the fixed ruler for every model candidate. Build it from production traffic, not from your imagination, and build it to over-represent the cases that hurt.

The sampling that matters is stratified and adversarial. A uniform random sample under-represents every hard case, because hard cases cluster rather than spread evenly. I deliberately over-sample four buckets: cases where the model's confidence was in the bottom quartile, cases where a human reviewer submitted a correction, syntactically adversarial inputs like code-switching or truncated text, and cases that previously caused a production incident even after the root cause was fixed. That last bucket is the one teams skip because the incident feels resolved. It is not resolved until a future model version passes those exact cases on a held-out set.

Reference answers come from calibrated humans under a blinded protocol, so the rater never knows which model version produced an output. Blinding is not academic. I have watched a good engineer give quiet benefit-of-the-doubt to outputs from a model they helped tune. Strip the version, shuffle the order, and plant a known proportion of gold human responses in the batch unlabeled. If raters start scoring the planted human answers below your model's passing bar, the rubric has drifted and you stop scoring until you recalibrate.

Over-sampling the tail is a real trade-off: your aggregate number will look worse than a uniform sample would show. Good. A metric that reflects your hardest real traffic is more honest than one that flatters your average traffic. Ship the model that passes the hard set, not the one with the prettiest headline number. I lay out the full sampling and blinding protocol in how to build a golden eval set from production traffic.

Offline versus online evaluation

Offline evaluation tests a candidate before deploy against a fixed golden set with known good answers. Online evaluation scores live production traffic as it arrives, watching for quality drops, hallucinations, and policy violations without a reference answer. You need both, and they catch different failures.

Offline catches the failure modes you already know about, and it gates the deploy. Online catches the novel ones and the distribution shift your frozen set could not anticipate. The gap between them is the whole reason this is hard: a curated set at 95% can sit on top of a production reality at 70%, because real users do things your set never sampled (LangChain's eval guide frames the same offline-as-regression, online-as-monitoring split).

Offline evalOnline eval
WhenPre-deploy, in CILive, on production traffic
ReferenceKnown good answersUsually none
CatchesKnown failure modes, regressionsNovel failures, drift
DecisionShip / do not shipAlert / roll back / sample for review

The practical discipline: use the same rubric and scorer for both, so an offline pass and an online pass mean the same thing. When they diverge, the divergence itself is your most valuable signal, because it tells you exactly which cases your golden set is missing. Feed those back into the next version of the set. The handoff between the two modes, offline versus online, is where most teams lose the thread. Online evaluation is also where cost and latency live as first-class metrics, since a model that is correct but slow or expensive can still be a product failure. That is the bridge from evals to production observability and monitoring, where the eval rubric becomes a live guardrail.

Evaluating RAG and agents

RAG and agents fail in places a single-turn eval cannot see, so they need system-specific metrics. Evaluating the final answer alone hides where the system actually broke.

For RAG, you evaluate retrieval and generation separately, because a wrong answer can come from either stage. The standard metrics, popularized by frameworks like RAGAS, are context recall (did retrieval surface the documents needed to answer), context precision (how much of what it surfaced was relevant), faithfulness (is the answer grounded in retrieved context rather than invented), and answer relevancy (does it address the actual query). The frameworks now ship a dozen-plus retrieval and generation metrics, separating the two stages so you can fix the right one (RAGAS docs). A faithfulness drop points at generation. A recall drop points at retrieval, chunking, or embeddings.

The failure that the metrics warn you about is the slow one. Retrieval looks perfect in the demo, then the corpus grows, queries drift, and recall quietly collapses over weeks. I tell that whole story, with the decay curve, in why RAG pipelines fail in month three, and I work the retrieval metrics end-to-end in RAG evaluation: measuring retrieval before it collapses. The eval lesson: track context recall on a frozen query set over time, not just at launch, or you will not see the collapse until a customer does.

For agents, the final answer is the least informative thing to score. An agent chains planning, tool calls, retrieval, and sub-agent handoffs across a long trajectory, and it can reach a right answer through a broken path or a wrong answer through a sound one. So you evaluate the trajectory: task completion (did it achieve the user's goal), tool-call accuracy (did it call the right tool with the right arguments), plan quality (did it decompose the task sensibly and know when it had enough to act), and step-level traces for loops and dead ends. The 2026 consensus has moved from single-axis completion scores to multi-dimensional, trajectory-aware evaluation precisely because completion alone hid the failures (Confident AI's agent guide lays out the metric set). I cover the honest limits of agent reliability in an honest look at agents; the eval implication is that an agent good at four tasks and a liability on the fifth needs per-task gates, not one global score. The full trajectory-scoring method has its own walkthrough in how to evaluate an AI agent.

The one metric worth reporting to the business

The single metric I report up is model-versus-trusted-human disagreement on a frozen, production-sampled set, tracked over time. Not aggregate accuracy. One number, anchored to a fixed ruler and to human performance, that tells the truth about whether the model got better.

Here is why it beats accuracy. It is anchored to a fixed distribution, so a change in the number reflects a change in the model, not the test. It is anchored to human performance, so it has a meaningful floor and ceiling. And it is directional: up means worse, down means better, and you can open the exact cases that moved. Leadership wants a number, which is legitimate. This is the number that does not lie to them.

The revenue translation is the part that earns the meeting. Disagreement on the frozen set maps to the failure you priced in step one of the framework: a point of disagreement on the support-resolution cluster is some number of mishandled tickets, some churn, some support cost. When you can say "this candidate cuts disagreement on the revenue-critical cluster from 8% to 6%, which is worth roughly X in retained accounts," you have turned an engineering metric into a business decision. That sentence is why evaluation belongs in the room where budgets get set, and it is the whole argument of the judgment economy made concrete.

Aggregate accuracy is for dashboards. Model-versus-human disagreement on a frozen set, priced in dollars, is for decisions.

Running the harness: what an eval run looks like

Here is an abbreviated run against a frozen set. The numbers are realistic but illustrative, not from a specific live system.

# offline eval against frozen golden set
python -m eval.runner \
--suite golden-2026-w24-v2.jsonl \
--model prod-candidate-2026-06-15 \
--judge calibrated-judge-v3 --human-audit 0.10
# results summary
cases evaluated 912
faithfulness 0.948 # RAG cases only, n=410
context recall 0.882 # down 0.021 vs prior, FLAG
tool-call accuracy 0.913 # agent cases, n=190
human disagree 5.8% # threshold 8.0%, PASS
adversarial tail 13.4% # threshold 18.0%, PASS
judge-vs-human agree 0.79 alpha # floor 0.75, PASS
p95 latency 2,110 ms # +180 ms, review
verdict GATE HOLD # recall regression blocks deploy

Read what that run is telling you. Aggregate quality looks fine, but context recall dropped 0.021 and the gate holds on that alone, because a recall regression in RAG is the slow-collapse failure starting early. The judge-vs-human alpha at 0.79 confirms the judge is still calibrated enough to trust this run; if it had fallen below the floor, every other number would be suspect and the run would void. The latency flag does not block by itself, but it forces a human review before any override. This is the difference between a harness and a dashboard: the harness makes a decision and shows its work.

Who owns evals: senior engineers, not a tooling team

The engineers who own a model's behavior in production own the eval suite for that behavior. They write the rubric, sit in on rater calibration, read the disagreement reports, and decide when the rubric needs revision. This is not infrastructure work that a platform team does on the side. It is the work.

The failure mode I see most is treating evals as plumbing: a platform team owns the runner, it produces a number in CI, and product engineers passively consume it. That arrangement reliably measures the wrong things with great precision, because the people who understand what "good" means for the task are not the people defining how it is scored. Shipping a model without understanding the eval suite that gated it is the same as shipping code without understanding the tests.

This stance only scales when the eval infrastructure is legible enough that a senior engineer can trace any metric back to the sampling and rubric choices that produced it. Legibility is an engineering requirement, not a nice-to-have. The deeper argument is that Human in the Loop Is Not a Plan: you cannot outsource production judgment to a review queue and call it a quality system, and you cannot outsource it to a tooling team either. I make the operational case for keeping humans on the judgment, not the volume, in the human-loop essay. The model meets the bar on your frozen, adversarially-sampled, human-calibrated set, or it does not ship.

The eval-driven posture takes this further: let the test suite lead the model, write the eval before the feature, and treat a failing eval as a spec for what to build next. That is the subject of Eval-Driven Development, and it is the cleanest way I know to keep judgment at the center of the loop as autonomy grows.

Tools: a neutral read

The tooling landscape splits into a few honest categories, and the right choice depends on what you are gating, not on which vendor has the best demo. I am naming categories, not endorsements.

  • Open-source metric libraries give you reference metrics and RAG scorers you run yourself. Best when you want full control of the rubric and no vendor in your data path. RAGAS and DeepEval sit here.
  • Tracing and observability platforms capture production traces and run online evals on live traffic. Best when your hardest problem is seeing what the system actually did. Arize, LangSmith, and Braintrust sit here.
  • Managed eval platforms bundle dataset management, judges, and human-annotation workflows. Best when you want one workflow and will accept the platform's opinions. Most vendor blogs are written from here.

The trade-off no tool removes is ownership. A platform makes running evals easier; it does not make your rubric correct or your sampling honest. The judgment about what to measure stays with your engineers no matter what you buy. Pick the lightest tool that lets a senior engineer trace a number to its source, and spend the saved effort on the dataset and the rubric, which are the parts that actually determine whether your eval predicts production. I compare the categories in more depth, still vendor-neutral, in LLM evaluation tools compared.

Frequently asked questions

What is LLM evaluation? LLM evaluation is the practice of measuring whether a language model's output is good enough to ship, using a fixed set of representative inputs, a written rubric, and a scorer. Because models are probabilistic, you measure distributions of quality rather than asserting one correct output, and you gate the deploy on the result.

How do you evaluate an LLM? Sample real inputs from production, freeze them into a versioned golden set, define a rubric for what good means on your task, score outputs with exact logic, a calibrated model judge, or human raters, and gate the deploy on a threshold agreed in advance. Evaluate retrieval and reasoning trajectories separately for RAG and agents.

What metrics should I use for LLM evaluation? Use task-anchored metrics like correctness, relevance, faithfulness, and safety rather than reference-overlap scores like BLEU or ROUGE, which punish correct answers phrased differently. The one metric worth reporting up is model-versus-trusted-human disagreement on a frozen production set, tracked over time.

Is LLM-as-a-judge reliable? It is reliable enough for scale once calibrated against human labels, agreeing with humans around 85% of the time on many tasks. Without calibration it is unreliable, because judges show position bias, verbosity bias, and self-preference, and 2026 research found frontier judges exceeding 50% error on hard bias tests.

How do I build a golden eval set? Sample real production traffic, stratify by intent, and over-sample hard cases: low-confidence outputs, human corrections, adversarial inputs, and past incidents. Have calibrated humans write reference answers under a blinded protocol, then freeze and version the set so your ruler never moves.

What is the difference between offline and online evaluation? Offline evaluation tests a candidate before deploy against a fixed set with known answers and gates the ship decision. Online evaluation scores live traffic without references to catch novel failures and drift. You need both, and the gap between them tells you which cases your golden set is missing.

Where to take this next

If you are building the harness yourself, start with the cornerstone on evals that predict production and the deeper reference in A Field Guide to Evals. Both go past the overview here into the sampling, blinding, and rubric protocols that decide whether your evals are worth trusting.

If you are shipping a real system and want evaluation and observability built in from day one rather than bolted on after the first incident, that is exactly the work a Devlyn AI engineering pod does, with the eval harness gating the deploy and production monitoring carrying the same rubric into live traffic. The point of all of this is one thing: the machine does the work, and you keep the judgment. Build the suite that predicts production, freeze it, and trust the number it gives you over the number you wished it gave.

Share
Next

Keep reading

View all blogs