AI Evals: When the Answer Looks Right but Isn't
Why evaluating AI applications is much more interesting than giving a model a score.
The approach here draws on Shreya Shankar and Hamel Husain’s Evals for AI Engineers (O’Reilly, 2026). The diagrams are my own.
Imagine an AI assistant reviewing documents for a payment dispute. Someone asks: “Did the company pay the $12,000 invoice?”
The assistant finds the invoice, cites it, and confidently replies: “Yes, the company paid $12,000.”
There’s just one problem. An invoice proves someone requested payment. It doesn’t prove the payment happened. The AI retrieved a relevant document and produced a convincing answer, but the evidence never supported its conclusion.
How would we catch something like this before users do? That’s where AI evals come in.
A good benchmark score isn’t enough
We often compare models using benchmarks like MMLU, GPQA, or coding tests. Those are useful for understanding general capabilities, but they can’t tell us whether an AI application performs our particular task reliably.
For a document-analysis assistant, what matters is whether it finds the right evidence, interprets it correctly, and avoids conclusions the documents don’t support. And those failures aren’t always obvious from the final response.
Start with traces, not scores
Before building evaluation metrics, we need to understand what actually happened. A trace records the steps behind an AI response: the user’s request, retrieved documents, model calls, tool interactions, and final output.
In our example, the trace might show:
- The user asks whether an invoice was paid.
- The retrieval system finds the invoice.
- The model treats the invoice amount as proof of payment.
- The assistant reports that payment was completed.

Now we know something important. The document wasn’t irrelevant. The problem was the conclusion drawn from it, and that distinction tells us where to investigate.
I saw the same pattern while building DevSignal, my open-source duplicate-issue search project. Measuring retrieval separately from the final result showed exactly where search was failing, instead of leaving me with one vague score.
Find patterns before designing evaluations
One failed response isn’t enough to understand the system. We need to review a sample of interactions, including ordinary requests, complicated cases, and examples users reported as incorrect. This is called error analysis.
Suppose we notice four recurring problems:
- The assistant retrieves an unrelated document.
- It retrieves the correct document but draws an unsupported conclusion.
- It gives the right answer but cites the wrong evidence.
- It doesn’t acknowledge when the evidence is insufficient.
These are four different failures. Trying to capture all of them with a single “answer quality: 4/5” score isn’t particularly useful. Instead, we can turn each failure into a focused test.
We should also keep some randomly sampled interactions in our review. Otherwise, we’ll get very good at finding problems we already know about while missing new ones.
Under the hood
In practice, read each trace and write a short note about the first thing that went wrong, in your own words. After a few dozen traces, group similar notes into categories and count them. The counts tell you which failure to fix first. You can stop when new traces mostly repeat categories you’ve already seen.
Turn what we discovered into tests
Now we build an evaluation dataset from representative, carefully reviewed examples. For the invoice problem, that means paid, unpaid, partially paid, and missing-payment-evidence scenarios. Some examples can come from real, anonymized interactions. Others can be synthetic cases designed to test specific edge conditions.
Then define clear success criteria. For example:
Does the cited evidence actually support the payment conclusion? Pass or fail.
Does the assistant acknowledge when payment cannot be verified? Pass or fail.
Notice that we don’t need an LLM to check everything. Code can verify whether a citation points to an existing document or whether a tool call succeeded. But deciding whether a passage genuinely supports a conclusion may require expert review or an LLM-as-a-judge.
And here’s another problem: the judge can be wrong too. Before trusting an automated judge, compare its decisions against examples reviewed by knowledgeable humans. Investigate disagreements, refine the criteria, and test the judge on examples it hasn’t seen during development. Otherwise, we risk building a system that confidently grades incorrect answers as correct.
Under the hood
Pass/fail labels beat 1–5 scores here. People agree on them more often, and they’re easier to check a judge against. When you compare the judge with expert labels, track two numbers separately: how often it catches real failures, and how often it correctly passes good answers. A single agreement percentage can hide a judge that passes almost everything, since most answers are usually good. Keep some labeled examples aside to test the final version of the judge.
The real value comes after measuring
Once we know which failures matter, we can improve the application. Maybe the retrieval system needs access to payment receipts. Maybe the prompt needs clearer instructions about distinguishing invoices from proof of payment. Or maybe the assistant should simply say:
“The documents show the invoice was issued, but I can’t confirm that payment was made.”
That might be the most accurate answer.
After making a change, rerun the evaluation dataset. Did unsupported payment conclusions decrease? Did the change introduce new problems? What happened to latency and cost? Say unsupported payment claims drop from about 1 in 5 cases to 1 in 20 after receipts are added to retrieval, while latency barely moves. That’s an improvement you can defend with evidence, not a feeling.
Keep an untouched test set for independent checks, and continue reviewing production interactions, because real users will always introduce scenarios we didn’t anticipate.

Under the hood
Rerun the eval set automatically whenever the prompt, model, or retrieval settings change, the way unit tests run on every code change. Track latency and cost next to pass rates, since a fix that doubles response time may not be worth it. Save the untouched test set for changes you plan to ship, not for every experiment.
And that, to me, is the interesting part of AI evals. We’re not just measuring how intelligent a model appears. We’re learning how an entire AI product fails, finding the reasons behind those failures, and building evidence that our changes actually improve it.
A convincing answer isn’t necessarily a correct one. And a good evaluation should help us understand the difference.