Your AI assistant can be fast, online and wrong, all at once. Your normal dashboard will not show it. Catching those wrong answers is the job of LLM evaluation. It is not one clever tool. It is a few plain checks, stacked in layers.
A successful response can still be a wrong answer
Towards AI tells the story of Arnav, who launched his company's first AI assistant. Before going live, he quizzed it with 200 questions he had picked by hand. It got 92% right. Replies came back quickly, and no errors showed up.
Two weeks on, a large client got in touch. The bot had been giving them the wrong policy answers for about a week. Yet his dashboard marked every call a success (an HTTP 200 code). The server was fine. The answers were not.
That is the core problem. Server checks tell you the app is up. They can't tell you if the answer is true. When a model makes things up, it is called a hallucination. JMLR authors call it a significant challenge for the safety and trust of apps built on these models.
LLM evaluation works like unit tests for AI answers
The first layer is a test pipeline for your AI. Programmers write small tests to prove their code still works (unit tests). An eval pipeline does the same for an AI feature. Towards AI shows how to build one on a laptop.
The easiest way to see it is to follow one test case.
Say your bot answers refund questions. Your test case is a question plus a note on what a good answer says. The question: "Can I get a refund after 45 days?" The note: the reply should say no, because your window is 30 days.
A short script, the runner, sends that question to the model. It saves the reply. Then a grader checks it. Here, a few lines of code can look for "30 days" and a clear no. Last, a report adds up all your cases. It shows this run's score next to the last one.
The refund case, from question to report:
%% title: One refund test case moving through the pipeline
flowchart TD
test["Refund question plus expected answer"] --> runner["Runner sends it"]
runner --> reply["Model writes a reply"]
reply --> grader{"Correct?"}
grader -->|yes| pass["Case marked pass"]
grader -->|no| fail["Case marked fail"]
pass --> report(["Report compares with last run"])
fail --> report
You run the same cases after every change. That repeat is the whole point. A public test that everyone uses (a benchmark) can't stand in for yours. The same model's score jumped almost 30 points just by changing how it was set up. Towards AI cites the ARC Prize leaderboard, where GPT-6.2 Astra went from 70.3% to 99.8%. Your own tasks are what count.
Start small, with real cases on your laptop
You don't need a big platform to begin. The Towards AI guide runs everything on one laptop. It uses Ollama and llama.cpp, tools that run models on your own computer. The runner talks to any server that uses the OpenAI chat format. So you can point it at a hosted model later.
Keep up with new ways to test AI
New tools for grading and checking AI answers appear every week. The TechImpacts feed reads hundreds of AI and tech publications each night, scores each story on nine criteria and keeps only those that clear the bar.
Running locally has a side benefit. Your test data stays on your machine. That matters when cases come from real customer messages.
The guide suggests 20 to 50 cases to start. The best ones come from past mistakes. Dig through bug reports, support emails and the checks your team now does by hand. A refund question your bot fumbled last month is a perfect case.
Let code grade first, and an AI judge second
Keep the first graders simple and cheap. Is the reply word for word what you expected? Does it include the right figure? Is it valid JSON, a common format for structured data? Code gives the same verdict every time. When code can't tell, a second AI model can step in as judge.
Run the tests again after every change
A change can be a new prompt, a new model or a new setting. With no tests, your users become your testers. Towards AI cites Anthropic on how this goes. Users say the bot got worse, and the team can only guess why. A fix in one place can quietly cause a bug in another.
Check whether a score change is real
A two-point gain may just be noise. Anthropic found that the test machine itself could sway results. Limits on its processing power and memory shifted one coding benchmark (Terminal-Bench 2.0) by about 6 points.
So give every score a margin of error. The simplest way is to run the whole set three to five times and note the spread. Also do the sum: with 50 cases, one flipped answer moves the score by two points. If the new score sits inside the old range, you haven't learned much.
Re-test before you switch models or providers
In my view, a model swap is among the riskiest changes a small team makes. Nothing else in the app moves, so it feels safe. Towards AI makes the point that a new model is just another change. A good test set shows fast where it improved.
Artificial Intelligence+ breaks a move between AI vendors into eight steps. The plan leans on three tools. In plain terms:
A test set: your cases, run on both the old and the new provider.
Shadow traffic: copies of real requests sent to the new provider, while users still get the old one's replies.
A rollback plan: a quick way back if quality drops.
Picture a founder moving her support bot to a cheaper provider. She runs her 50 cases on both. Then she mirrors a slice of live traffic for a few days and compares. Only then does she flip the switch, with the old setup ready to return. If your AI also takes actions, not just answers, read our guide on AI agents for product deployment.
Grade live answers overnight, not while users wait
Test sets have a blind spot. Arnav's 200 questions stopped being useful almost at once. Real people didn't write like his tidy file. They asked a question, then a vaguer one after it. They stuffed two asks into one message. They found corners of the product his file never covered.
So he began pulling real chats from cloud storage (Amazon S3) each day. He didn't want grading to slow live replies. So he moved it out of the user's path entirely. Once a day, a scheduled job picked a sample of the previous day's chats.
Arnav's setup, split into what users see and what happens overnight:
%% title: Live replies go out fast while grading runs overnight
flowchart TD
user["Live user asks"] --> agent["AI assistant"]
agent --> reply(["Fast reply"])
agent --> logs["Chat logs saved"]
logs --> sampler["Nightly sampler"]
sampler --> check{"Valid?"}
check -->|yes| queue["Queue for grading"]
check -->|no| reject(["Broken log set aside"])
queue --> grader(["Background grader"])
On night one, the job died partway through. One team had renamed a field in its chat logs. Arnav added a strict format check (a schema validator) right after loading. Chats in the wrong shape were set aside. The rest had to include an ID, the user's messages, the bot's replies and any documents or tools the bot used.
Rather than sending every chat to the grader at once, he dropped each one into a queue (Amazon SQS). One worker then took them in turn. That kept memory use steady. It also stayed under rate limits, the caps a service puts on how many requests you can send in a set time.
My advice: don't trust a single score here. Mix the grader types from earlier. Format checks catch broken output. Code checks catch wrong figures. An AI judge handles open-ended replies. Each catches failures the others miss.
A confidence score can flag a likely hallucination
Overnight grading finds mistakes after the fact. Sometimes you want a warning the moment a reply is written. That is the job of uncertainty scoring. It measures how unsure the model seems about its own answer.
UQLM, a Python package described in JMLR, does this. It offers several scorers. Each gives a reply a confidence score between 0 and 1. Its authors pitch it as a ready-made add-on for spotting hallucinations in an existing app.
Treat the score like a smoke alarm, not a verdict. A low score says "look here." A high score does not prove the reply is right. One sensible use is routing. Low-scoring replies go to a person, or the bot says it will check and come back.
New tools like this appear all the time. The TechImpacts feed reads hundreds of AI and tech publications each night to find them. It scores each story on nine criteria and keeps only those that clear the bar.
Sometimes the best answer is no answer
Confidence scores raise a harder question. When should the system just decline? Researchers call this selective prediction. You answer fewer questions (lower coverage) in exchange for getting more of them right.
An arXiv study on spotting sexism in text shows the trade clearly. The team built one reliability score from three signals. The first was how much human labellers agreed. The second was the model's own confidence. The third was how unsure it was word by word (token-level uncertainty). The blended score decided when the model held back.
Here is what they saw on gpt-4o when it answered only half the cases:
Setup on gpt-4o, half the cases answered
Accuracy
Blended score, real labeller agreement
96.2%
Blended score, agreement guessed from text
88.7%
Model confidence alone
87.9%
Holding back raised accuracy for every version they tried, on both datasets. But the picture was mixed for two smaller models anyone can download (3B open-weight models). On those, confidence alone sorted answers better than the blended score.
My reading: real labeller agreement is rarely on hand for a brand-new user question. The guessed version is closer to daily life, and its edge is small. Also, this is one narrow task. Don't expect the same numbers from your support bot. The lesson that travels is the trade itself.
A practical starting checklist
This order is my own pick from the sources, sized for a small team:
Collect 20 to 50 real cases from bugs, support emails and manual checks.
Write code graders first. Add an AI judge only where code can't decide.
Re-run before every change to prompts, models or settings. Repeat runs to get a margin of error.
Switch providers slowly. Test both, mirror traffic and keep a way back.
Sample live chats nightly, outside the user's path. Check the log format before grading.
Add confidence scores and send low scorers to a person.
Let the system decline where a wrong answer costs more than none. Track how often it does.