Evaluation Harness (Offline + Online)
Defines a structured process for offline and online evaluation of LLM prompts, models, and retrieval configs using golden, adversarial, and live datasets.
What this file does
Defines a structured process for offline and online evaluation of LLM prompts, models, and retrieval configs using golden, adversarial, and live datasets.
When to use it
- Comparing prompt versions or model families
- Setting up repeatable quality and cost benchmarks
- Adding guardrail tests for jailbreaks or PII leaks
- Preparing an A/B test plan for production deployment
Assumes this stack
Evaluation Harness (Offline + Online)
Why it matters
- Without a harness, you can't compare prompts, models, retrieval configs, or costs.
- A small golden set + adversarials gives you fast, repeatable decisions.
Core concepts
- Datasets:
- Golden set (10–100 cases): curated, labeled answers or rubrics.
- Adversarial set: edge cases, ambiguous inputs, tricky phrasing.
- Live set: sampled production traffic (for shadow eval).
- Scorers:
- Exact match / F1 for structured tasks.
- Rubric scoring for summarization (LLM‑as‑judge with bias controls).
- Groundedness/faithfulness for RAG (cite‑check).
- Arms to compare: prompt versions, retrieval params (k, chunking, rerank), model families, temperature, tool chains.
Diagram – harness workflow
flowchart LR
D[Datasets: golden + adversarial + live] --> P[Prompt/Config variants]
P --> R[Runner]
R --> S[Scorers]
S --> M[Metrics dashboard]
M --> T{Pick best?}
T -- Iterate --> P
T -- Ship --> X[Deploy + online A/B]
Playbook
-
Define the task and output format (JSON schema or rubric).
-
Build datasets: 50–100 golden examples is enough to start; add 10–20 adversarials.
-
Pick scorers:
- Structured: exact match/F1.
- Free‑text: rubric with 3–5 criteria (coverage, faithfulness, tone, brevity).
- RAG: groundedness score + citation accuracy.
-
Run experiments across arms; log quality, cost, latency for each.
-
Select a champion; lock a baseline; store configs (prompt, params, retrieval).
-
Online test: A/B or shadow mode; watch user success and cost.
-
Guardrail tests: jailbreaks, prompt injection, personally identifiable info leakage.
Example rubric (summarization)
| Criterion | 0 | 1 | 2 |
|---|---|---|---|
| Coverage | Misses key points | Captures most | Captures all essentials |
| Faithfulness | Hallucinations | Minor errors | Fully grounded |
| Brevity | Overlong | Slightly long | Concise (≤120 words) |
| Tone | Off | Mostly on | On‑brand |
Example YAML (experiment config)
task: "support_summary"
model: "gpt-4o-mini"
temperature: 0.3
retrieval:
top_k: 6
rerank: true
filters: ["date>2023-01-01"]
prompt_variant: "v3_system_role_rules"
scorers:
- exact_match
- rubric_faithfulness
- cost_latency
Anti‑patterns
- Using the same LLM to both answer and judge without bias mitigations.
- No frozen baseline—you can't detect regressions.
- Shipping with zero adversarial cases.
Checklist
- Golden + adversarial sets stored and versioned.
- Champion/baseline recorded with prompts + params.
- Cost/latency ceilings set and enforced.
- Online A/B plan + stop criteria.
- Guardrail tests in CI.
Metrics / Proof of value
- Quality delta vs baseline, cost per task, p‑values for online tests, regression rate.
Further reading
- Open evaluation harness repos and lessons from retrieval quality research.
What's inside
7 sections: why it matters, core concepts, diagram, playbook, example rubric, YAML config, anti-patterns, checklist, metrics, further reading.
Change this for your project
- Replace
"support_summary"with your own task name - Replace
"gpt-4o-mini"with your model ID - Replace
"v3_system_role_rules"with your prompt variant name - Replace
["date>2023-01-01"]with your own retrieval filter
Where it goes
Keep alongside your test suite. Used to define and score model evaluations.
Worth borrowing
- Separate golden, adversarial, and live datasets to cover different evaluation modes
- Use a rubric with explicit 0, 2 scoring per criterion for free-text tasks
- Lock a champion baseline before running experiments to detect regressions
Related Documents
IATA BCBP Standard Compliance
Documents which IATA BCBP fields and barcode formats a Swift library implements, including Version 8 gender code support.
Evaluating AI Agent Systems: Metrics, Benchmarks, and Quality Assurance (2024-2026)
Surveys 2024-2026 metrics, benchmarks, and monitoring tools for evaluating AI agent systems, with recommendations for a self-improving coding agent.
Voice AI Leaderboards, Benchmarks, and Evaluation Gaps (Jan 2025 -- Feb 2026)
Surveys 20+ voice AI benchmarks from Jan 2025, Feb 2026, identifies evaluation gaps, and provides leaderboard data for STT, TTS, and end-to-end voice agents.
LLM Evaluation — Deep Dive
Covers why LLM evaluation is hard, benchmark taxonomy, LLM-as-judge methodology, contamination, robustness, and designing an eval suite for a product.