liveBook · Manning

Evaluation dataset

As explained in Building Reliable AI Systems

A collection of examples used to assess a model or system's behavior against defined criteria.

A chatbot can answer familiar questions well yet invent a plan detail or quietly degrade after a model update. An evaluation dataset makes those failures measurable: it pairs representative questions with vetted reference information or known-good response characteristics, then tests the system against them repeatedly. section 3.6.2 section 10.5.3

Build coverage around what users actually ask:

  • Include factual questions, comparisons, troubleshooting, billing and account requests, and hypotheticals. A telecom test might ask for a plan price, compare allowances, or ask what happens after a data limit. section 3.6.2
  • Attach current, authoritative answer sources to each query: product specifications, policies, troubleshooting guides, or FAQs. These establish the factual reference for judging a response. section 3.6.2
  • Include plausible-sounding hallucinations to challenge factual assessment. For ongoing quality checks, also record essential response elements and criteria such as length, required terms, and tone. section 3.6.2 section 10.5.3
GOLDEN_TESTS = [                                         #1
    {
        "question": "How do I reset my password?",
        "expected_elements": ["email link", "account settings", "24 hours"],
        "quality_criteria": {
            "max_length": 200,
            "must_include": ["reset", "password"],
            "tone": "helpful"
        }
    },
    {
        "question": "What's your refund policy?",
        "expected_elements": ["30 days", "original payment method"],
        "quality_criteria": {
            "max_length": 150,
            "must_include": ["refund", "policy"],
            "tone": "professional"
        }
    }
]

def run_quality_check(llm):                         #2
    results = []
    for test in GOLDEN_TESTS:
        response = llm.generate(test["question"])
        score = evaluate_response(response, test["quality_criteria"])
        results.append({"test": test["question"], "score": score})    
    return results

A Python golden-test listing stores questions, expected elements, and quality criteria together. Its test runner generates responses and passes them to an evaluator; the listing does not define that evaluator or require identical wording. section 10.5.3

Run the dataset regularly and before changing models or prompts. Track whether essential elements disappear or quality patterns shift, rather than expecting identical LLM outputs. For RAG changes, use robust datasets to compare configurations such as chunk sizes and embedding models. Include common and edge cases, compare results across demographic groups, and retain human review: aggregate or automated scores can miss important failures. section 10.5.3 section 3.6.7 section 11.6.6

How Building Reliable AI Systems covers it

How deep it goes
Details query coverage, vetted references, and Python golden-test criteria, while leaving the response evaluator's implementation unspecified.
Examples
Illustrates telecom plan and troubleshooting queries alongside password-reset and refund-policy golden tests.
What it assumes
Assumes a chatbot or RAG system with factual-accuracy metrics, then supplies criteria for assembling its evaluation cases.
What you can do after
Build it from scratch to test factual answers and monitor response-quality regressions across model or prompt changes.
How it connects
Connects RAG, hallucination detection, LLM-as-a-judge, automated testing, and fairness evaluation.

Also explained in

Compare how 27 books explain evaluation dataset →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Reliable AI Systems. The section links point to the parts of the book it draws on.