IT Vizag
← How LLMs Really Work

▶ Sign up free for the video, slides & prompts

The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.

Checking…

How LLMs Really Work · Lesson 11 of 15 · 2 min read · 5 min video

Evaluating LLM apps

Test sets, automatic checks and LLM-as-judge, so you know a change made things better.

📄 Download slides (PDF)· free sign-up

"It looked good when I tried it" is not a test. LLM apps change whenever you edit a prompt, switch models or update documents, and quality can silently drop. Evaluation is how you know.

Start with a test set

Collect 30 to 100 real examples of what users will ask, with what a good answer must contain:

  • Common questions and important edge cases
  • Questions that should be refused or answered with "I don't know"
  • Tricky phrasing, Indian-English and mixed Telugu-English inputs if your users write that way

Add every real failure you find in production. The set grows into your most valuable asset.

Three kinds of checks

1. Code checks (cheap, exact)

  • Is the output valid JSON? Does it have the required fields?
  • Is the category one of the allowed ones?
  • Does the answer include a citation? Is it under the length limit?

2. Reference checks

  • For classification and extraction: compare with the correct label (accuracy)
  • For RAG: was the right chunk retrieved in the top 5? (retrieval recall)

3. LLM-as-judge (for open-ended answers)

Use a strong model with a clear rubric to grade answers:

🔒 Ready-to-copy prompt: sign up free (above) to unlock it.

Check the judge against your own grading on 20 or so examples before trusting it.

What to measure for RAG

  • Retrieval: is the right chunk found?
  • Faithfulness: does the answer stick to the retrieved context?
  • Answer quality: is it correct, complete and useful?

If faithfulness is high but answers are wrong, fix retrieval. If retrieval is right but answers are wrong, fix the prompt or model.

Make it a habit

  • Run the test set before every change: prompt, model, chunking, settings
  • Track the scores over time in a simple sheet or dashboard
  • Look at the actual failing answers, not just the averages
  • Keep a small set of examples people review by hand each week
Tip: Evaluation also saves money. With a test set, you can try a smaller, cheaper model and know straight away whether quality holds.

In one line

Build a test set from real questions, check it with code, references and an LLM judge, and run it before every change so improvements are measured, not guessed.

Saved on this device. Sign in to keep progress everywhere.

Share with a friend