Sub topic 1
Why an LLM App Needs Its Own Evaluation Dataset
Prerequisites
Assume you know basic Python, JSONL, prompts, and elementary statistics. You should also understand how your app calls an LLM and returns an output.
Why an LLM App Needs Its Own Evaluation Dataset
A general benchmark tests broad language abilities. It may not test your app’s policies, tools, prompt, output format, or users’ real questions. An evaluation dataset is a saved collection of representative test cases. It lets you compare app versions against the same evidence.
Without one, “the new prompt seems better” is difficult to verify. A change may improve common questions while breaking refunds, unusual inputs, or safety behavior. A useful dataset makes these failures visible and repeatable.
Define the Task and What Counts as Success
Start with one task, such as answering return-policy questions. State the input, expected output behavior, and unacceptable behavior. For example, a successful answer must give the correct policy, avoid invented exceptions, and remain understandable.
Turn these requirements into checks at the case level. Exact matching works for stable structured outputs. A rubric or human review is better when several phrasings can be correct. Record separate criteria when correctness, safety, citations, and format matter independently.
Design the Test Case Schema
Use a stable schema so cases can be loaded, filtered, and graded consistently.
| Field | Purpose |
|---|---|
| `id` | Unique identifier for tracking |
| `input` | User message or app input |
| `reference` | Expected answer or key facts |
| `tags` | Slices such as `returns` or `adversarial` |
| `source` | Production log, expert, or synthetic |
| `difficulty` | Case complexity |
For example:
{"id":"refund-001","input":"Can I return a laptop after 45 days?","reference":"No. Returns are accepted within 30 days of delivery.","tags":["returns","policy"],"source":"production_log","difficulty":"easy"}Where Cases Come From
Use production logs for realistic language, after removing personal and confidential data. Ask domain experts to write edge cases and define correct answers. Generate synthetic cases to fill gaps, vary wording, or create adversarial inputs, but review them before adding them. Tag every case by behavior so later results show which part of the task improved or regressed.
Exercise
Why should a dataset include tags as well as inputs and references?
Show answer
Tags create measurable slices, so you can find regressions in areas such as policy questions, difficult inputs, or safety cases instead of seeing only one overall score.