Back to .md Directory

Topic: Evaluation & Benchmarking

Evaluation is widely considered the **hardest unsolved problem** in LLM engineering. Unlike traditional software where a unit test returns pass/fail, LLM outputs are probabilistic, open-ended, and context-dependent -- there is no single "correct" answer for most tasks. Yet every production decision depends on evaluation: which model to deploy, whether a prompt change improved quality, whether a RAG pipeline is hallucinating less after a reranker upgrade. By mid-2025, benchmark saturation (fronti

May 2, 2026
0 downloads
5 views
ai agent llm rag prompt eval safety
View source

Topic: Evaluation & Benchmarking

Why This Topic Matters Now

Evaluation is widely considered the hardest unsolved problem in LLM engineering. Unlike traditional software where a unit test returns pass/fail, LLM outputs are probabilistic, open-ended, and context-dependent -- there is no single "correct" answer for most tasks. Yet every production decision depends on evaluation: which model to deploy, whether a prompt change improved quality, whether a RAG pipeline is hallucinating less after a reranker upgrade. By mid-2025, benchmark saturation (frontier models scoring 90%+ on MMLU, 99% on GSM8K) exposed the gap between leaderboard rankings and real-world performance. At the same time, new paradigms -- agentic evaluation, LLM-as-judge, and automated CI/CD eval pipelines -- have matured into production-grade tooling. Any engineer shipping LLM applications must understand what to measure, how to measure it, and why every metric lies in a specific way.


1. WHAT (Conceptual Model)

Definition

Evaluation is the systematic measurement of an LLM system's quality across defined dimensions -- accuracy, safety, faithfulness, relevance, cost, and latency. Benchmarking is the standardized comparison of models or systems against shared test sets and metrics. Together, they form the feedback loop that drives every improvement in LLM engineering.

Core Components

  1. Benchmark Suites -- standardized test sets (MMLU, HumanEval, SWE-bench) that measure specific capabilities
  2. Metrics -- quantitative scoring functions (exact match, F1, BLEU/ROUGE, semantic similarity, perplexity)
  3. Evaluation Methods -- how scores are produced (automated deterministic, LLM-as-judge, human annotation)
  4. Eval Pipelines -- infrastructure that runs evaluations continuously (CI/CD integration, regression detection)
  5. Safety & Red Teaming -- adversarial testing for jailbreaks, bias, toxicity, and harmful outputs
  6. Online Evaluation -- production measurement via A/B testing, shadow deployments, and user feedback

System View

                        EVALUATION ECOSYSTEM
                        ====================

Offline Evaluation                          Online Evaluation
(pre-deployment)                            (post-deployment)
     |                                           |
     v                                           v
[Benchmark Suites]                    [A/B Testing Framework]
  MMLU, HumanEval,                      Shadow deployments,
  SWE-bench, MATH...                    canary rollouts
     |                                           |
     v                                           v
[Eval Methods]                         [User Feedback Loops]
  - Deterministic metrics                Thumbs up/down,
  - LLM-as-judge                         implicit signals,
  - Human annotation                     Elo/preference ranking
     |                                           |
     v                                           v
[CI/CD Eval Pipeline]                  [Production Monitoring]
  Regression gates,                      Drift detection,
  golden dataset tests,                  cost/latency tracking,
  quality thresholds                     safety alerts
     |                                           |
     +-----------> [Decision Engine] <-----------+
                    Deploy? Rollback?
                    Which model? Which prompt?

2. HOW (Mechanics)

2.1 Major Benchmarks -- What They Measure and Where They Break

Knowledge & Reasoning

BenchmarkWhat It MeasuresFormatStatus (2025-2026)
MMLU57-subject academic knowledge (STEM, humanities, social science)4-choice MCQ, 14K questionsSaturated. GPT-5.3 Codex scores 93%. MMLU-Pro adds harder questions with 10 choices. MMLU-CF strips contamination artifacts -- top models drop 14-16 points
ARC (AI2 Reasoning Challenge)Grade-school science reasoningMCQ, easy + challenge setsChallenge set still useful for smaller models. Frontier models score 95%+
HellaSwagCommonsense reasoning via sentence completion4-choice completionSaturated above 95% for frontier models. Useful mainly for sub-7B model comparison
TruthfulQAResistance to generating common misconceptions817 questions across 38 categoriesStill relevant -- measures calibration and honesty, not raw knowledge. Tests whether models repeat popular falsehoods

Mathematics

BenchmarkWhat It MeasuresStatus (2025-2026)
GSM8KGrade-school math word problems (8.5K examples)Completely saturated. GPT-5.3 Codex scores 99%. No longer differentiates frontier models
MATHCompetition-level math (7.5K problems across 5 difficulty levels)Nearing saturation for frontier models at 90%+
AIME 2025/2026American Invitational Mathematics Examination problemsCurrent frontier benchmark. Qwen3.5-plus: 91.3% on AIME 2026. GPT-5.3 Codex: 94% on AIME 2025

Code

BenchmarkWhat It MeasuresStatus (2025-2026)
HumanEvalFunction-level Python code generation (164 problems)Saturated. Frontier models score 95%+. Too simple -- single-function problems
SWE-bench VerifiedReal-world GitHub issue resolution (500 human-verified instances)Gold standard for code agents. Resistant to contamination because tasks come from real repos. Top models: ~65% pass rate
SWE-LancerFreelance software engineering tasks from Upwork (1,400+ tasks, $50-$32K value)New benchmark linking code ability to economic value
LiveCodeBenchRolling monthly programming competitionsContamination-resistant via continuous updates

Agentic & Multi-Turn (2025-2026 Frontier)

BenchmarkWhat It MeasuresStatus
TAU-benchAgent performance in multi-turn conversations with simulated users + tool use (retail, airline domains)Production-relevant. Tests policy adherence, tool selection, and multi-step reasoning
TAU2-benchDual-control environment where both agent and user take actions on shared stateExtends TAU-bench to collaborative scenarios (telecom support)
GPQA-DiamondGraduate-level science questions verified by domain expertsStrong correlation with production performance on enterprise tasks

2.2 RAG Evaluation: RAGAS & DeepEval

RAGAS Framework (Retrieval Augmented Generation Assessment)

RAGAS provides reference-free evaluation of RAG pipelines -- no ground-truth answers needed. It uses an LLM judge to decompose and score outputs.

Core Metrics:

  1. Faithfulness -- Is every claim in the answer supported by the retrieved context?

    Faithfulness = |claims supported by context| / |total claims in answer|
    
    • LLM extracts atomic claims from the answer, then checks each against context
    • Score of 1.0 = zero hallucination relative to retrieved documents
    • Does NOT measure whether the context itself is correct
  2. Answer Relevance -- Does the answer actually address the question?

    Answer Relevance = mean(cosine_similarity(generated_questions, original_question))
    
    • LLM generates N questions that the answer would address
    • Compares these to the original question via embedding similarity
    • Penalizes off-topic or overly verbose answers
  3. Context Precision -- Are relevant chunks ranked higher than irrelevant ones?

    Context Precision = mean over k: (precision@k * relevance(k)) / |relevant chunks up to k|
    
    • Requires ground-truth labels or LLM judgment of chunk relevance
    • High precision = retriever puts useful chunks first (critical for token-limited contexts)
  4. Context Recall -- Does the retrieved context contain all the information needed?

    Context Recall = |ground-truth sentences attributable to context| / |total ground-truth sentences|
    
    • Needs reference answers to compute
    • Low recall = retriever is missing relevant documents

Production thresholds: Scores above 0.8 on faithfulness and context precision generally indicate production-ready retrieval quality.

DeepEval Framework

DeepEval is an open-source framework that wraps evaluation into pytest-style unit tests for LLM applications. It offers 50+ metrics across categories:

  • RAG metrics: Faithfulness, Contextual Recall, Contextual Precision, Contextual Relevancy, plus RAGAS-compatible scores
  • Conversation metrics: Knowledge Retention (does the chatbot remember facts across turns?), Conversation Completeness
  • Agent metrics: ToolCorrectnessMetric, ArgumentCorrectnessMetric, TaskCompletionMetric, StepEfficiencyMetric, PlanQualityMetric
  • Safety metrics: Bias, Toxicity, Hallucination

DeepEval uses techniques like QAG (Question-Answer Generation), G-Eval (GPT-based evaluation with chain-of-thought), and DAG (Deep Acyclic Graph) scoring internally.

2.3 LLM-as-Judge

Using a strong model (e.g., GPT-4, Claude) to evaluate outputs from any model, including weaker ones.

How it works:

Input: (question, answer, [reference_answer], rubric)
    |
    v
[Judge LLM] -- prompted with evaluation criteria and scoring rubric
    |
    v
Output: score (1-5) + reasoning chain

Common patterns:

  • Pointwise grading: Score a single output on a rubric (1-5 scale)
  • Pairwise comparison: "Which response is better, A or B?" -- more reliable than absolute scoring
  • Reference-guided: Compare against a gold-standard answer

Known biases (12 documented types):

BiasDescriptionMitigation
Position biasSystematically favors first or last response in pairwise comparisonSwap order and average; use balanced position calibration
Verbosity biasPrefers longer, more detailed responses regardless of accuracyInclude "conciseness" in rubric; penalize unnecessary length
Self-enhancement biasModels rate their own outputs higherUse a different model family as judge
Style biasPrefers outputs matching the judge's own style (markdown, bullet points)Normalize formatting before evaluation
Anchoring biasReference answer score influences judgment of test answerEvaluate without reference first, then cross-check
Rubric order biasScore definitions presented first get favoredRandomize rubric presentation order

Calibration methods:

  • Multiple evidence calibration -- aggregate across multiple judge calls
  • Balanced position calibration -- swap A/B order, average results
  • Bayesian GLM framework -- statistically model and correct for judge imperfections
  • Human-in-the-loop calibration -- periodically validate judge scores against human labels

Production consensus (2026): Hybrid approach -- LLM-as-judge handles volume (thousands of evaluations/day), human reviewers maintain ground-truth labels, review flagged edge cases, and make high-stakes decisions.

2.4 Human Evaluation

Inter-Annotator Agreement (IAA):

  • Cohen's Kappa measures agreement between two annotators beyond chance
  • Krippendorff's Alpha generalizes to multiple annotators and missing data
  • Production target: Kappa > 0.7 for reliable evaluation tasks
  • For subjective tasks (helpfulness, creativity), agreement often drops to 0.4-0.6

Chatbot Arena (LMSYS / lmarena.ai):

  • Crowdsourced platform with 6M+ user votes
  • Users chat with two anonymous models side-by-side and pick a winner
  • Uses Bradley-Terry model (not pure Elo) to compute ratings from pairwise preferences
  • Reports Elo-like scores with confidence intervals
  • Covers multiple arenas: text, vision, text-to-video
  • Limitations: crowd-driven nature introduces sampling bias, potential for vote rigging, and demographic skew toward English-speaking tech users
  • Best paired with task-specific evaluations for production decisions

Preference Ranking Methods:

  • Pairwise comparison: "A or B?" -- simplest, most reliable signal
  • Best-of-N: Rank N outputs for a single prompt -- richer signal but O(N^2) cognitive load
  • Likert scale: Rate each output 1-5 -- faster but noisier, anchoring effects

2.5 Evaluation Metrics Deep Dive

Traditional NLP Metrics (and Their Limitations)

MetricWhat It MeasuresFormula (simplified)When to UseCritical Limitation
PerplexityHow surprised the model is by test text2^(-avg log probability)Language model comparison, fine-tuning monitoringLower is better, but does NOT correlate with task quality. A model with lower perplexity can still hallucinate more
BLEUN-gram overlap with reference textPrecision of 1-4 gram matches, brevity penaltyMachine translationPunishes valid paraphrases. A perfect answer worded differently scores 0. Correlates poorly with human judgment for open-ended generation
ROUGERecall of n-grams from referenceROUGE-L: longest common subsequenceSummarizationSame paraphrase problem as BLEU. ROUGE-L is slightly better but still brittle
F1 / Exact MatchToken overlap / string identity with referenceF1 = 2PR/(P+R); EM = 0 or 1Extractive QA, NERExact match fails on semantically equivalent answers ("NYC" vs "New York City")
Semantic SimilarityEmbedding-space distance between output and referencecosine_similarity(embed(output), embed(reference))Any task with reference answersDepends heavily on embedding model quality. May miss subtle factual errors

The 2026 production rule: BLEU and ROUGE are legacy metrics -- use them only for backward compatibility or as cheap sanity checks. For production evaluation, use LLM-as-judge or task-specific metrics.

Cost of Evaluation

Metric cost spectrum (per 1000 evaluations):

Exact Match / F1     ~$0       (deterministic, instant)
BLEU / ROUGE         ~$0       (deterministic, instant)
Semantic Similarity   ~$0.10   (embedding API calls)
RAGAS (4 metrics)     ~$5-15   (4 LLM judge calls per sample)
LLM-as-judge          ~$2-10   (1-3 LLM calls per sample)
Human evaluation       ~$500+   (annotator time, $0.50-2.00 per judgment)

2.6 Automated Evaluation Pipelines (CI/CD for LLM Quality)

Architecture:

Code/Prompt Change (PR)
    |
    v
[CI Pipeline Trigger]
    |
    v
[Run Eval Suite]
    |--- Golden dataset tests (exact match / F1 on curated examples)
    |--- LLM-as-judge scoring (quality, relevance, safety)
    |--- Regression comparison (new scores vs. production baseline)
    |--- Latency + cost benchmarks
    |
    v
[Gate Decision]
    |--- All metrics above threshold? --> PASS --> merge/deploy
    |--- Any regression detected?     --> FAIL --> block + report
    |
    v
[Dashboard + Alerts]
    Visualize trends, track per-metric history

Key tools (2025-2026):

  • DeepEval -- pytest-native, runs in CI, 50+ built-in metrics, span-level agent evaluation
  • Braintrust -- hosted eval platform with dataset versioning and A/B prompt testing
  • Promptfoo -- open-source prompt testing with red-team plugins
  • Confident AI -- regression suites, hosted dashboards, integrates with DeepEval
  • Evidently AI -- LLM monitoring and testing with GitHub Actions integration

Maturity levels:

  • Level 0: Manual testing -- engineer eyeballs outputs before deploy
  • Level 1: Basic deterministic checks -- exact match, regex, format validation
  • Level 2: LLM-as-judge in CI -- automated quality scoring with pass/fail gates
  • Level 3: Full eval pipeline -- multi-criteria scoring, regression detection, cost tracking, safety checks, human review for edge cases

Most teams in 2026 are at Level 0-1. Advanced teams at Level 2-3 catch regressions before users do.

2.7 Building Custom Evaluations

Golden Dataset Construction:

  1. Seed collection -- gather 50-100 representative (input, expected_output) pairs from production logs or domain experts
  2. Stratify by difficulty -- easy (factual lookup), medium (reasoning required), hard (ambiguous or adversarial)
  3. Stratify by category -- ensure coverage across use-case domains
  4. Define rubrics -- for each category, what constitutes a score of 1 vs 3 vs 5?
  5. Validate with multiple annotators -- target Cohen's Kappa > 0.7
  6. Version and expand -- add 10-20 new examples monthly from production failures

Few-Shot Evaluation:

# Pseudocode for few-shot eval with LLM-as-judge
eval_prompt = """
You are evaluating a customer support chatbot response.

## Scoring Rubric
5: Fully correct, addresses all parts of the question, cites policy
4: Mostly correct, minor omissions
3: Partially correct, misses key information
2: Mostly incorrect or misleading
1: Completely wrong or harmful

## Examples
[Input]: "Can I return an opened item?"
[Response]: "Yes, within 30 days with receipt per our return policy."
[Score]: 5
[Reason]: Correct, specific, cites policy.

[Input]: "What's your shipping time?"
[Response]: "We ship fast!"
[Score]: 2
[Reason]: Vague, no specific timeframe, unhelpful.

## Now evaluate:
[Input]: {user_question}
[Response]: {model_response}
[Score]:
[Reason]:
"""

Key principles:

  • Minimum 100 examples for statistical significance at 95% confidence (margin of error ~10%)
  • 500+ examples for fine-grained comparison between models (margin of error ~4%)
  • Always include adversarial/edge cases (10-20% of dataset)
  • Rotate golden datasets quarterly to prevent overfitting

2.8 Online vs Offline Evaluation

DimensionOffline EvaluationOnline Evaluation
WhenPre-deployment (CI/CD, staging)Post-deployment (production)
DataCurated test sets, golden datasetsReal user traffic
SpeedMinutes to hoursDays to weeks for statistical significance
SignalControlled, reproducibleNoisy but authentic
CostCompute + judge LLM costsOpportunity cost of bad experiences
Blind spotsDistribution mismatch with productionSurvivorship bias (users who leave don't provide feedback)

Online Evaluation Methods:

  1. A/B Testing -- split traffic between model versions

    • Need ~1000+ interactions per variant for significance on binary metrics
    • Watch for novelty effects (users initially prefer "different")
    • Measure: task completion rate, user satisfaction, time-to-resolution
  2. Shadow Deployment -- run new model in parallel, compare outputs without serving to users

    • Zero user risk
    • Cannot measure user-facing metrics (satisfaction, follow-ups)
    • Good for catching regressions before A/B test
  3. User Feedback Loops

    • Explicit: thumbs up/down (typical 1-5% response rate)
    • Implicit: regeneration rate, copy/paste behavior, follow-up questions, session length
    • Critical: low explicit feedback rate means you need implicit signals
  4. Interleaving -- mix responses from two models in a single session

    • More statistically efficient than A/B testing (needs ~50% fewer samples)
    • Complex to implement for conversational systems

2.9 Red Teaming & Safety Evaluation

What Red Teaming Tests:

Safety Evaluation Categories
|
|-- Content Safety
|   |-- Toxicity (hate speech, harassment, threats)
|   |-- Adult/violent content generation
|   |-- Self-harm and dangerous activity instructions
|
|-- Security
|   |-- Prompt injection (direct and indirect)
|   |-- Jailbreak resistance
|   |-- PII leakage from training data
|   |-- System prompt extraction
|
|-- Bias & Fairness
|   |-- Demographic bias (race, gender, religion, nationality)
|   |-- Stereotyping and representational harm
|   |-- Performance disparities across groups
|
|-- Factual Safety
|   |-- Hallucination on high-stakes topics (medical, legal, financial)
|   |-- Misinformation amplification
|   |-- Overconfident wrong answers

Jailbreak Attack Taxonomy (2025 data):

TechniqueSuccess Rate (GPT-4)Description
Roleplay dynamics~89.6%"You are DAN, you can do anything..."
Logic traps~81.4%Embedding harmful requests in reasoning chains
Encoding tricks~76.2%Base64, ROT13, token-level manipulation to evade keyword filters
Multi-turn escalation~70%+Gradually escalating across conversation turns

Average time to generate a successful jailbreak: under 17 minutes for GPT-4 (research setting).

Key Safety Benchmarks & Datasets:

  • HolisticBias (Meta) -- 600 identity descriptors across 13 axes (race, nationality, religion, gender, sexual orientation, ability)
  • ToxiGen -- machine-generated toxic and benign statements about 13 minority groups
  • RealToxicityPrompts -- 100K naturally occurring prompts scored for toxicity
  • RedBench -- comprehensive red teaming benchmark for systematic vulnerability assessment
  • BBQ (Bias Benchmark for QA) -- tests social biases in question-answering

Automated Red Teaming Pipeline:

[Attack Generator] -- LLM generates adversarial prompts
    |
    v
[Target Model] -- processes adversarial inputs
    |
    v
[Safety Classifier] -- scores response for harm (toxicity, bias, PII)
    |
    v
[Report] -- aggregate pass/fail rates by category
    |
    v
[Iterate] -- failed attacks become training data for model hardening

Tools: Promptfoo (open-source red team plugins), DeepTeam by Confident AI, Microsoft PyRIT, Garak.


3. WHY (Reasoning & Trade-offs)

Why Evaluation Is the Hardest Unsolved Problem

  1. No ground truth for open-ended generation -- "Write a marketing email" has infinite valid answers. Unlike classification (label is 0 or 1), generation quality is subjective and multi-dimensional
  2. Metric-task mismatch -- BLEU/ROUGE penalize valid paraphrases. A perfectly worded answer that uses different vocabulary scores zero against a reference
  3. Distribution shift -- benchmark performance does not predict production performance. Models optimized for MMLU may fail on your domain-specific queries
  4. Contamination -- 25-50% of benchmark data appears in training corpora. MMLU-CF shows 14-16 point drops when contamination artifacts are removed
  5. Evaluation is itself an AI problem -- LLM-as-judge introduces its own biases, errors, and failure modes. You need to evaluate your evaluator
  6. Multi-dimensional quality -- a response can be accurate but unhelpful, helpful but unsafe, safe but boring. Single-number metrics collapse essential distinctions

When to Use What

ScenarioRecommended Eval ApproachWhy
Comparing two foundation modelsBenchmark suite (MMLU-Pro, SWE-bench Verified, GPQA-Diamond) + Chatbot Arena ratingsStandardized comparison; Arena captures holistic quality
Testing a prompt changeGolden dataset + LLM-as-judge in CI/CDFast iteration, catches regressions
Evaluating RAG pipelineRAGAS metrics (faithfulness, context precision/recall)Directly measures retrieval + generation quality
Pre-launch safety reviewRed teaming (automated + manual) + safety benchmarksCatches harmful behaviors before users encounter them
Production monitoringA/B testing + implicit user signals + drift detectionMeasures real-world impact
Domain-specific qualityCustom golden dataset + domain-expert human evalBenchmarks won't cover your specific use case

Trade-off Table

Evaluation MethodSpeedCostReliabilityScalabilityCoverage
Deterministic metrics (EM, F1)Very fastFreeHigh (but narrow)UnlimitedLow -- only tests what has a reference answer
BLEU/ROUGEVery fastFreeLow for generationUnlimitedLow -- penalizes valid paraphrases
Semantic similarityFastLowMediumHighMedium -- misses subtle errors
LLM-as-judgeMediumMedium ($2-15/1K)Medium-HighHighHigh -- flexible rubrics
RAGASMediumMedium ($5-15/1K)Medium-HighHighHigh for RAG specifically
Human evaluationSlow (hours-days)High ($500+/1K)HighestLowHighest -- catches nuance
A/B testingVery slow (weeks)High (opportunity cost)HighMediumMeasures real impact

4. Engineering Perspective

Production Design Decisions

Decision 1: How many golden dataset examples do you need?

  • 100 minimum for directional signal (is version A better than B?)
  • 500+ for statistically significant comparison (p < 0.05 with ~4% margin of error)
  • Stratify: 60% typical cases, 20% edge cases, 20% adversarial
  • Update quarterly from production failure analysis

Decision 2: Which LLM-as-judge model?

  • Use a model at least one tier above what you're evaluating (e.g., Claude Opus/GPT-4o to judge Claude Haiku/GPT-4o-mini)
  • Never use the same model to judge itself (self-enhancement bias)
  • For cost-sensitive pipelines: use a strong judge on a random 10% sample, deterministic metrics on 100%

Decision 3: When to invest in human evaluation?

  • Always for safety-critical domains (medical, legal, financial)
  • For establishing ground truth when launching a new eval dimension
  • For calibrating LLM-as-judge (run human eval on 200 samples, measure judge-human agreement)
  • Target: LLM-as-judge should agree with humans >80% of the time before trusting it at scale

Decision 4: Offline eval pipeline architecture

Recommended CI/CD eval setup:
1. On every PR: run deterministic checks (format, schema, regex) -- <1 min
2. On every PR: run golden dataset (100 examples) with LLM-as-judge -- 2-5 min
3. Nightly: run full eval suite (500+ examples) across all metrics -- 30-60 min
4. Weekly: human review of 50 random production samples -- 2-4 hours
5. Monthly: full red teaming sweep -- 1-2 days

Common Mistakes

  1. Optimizing for benchmarks instead of production metrics -- a model that scores 90% on MMLU but hallucinates on your domain-specific queries is worse than one scoring 85% that is faithful to your context
  2. Using BLEU/ROUGE for open-ended generation -- these metrics actively punish good paraphrasing. Use them only for constrained tasks (translation, extractive summarization)
  3. Not versioning eval datasets -- if you change your golden dataset without tracking versions, you cannot compare results over time
  4. Ignoring evaluation cost in latency budget -- LLM-as-judge calls add 1-3 seconds per evaluation. For real-time systems, run evals asynchronously
  5. Single-metric evaluation -- collapsing quality into one number hides critical failures. A chatbot with 90% average quality but 5% toxicity rate is a liability
  6. Static golden datasets -- production distributions shift. A golden dataset from 6 months ago may not represent current user queries
  7. Trusting benchmark leaderboards for deployment decisions -- contamination, prompt engineering for benchmarks, and distribution mismatch mean leaderboard rank is a weak signal for your specific use case
  8. Not measuring inter-annotator agreement -- if your human evaluators disagree 40% of the time, your "ground truth" is noise. Measure Kappa first, fix rubrics, then collect labels

Production Eval Stack Example

                    Production Eval Architecture
                    ============================

[GitHub PR] --> [CI Runner]
                    |
        +-----------+-----------+
        |           |           |
   [Format      [Golden     [Safety
    Checks]      Dataset]    Checks]
    regex,       100 items,  prompt injection,
    schema,      LLM-judge   toxicity classifier
    length
        |           |           |
        +-----------+-----------+
                    |
              [Gate: all pass?]
                    |
            yes --> [Deploy to staging]
                    |
              [Shadow eval: 1000 prod queries]
                    |
              [Metrics dashboard]
                    |
              [A/B test: 5% traffic]
                    |
              [Statistical significance?]
                    |
            yes --> [Full rollout]
                    |
              [Production monitoring]
              drift, latency, cost, user feedback

5. Intuition Builder

Analogy

Evaluation of LLMs is like restaurant inspection. A health inspector (benchmark) checks standardized criteria -- food temperature, hand-washing stations, pest control. This catches obvious problems and allows comparison across restaurants. But a health score of 95 does not tell you if the food tastes good, if the service is attentive, or if the menu matches your dietary needs. For that, you need food critics (LLM-as-judge), customer reviews (human evaluation), and actually eating there yourself (production A/B testing). The health score is necessary but wildly insufficient. And just like restaurants can study the inspection checklist and optimize for it without actually improving food quality, LLMs can be trained on benchmark data without genuinely improving capability.

Feynman Explanation

Imagine you're hiring a new employee. You could give them a standardized test -- that's a benchmark. A math test tells you they can do math, but not whether they'll work well with your team. You could have their future manager interview them -- that's LLM-as-judge. The manager has their own biases (prefers confident speakers, penalizes accents), but it's much richer than a test score. You could have multiple team members interview independently and compare notes -- that's inter-annotator agreement. If they all disagree, your interview process is broken, not the candidate. Finally, the real evaluation is the 90-day probation period -- that's online evaluation. No amount of pre-hire testing fully predicts job performance. You need the real thing.

The hardest part? For LLMs, there's no objective "job performance" measure. It's like trying to evaluate an employee when everyone disagrees on what good work looks like.


6. Next Topics (Learning Path)

  1. Prompt Engineering & Optimization -- the most common thing you'll evaluate. Understanding prompt design patterns, chain-of-thought, and few-shot techniques helps you build better eval rubrics and understand why models fail
  2. LLM Agents & Tool Use -- agentic evaluation (TAU-bench, SWE-bench) is the frontier of benchmarking. Understanding agent architectures helps you design multi-turn, tool-use evaluations
  3. MLOps & LLMOps -- the infrastructure layer that supports evaluation pipelines in production: model registries, experiment tracking, deployment strategies, and monitoring

Self-Check Questions

  1. Why can a model score 93% on MMLU but perform poorly on your production use case? Consider contamination, distribution mismatch, and what MMLU actually tests versus what your users need.

  2. You're building a RAG chatbot for legal compliance. Design your evaluation stack. Which RAGAS metrics matter most? Why is faithfulness more critical than answer relevance in this domain? What's your human eval cadence?

  3. An LLM-as-judge gives Response A a score of 4/5 and Response B a score of 3/5. Can you trust this? What biases might be at play? How would you increase confidence in the judgment?

  4. Your golden dataset has 50 examples and shows Model X is 5% better than Model Y. Should you switch? What's the margin of error? How many examples would you need for statistical significance?

  5. Why is online evaluation (A/B testing) necessary even after thorough offline evaluation? What signals can only be captured from real users?


Sources

Benchmarks & Leaderboards

RAG Evaluation

LLM-as-Judge

Evaluation Frameworks & Tools

Agentic Evaluation

Safety & Red Teaming

Contamination & Benchmark Integrity

Related Documents