Home / Blog / Generative AI & RAG

    How to Evaluate LLM Applications: Metrics, Test Sets and Human Review

    By Softworth Solutions · · 4 min read · For readers in US, UK, India

    Analytics charts and dashboards on a computer screen

    In short: To evaluate LLM applications, build a test set of real inputs with known good answers, pick a few metrics that reflect what users care about, and score every change automatically. Use human reviewers to calibrate those scores and catch what automation misses.

    Without evaluation, every prompt tweak or model upgrade is a guess. With it, you can swap a model in an afternoon and know whether things got better or worse. Here's how we set it up.

    Why is evaluating LLMs different from testing normal software?

    LLM outputs vary between runs, can be correct in many different wordings, and can sound fluent while being wrong. A small prompt change can fix one case and quietly break three others. Ten questions tried in a demo isn't evaluation; it's anecdote.

    How do you build an LLM test set?

    A test set is a collection of real inputs, each with a reference answer or clear criteria for a good one. Start with 50 to 100 cases and grow towards a few hundred.

    1. Pull real user questions or documents, anonymised where needed.
    2. Cover common cases in proportion to how often they occur.
    3. Add hard cases on purpose: ambiguous questions, long documents, odd formats.
    4. Include questions the system should refuse or answer with 'I don't know'.
    5. Have domain experts approve the reference answers, and tag each case by category.

    Keep the test set in version control with your code. It's the most valuable asset in the project.

    Which LLM evaluation metrics should you use?

    Use three to five metrics that match the task, plus cost and latency. Don't track twenty scores nobody reads.

    Matching evaluation metrics to the type of LLM application
    Application typeCore metricsHow to score
    Extraction and classificationField-level accuracy, precision, recallExact comparison with labels
    Question answering over documents (RAG)Retrieval hit rate, correctness, groundingLabelled sources plus rubric judge
    Drafting and summariesCoverage, format, tone, unsupported claimsRubric judge calibrated by humans
    Conversational assistantsTask completion, clarifying questions, escalationScenario scripts and review

    For RAG, measure retrieval and generation separately. Grounding, whether each claim is supported by retrieved text, is the metric that catches hallucinations. Our guide to chunking strategies for RAG explains why retrieval problems often hide behind 'bad answers'.

    Rows of servers and cabling in a data centre

    Can you use an LLM as a judge?

    Yes, if the rubric is specific. 'Rate this from 1 to 10' gives noisy scores. 'Does the answer state the correct notice period? Does it make any claim not in the context?' gives useful ones. Prefer yes/no judgements, give the judge the reference and source context, and ask for a short reason before the verdict.

    Then check the judge against human reviewers on 30 to 50 cases. Where they agree, rely on it for regression checks. Where they don't, fix the rubric or keep that criterion with people.

    An illustrative example

    Consider a legal tech startup in Austin building a contract Q&A tool. The team wants to switch to a cheaper model and the demo looks fine. Their 180-case test set tells a different story: overall correctness holds, but grounding drops on indemnity clauses and the model stops saying 'not found' when a clause is missing. They keep the cheaper model for simple lookups, route clause-level questions to the stronger one, and add the failures as new test cases.

    Where does human review fit, and what standards help?

    People are expensive, so use them where they matter most: writing reference answers, calibrating judges, and reviewing a few dozen production conversations a week. Every real failure they find becomes a new test case. Risk frameworks can also help you decide how much testing a use case needs.

    Key facts

    • NIST's AI Risk Management Framework, released in January 2023, treats measurement and testing of AI systems as a core function alongside governance and risk management. (NIST)
    • The OWASP Top 10 for Large Language Model Applications lists prompt injection as its first risk, making adversarial inputs a sensible part of any test set. (OWASP GenAI Security Project)
    • ISO/IEC 42001, published in December 2023, is the first international management system standard for artificial intelligence. (ISO)

    Wire evaluation into your build pipeline so it runs on every prompt, model or retrieval change, and compare against production by category. A first harness usually takes one to three weeks, mostly spent agreeing the test set. If you're a US or UK team working with an Indian partner, make the test set the shared definition of done. Softworth Solutions (SWS AI) builds evaluation into its LLMOps work as standard.

    Key takeaways

    • Build your test set from real inputs, approved by domain experts.
    • Measure retrieval and generation separately in RAG systems.
    • Calibrate any LLM judge against humans before trusting it.
    • Turn every production failure into a new test case.

    Frequently asked questions

    How many test cases do we need?

    Start with 50 to 100 well-chosen real cases, enough to catch obvious regressions. Grow towards a few hundred as you learn where the system fails. Realism matters more than raw count.

    Can we rely only on LLM-as-judge scoring?

    For routine regression checks, often yes, once you've confirmed it agrees with human reviewers. For high-stakes domains or subtle criteria like legal accuracy, keep people in the loop.

    What's the most important metric for a RAG application?

    Usually grounding, since it catches hallucinations, paired with retrieval quality. A grounded answer built on the wrong passage is still wrong.

    Do UK regulators expect testing of AI systems that use personal data?

    The ICO's guidance on AI and data protection expects organisations to assess accuracy and risks, often through a data protection impact assessment. A documented evaluation process helps show that. Take legal advice for your specific use case.


    Planning an AI or software project? Talk to our team for a free consultation and an honest estimate.

    Previous: AI Document Processing: Automating Invoices, Forms and Contracts
    Next: FastAPI vs Node.js for AI Backends

    Keep reading