Production Evals, LLM-as-a-Judge & OpenTelemetry Observability
ML Training, Evals, Inference & Safety • Staff Requirement12 min read

Production Evals, LLM-as-a-Judge & OpenTelemetry Observability

Building golden datasets, mitigating judge biases, Ragas metrics, trajectory evals, and CI/CD regression gates.

Core Conceptual Brief

Every Big Tech AI interview tests Evals first: turning messy user failures into stratified golden test suites, pairing deterministic assertions with calibrated LLM judges, and tracing span-level P95 latency & cost.

Theoretical & Empirical Architecture

Vibe-checking 5 prompts locally does not scale in production—changing one sentence to fix hallucination A silently breaks extraction format B. Mature AI teams treat Evals like unit & integration tests that gate every pull request before deployment.

Production evaluation operates at three levels: (1) Deterministic Assertions (valid JSON schema, regex PII leak checks, exact SQL execution match), (2) Reference & RAG Metrics (Faithfulness, Answer Relevance, Context Precision), and (3) Trajectory Evals checking whether multi-step agents chose minimal valid tool sequences without wasted loops.

Under the Hood: Key Engineering Mechanics

1Calibrating LLM-as-a-Judge (Preventing Subtle Biases)

Raw LLM judges exhibit position bias (preferring candidate A over B), verbosity bias (rewarding longer fluff), and self-enhancement bias (preferring outputs from the same model family). Mitigate with pairwise position swapping, explicit integer rubrics (1-5 criteria), Chain-of-Thought judge reasoning before score emission, and periodic Spearman correlation checks against human expert labels.

2OpenTelemetry Traces + Cost/Latency Attribution

Instrument every span (retrieval, rerank, prompt render, LLM call, tool execution) using OpenTelemetry conventions exported to Langfuse, Arize Phoenix, or Datadog LLM Obs. Track P95 TTFT, token cost per resolved ticket, and cache hit rate per tenant.

3CI Eval Gates & Production Error Analysis

Start every eval flywheel with manual error analysis: inspect 50-100 failed production traces, tag root causes (bad chunking vs wrong tool args vs hallucination), convert real failures into golden regression cases, and block PR merges if composite eval scores drop >2%.

Position-Debiased Pairwise LLM Judge Harness

def run_debiased_pairwise_judge(judge_fn, prompt: str, ans_a: str, ans_b: str) -> str:
    """Swap A/B presentation order to eliminate positional bias in LLM judges."""
    forward = judge_fn(prompt=prompt, candidate_1=ans_a, candidate_2=ans_b)   # returns "1" | "2" | "tie"
    reversed_run = judge_fn(prompt=prompt, candidate_1=ans_b, candidate_2=ans_a)

    if forward == "1" and reversed_run == "2":
        return "A"
    if forward == "2" and reversed_run == "1":
        return "B"
    return "TIE"  # Inconsistent judge preference triggers human review or tie

Production Guardrails & Takeaways

  • Run deterministic schema/safety checks before paying for LLM-as-a-Judge grading.
  • Always swap candidate order in pairwise evals and calibrate judges against human labels.
  • Evaluate both final answers AND intermediate agent tool trajectories in CI/CD.

Real Staff AI Systems Interview Question

Q: How would you design an evaluation pipeline for an enterprise RAG assistant with 50k daily queries?

Staff Answer:

Combine offline CI golden datasets (300+ curated edge-case + multi-hop questions checked for Recall@k, Ragas Faithfulness, and schema validity on every PR) with asynchronous online sampling (score 2-5% of live traffic with calibrated rubric judges + track thumbs-down escalations) over OpenTelemetry spans.

Production Evals, LLM-as-a-Judge & OpenTelemetry Observability | AI Systems Engineering Guide · DataArena