Report
LLM Evaluation Pipeline
LLM-as-Judge · Anthropic API · Python
Overview
Built an automated evaluation pipeline that uses Claude as a judge to score the reasoning quality of KYC compliance verdicts. The pipeline runs 5 representative test cases through the KYC system, generates verdicts, then scores each verdict on four dimensions using a second Claude instance as judge.
The Problem
Free-text compliance reasoning cannot be evaluated with traditional metrics like precision and recall. BLEU, ROUGE, and BERTScore measure word overlap, not whether the reasoning is factually correct, properly grounded in regulations, or actionable for a compliance officer. A different evaluation approach was needed.
The Approach
LLM-as-judge: a second LLM evaluates the first LLM's output against a rubric. The judge scores each verdict on four dimensions from 1-5:
Regulatory Accuracy
Does it correctly apply the regulation?
Source Grounding
Is every claim traceable to retrieved context?
Appropriate Uncertainty
Does confidence match evidence?
Actionability
Can a compliance officer act on this?
The Results
$ eval-runner --judge claude-sonnet-4-6 --cases 5Regulatory Accuracy 4.8 / 5Source Grounding 4.4 / 5Appropriate Uncertainty 5.0 / 5Actionability 5.0 / 5Overall 4.8 / 5
Key Finding
Source grounding was the lowest-scoring dimension at 4.4/5. In TC-012 (expired driver's licence), the system correctly rejected the document but cited a CBN regulatory basis not fully present in the supplied context. The system elaborated beyond what its retrieved sources actually said.
This finding directly informed the Corridor AI Governance Policy: Guardrail 3 states "Every regulatory claim must come from retrieved source context." Evaluation-driven product development.
Critical Limitation
LLM-as-judge has two failure modes:
- 1. Self-serving bias — using the same model as generator and judge inflates scores. Fix: use a different model as judge.
- 2. Confident wrongness — if generator and judge share the same knowledge gaps, the judge won't catch errors the generator makes.
Human calibration is mandatory. Run 30-50 cases through both judge and human reviewer. Compare scores. Adjust rubric until judge scoring matches product priorities.
Tech Stack
Python, Anthropic API (claude-sonnet-4-6), python-dotenv, JSON output parsing with markdown fence stripping