Ivaan Information Technology
How to Test and Evaluate LLM Applications
← Back to Blog
Tech Insights

How to Test and Evaluate LLM Applications

✍By Khushal Chugh
🗓Dec 3, 2026
⏱4 min read

Traditional software either passes a test or fails. AI features sit in between: an answer can be mostly right, correct but badly worded or confidently wrong. Teams that skip evaluation ship something that looks fine in a demo and slowly disappoints real users. Evaluation does not need heavy tooling. It needs a test set, a scoring method and a habit of running both before every change.

Why normal tests are not enough

The same input can produce slightly different outputs, so you cannot assert one exact string. Quality also has several dimensions: is it correct, grounded in your sources, polite, in the right language and in the right format? You need to decide what "good" means for your use case and measure it directly.

Step 1: build a golden set

  1. Collect 50 to 200 real inputs from support chats, emails or logs, with personal details removed.
  2. Write the ideal answer or the key facts a correct answer must contain.
  3. Cover the easy cases, the common cases and the hard ones: typos, mixed languages, vague questions and out-of-scope requests.
  4. Keep it in version control and grow it every time production shows a new failure.

Step 2: choose how to score

  • Exact checks: for structured output, verify the JSON validates, the category is correct and required fields exist. This is fast and objective.
  • Rule checks: answer contains the refund window, does not contain a banned promise, stays under a length.
  • Model-graded checks: a second model scores the answer against a rubric, such as "is every claim supported by the provided context?" Useful and cheap, but calibrate it against human scores first, because graders have biases too.
  • Human review: sample a few dozen answers every release. Nothing replaces someone who knows your business reading the output.

Step 3: measure retrieval separately

If your app uses retrieval, check the search step on its own: did the right document appear among the top results? Many wrong answers are retrieval failures, not model failures. Fixing chunking or adding keyword search often helps more than rewriting the prompt. See what RAG is and how to build it for the pipeline.

Step 4: run it on every change

Treat prompts, model versions, chunk settings and tools as code. Run the golden set in your CI pipeline or with a single command before merging, and compare the score with the previous version. Set a rule such as "no merge if accuracy drops by more than two points or any safety case fails". This is the AI version of the habits in Automating Deployments with CI/CD.

Step 5: watch production

  • Log inputs, outputs, model and prompt version, latency and cost, with sensitive data protected.
  • Add a thumbs up or down and a "talk to a person" signal, and review the negatives weekly.
  • Track the rate of "I do not know" answers and human handovers. A sudden rise or fall means something changed.
  • Set alerts for error rate, slow responses and cost spikes, as described in monitoring and alerting for small teams.

Test safety on purpose

Add adversarial cases: attempts to override the instructions, requests for other customers' data, abusive messages and topics the bot must refuse. Check that the right action happens every time, and keep permission checks in code instead of trusting the model to refuse.

Common mistakes

  • Judging quality by trying five prompts by hand.
  • Using only clean examples, with no messy real messages.
  • Letting the same model both generate and grade without checking it against humans.
  • Changing the model version without rerunning the set.

What we check in our own assistants

For a WhatsApp assistant such as our WhatsApp to Excel automation, the golden set holds real, messy messages: shorthand, Hinglish, voice-note transcripts and photos of handwritten orders. Each is scored on whether the extracted fields are correct and whether unclear ones are flagged for a person instead of guessed. For business software such as the Lena Dena platform, any AI-drafted entry, for example an invoice line or a payment reminder, is checked for correct numbers and tax handling and requires a human to confirm before it is saved. The rule is simple: the more money a step touches, the stricter the test and the closer the review.

A weekly routine that takes an hour

  1. Run the golden set and record the score.
  2. Read 20 random production answers and 20 flagged ones.
  3. Add every new failure to the set with the correct answer.
  4. Fix the cause: the source document, the retrieval settings or the prompt.
  5. Rerun the set and confirm the fix did not break anything else.

Small, regular reviews catch drift early and build the team's sense of what good looks like.

We help teams add AI features with the testing that keeps them dependable. See our services or contact us.

Explore Our Services

Need help putting this into practice? See our web, mobile and AI development services, browse projects we have delivered, read the FAQs, or contact our team.