Design a Hybrid Model Evaluation System with Human Review
Machine LearningModel answerLast updated
Design a scalable evaluation platform that combines automated metrics, LLM-based judging, and human expert review to assess ML model outputs with full provenance tracking.
Design a Hybrid Model Evaluation System
Your team builds and ships ML models that must be rigorously validated before deployment. Spot-checking outputs by hand does not scale, but fully automated metrics miss subtle or safety-critical failures. You need a system that combines both.
Design a hybrid evaluation platform that grades model outputs using a layered approach: fast automated metrics first, an LLM-based judge for nuanced cases, and human expert review as the final arbiter for high-stakes or uncertain results.
Context
You are evaluating a perception and planning model. Each scenario is a short log segment (roughly 10–30 seconds) containing the model's predictions (e.g., object tracks, planned trajectory) alongside ground-truth labels. Scenarios are organized into versioned scenario sets for reproducibility.
Requirements
Functional
- Batch orchestration: Accept an evaluation job specifying a model version, a scenario set, and an evaluator suite, then process all scenarios through the full grading pipeline.
- Multi-tier grading: Automated metrics run first. An LLM judge handles cases that need contextual reasoning. Outputs that are uncertain, contradictory, or safety-critical are escalated to human raters.
- Versioned evaluation store: Track every prompt, metric implementation, and grading decision so that a regression from one model version to the next can be traced to a specific evaluator change.
Non-functional
- Throughput: Handle thousands of scenarios per hour at peak load.
- Rater quality control: Detect and correct for bias or inconsistency among human evaluators.
- Extensibility: Adding a new metric or judge should not require changes to the core orchestration logic.
Your Task
Provide a high-level architecture covering these four areas:
- Data model — How do you store evaluation results, ground truth, and the full provenance of every score (who or what assigned it, under which version of the grading logic)?
- System architecture — How do results flow from automated workers through the LLM judge to the human review queue? How is escalation decided, and how is the human workload budgeted?
- Quality control — How do you measure and maintain consistency between human raters, and how do you validate that the LLM judge agrees with human consensus?
- API/interface — What endpoints does a researcher need to submit a job, monitor progress, and query results with regression comparisons?
Discuss trade-offs where relevant: throughput vs. label quality, coverage vs. redundancy, and how you would phase the system for an early-stage team vs. one operating at scale.
Hints
Hint 1
Start by pinning down scale: how many scenarios per hour, what fraction gets escalated to humans, and how long human review takes. That math tells you where the real bottleneck is and what the human staffing requirement looks like.
Hint 2
Separate 'judgments' (raw scores from a specific evaluator at a point in time) from 'final grades' (derived aggregates). Keeping judgments append-only gives you full provenance and lets you retroactively re-score when a judge or metric changes.
Hint 3
Think about your escalation policy as a versioned config, not hardcoded logic. Escalation triggers — LLM confidence below a threshold, conflicting scores, a safety-critical metric firing, out-of-distribution scenarios — should be tunable without touching the orchestration code.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
1. Clarify Scale and Constraints
Before sketching any architecture, anchor the design in real numbers. Interviewers want to see you find the bottleneck before proposing infrastructure.
Assume 5,000 scenarios/hour at peak. Automated metrics (say, 50 per scenario) run in milliseconds to low seconds on CPU workers — no problem. An LLM judge with 3 self-consistency samples at ~3 s each costs roughly 12–15 GPU-hours per wall-clock hour, manageable with ~15–20 parallel workers.
Humans are the bottleneck. A 5% escalation rate yields 250 tasks/hour. At ~4 minutes per task with dual labeling on safety-critical items, that implies roughly 15–20 active raters during peak. This means escalation must be prioritized and budgeted, not open-ended. Establish this constraint early — it shapes every downstream decision.
Key clarifications to surface:
- Is evaluation offline only, or does it gate real-time deployments? (Assume offline, but results gate releases.)
- What latency is acceptable? Automated results in ~1 hour; human-finalized results in ~24 hours.
- Must every scenario get human review, or only escalated ones? (Escalated only, plus a random audit sample.)
2. API Design
POST /v1/eval-jobs
{ model_version_id, scenario_set: "set_id@version",
evaluator_suite: "suite_id@version",
escalation_policy: "policy_id@version",
human_budget: 500, priority: "high" }
-> { job_id }
GET /v1/eval-jobs/{job_id}
# returns stage-level status: % auto-graded, % pending human, % finalized
GET /v1/results?job_id=&metric=&slice=
# scores with full provenance: evaluator_id, version, confidence
POST /v1/compare
{ baseline_job_id, candidate_job_id, slices: ["maneuver_type=left_turn"] }
-> per-metric deltas with bootstrap CIs, regressions flagged
POST /v1/metrics # register a new metric plugin (name, version, container image)
POST /v1/judge-configs # register a new LLM judge (model, prompt hash, rubric, params)
GET /v1/tasks/next?rater_id= # leased task, skill-routed
POST /v1/tasks/{id}/submit # score, rationale, time spent
The compare endpoint matters a lot in practice — researchers need regression detection across model versions, not just raw scores.
3. Data Model
Use a relational database (Postgres or Spanner). A graph database is unnecessary; recursive CTEs handle lineage queries, and relational gives you transactions plus easy analytics export.
| Table | Key fields |
|---|---|
scenario | id, log_uri, tags (maneuver, weather), embedding |
scenario_set | id, version, immutable scenario_id list |
ground_truth | scenario_id, label_version, source, uri |
model_version | id, weights_hash, git_sha |
evaluator | id, type ∈ {metric, llm, human}, version, config (code_sha / prompt_hash / rater_id) |
eval_job | id, model_version_id, scenario_set@version, suite@version, policy@version |
judgment | job_id, scenario_id, evaluator_id, score, confidence, rationale, inputs_hash, created_at |
final_grade | job_id, scenario_id, metric_id, value, resolution_policy@version, contributing_judgment_ids |
Two principles that matter most:
- Judgments are append-only. The
evaluator_idforeign key fully identifies what produced a score — which code version, which prompt, which person. You never edit a judgment; you issue a new one. - Final grades are derived, never directly edited. They record which judgments and which aggregation policy produced them. This makes re-scoring on a new judge trivial and auditable.
Cache key: (model_output_hash, scenario_id, evaluator_id) — also the idempotency key. Replaying an unchanged evaluator reuses stored results at zero cost.
4. System Architecture
Researcher -> API -> Job Orchestrator (Temporal or Airflow)
| shards scenario_set into work items
v
[Queue: eval.metric] -> Metric Workers (plugin container DAG) -> judgments
v
[Queue: eval.llm] -> LLM Judge Workers (k samples) -> judgments
v
Escalation Router (policy@version)
|--- auto-finalize ---> Aggregator -> final_grade
|--- escalate --------> Human Task Service
| priority queue, leases, skill routing
v
Rater UI -> judgment -> Aggregator -> final_grade
Queueing: Workers are stateless and autoscale on queue lag. Delivery is at-least-once with idempotent upserts on the cache key. Failed items go to a dead-letter queue after N retries.
Extensibility: Metrics are plugins that implement a single interface:
def compute(scenario, model_outputs, ground_truth) -> Judgment: ...
Each plugin declares its version and input dependencies. The orchestrator builds a DAG from those declarations. Adding a new metric means registering a container image — the core workflow is untouched.
Escalation policy (versioned config, not hardcoded): escalate when:
- A safety-critical metric fires (e.g., predicted collision, red-light violation)
- LLM confidence falls below a threshold, or k samples disagree
- The automated metric score and LLM verdict contradict each other
- The scenario is out-of-distribution (embedding distance from labeled pool exceeds a threshold)
- A 1–2% uniform random audit sample (keeps auto-accept error rates measurable)
When the human queue exceeds human_budget, the router keeps only the highest-priority items; the rest finalize as "auto-graded, unreviewed" with that flag surfaced in results.
5. Quality Control
Golden set injection: ~5% of each rater's queue is blind golden items with pre-established expert-consensus labels. Track per-rater accuracy on these with a control chart. Raters who drop below threshold are auto-paused and flagged for recalibration.
Inter-rater reliability: Report Cohen's κ for rater pairs and Krippendorff's α across all raters, per scenario slice. Aggregate redundant labels with Dawid-Skene, which estimates each rater's confusion matrix and down-weights systematic biases (e.g., a rater who consistently rates one severity level harsher) rather than discarding them.
Validating the LLM judge: Maintain a held-out human-consensus set, stratified by scenario type. For each judge version, report:
- Agreement and κ vs. human consensus, per slice
- Expected calibration error of confidence scores
- False-negative rate on safety-critical items (the metric that matters most)
A judge version is promoted only when it meets all thresholds on every slice — not just on average. Averaging can hide catastrophic failure on rare but critical scenario types. The ongoing random audit continuously re-estimates the production error rate of auto-accepted items.
6. Trade-offs
| Tension | Choice |
|---|---|
| Label quality vs. coverage | Triple-label safety-critical items; single-label others. Increases quality where it counts without blowing the rater budget. |
| LLM speed vs. reliability | k-sample self-consistency adds GPU cost but is far cheaper than routing everything to humans. |
| Automation vs. transparency | Auto-accepted results are fast but carry an unreviewed flag. Downstream consumers can filter by provenance. |
| Early-stage vs. scale | Start with a simple priority queue and manual escalation rules. Invest in Dawid-Skene calibration and embedding-based OOD detection once you have enough rater history to make them reliable. |
Common mistakes to avoid:
- Treating final grades as editable records — this breaks provenance.
- Using a single aggregate accuracy number to promote a judge — always disaggregate by slice.
- Letting the human queue grow without a budget cap — escalation must be a bounded resource, not a catch-all.
- Versioning prompts but not the rubric or few-shot examples — both affect LLM judge behavior and must be part of the evaluator identity.