Lab 01 — Evaluation Harness
Phase: 09 — Model Accuracy Evaluation | Difficulty: ⭐⭐⭐⭐☆ | Time: 3–4 hours
A production eval harness runs benchmarks, collects metrics, detects regressions, and generates reports suitable for CI/CD pipelines.
What you build
BenchmarkTask— wraps a dataset + metric functionEvalHarness— runs multiple tasks, aggregates per-task and overall scores- Integration with
lm_evalformat (few-shot benchmarks: MMLU, HellaSwag, ARC) - Regression detection: compare against baseline with configurable delta threshold
- JSON report generation for CI artifacts
Key concepts
| Concept | What to understand |
|---|---|
| lm-evaluation-harness | Open-source framework for standardized LLM benchmarks |
| Few-shot prompting | Evaluate with N in-context examples — tests generalization |
| Accuracy vs F1 | MMLU uses accuracy; NER/QA use F1; generation uses ROUGE/BLEU |
| CI integration | Eval must be reproducible and deterministic for regression detection |
Files
| File | Purpose |
|---|---|
lab.py | Stubs with TODO markers |
solution.py | Complete working implementation |
test_lab.py | pytest suite |
requirements.txt | Dependencies |
Run
pip install -r requirements.txt
python lab.py
pytest test_lab.py -v