HomeRoadmapsCloud AI Eval Day 2
Cloud AI Evaluation & Azure AI Foundry QE Β· Day 2 Β· 25 min

Automated Eval Harness & Judge Calibration
Cloud AI Evaluation & Azure AI Foundry QE β€” Day 2

Score groundedness, relevance, and coherence with deterministic rubrics, calibrate judge-vs-human agreement using Cohen’s kappa, and detect position and verbosity bias.

⚑ Runtime: Python 3.10+ Β· Offline Azure AI Foundry Simulators (unittest)πŸ›‘οΈ Cloud AI Evaluation & Foundry QE Architect
Azure AI EvaluationPromptfooDeepEvalCohens KappaJudge Bias
About this lab

An uncalibrated LLM-as-a-Judge can rubber-stamp hallucinated policy guidance or systematically favor longer, padded answers. Today you will run rubric scoring for groundedness, relevance, and coherence, compute Cohen's kappa against human SME labels, and run automated A/B swap tests for position and verbosity bias.

πŸ“¦Sample Codebase & Working Solution (Day 2)Available Now
View on GitHub

The official reference codebase for Day 2 is hosted in the repository. Clone the repository and navigate to day-2-eval-harness-judge/test_eval_harness.py to run the working solution.

Git Clone β€” Working Solution
git clone https://github.com/777abhi/cloud-ai-eval-roadmap.git
cd cloud-ai-eval-roadmap/day-2-eval-harness-judge/test_eval_harness.py
🏭Production Context & Enterprise Implementation
πŸ’‘ Why We Are Doing This: Without inter-rater calibration and bias audits, automated evaluation scores drift away from compliance reviewers and create false confidence in CI.
🏒 Real-World Production Usecase: Validating Azure AI Evaluation, Promptfoo, or DeepEval judge prompts before trusting them as automated PR gates.
βš™οΈ How Implemented in Production: DeterministicJudge scores 1-5 rubrics; cohens_kappa verifies >= 0.70 human agreement; detect_position_bias and detect_verbosity_bias flag asymmetric or filler-favoring judges.
Phase 1

Run Judge Calibration & Bias Detection Suite

Step 1.1: Execute Day 2 Tests
Terminal β€” Day 2 Lab
npm run test:day2
Step 1.2: Calibration & Bias Audit Helpers
cloudaieval/evaluator.py
kappa = cohens_kappa(judge_labels, human_labels)
pos_audit = detect_position_bias(pairs, judge.compare_pair)
verb_audit = detect_verbosity_bias(concise_vs_verbose, judge.compare_pair)
Day 2 Key Learnings
  • Evaluated groundedness, relevance, and coherence on 1-5 rubrics to catch hallucinated claims.
  • Measured judge-vs-human inter-rater reliability with Cohen’s kappa (>= 0.70 SLO).
  • Detected position flip bias via (A, B) vs (B, A) swaps and verbosity bias on padded answers.

🧠 Knowledge Check

How does swapping candidate order from (A, B) to (B, A) expose position bias in a Model-as-Judge evaluator?