advanced~8h

LLM Evaluation: Rubrics & Judges

Learn evaluation frameworks: G-Eval, Arena-as-Judge, Multi-turn evaluation, and Red Teaming.

evaluation

G-Eval Rubric Weights:

CONCISENESS QUALITY:50%
FACTUAL ACCURACY:80%
G-Eval computes expected values of token probabilities:
Score = ∑ p_i * Grade_i
Evaluator Score Output:
3.98 / 5.0
Moderate Quality
Probability Weights:
Grade [1-2] (Unlikely):15%
Grade [4-5] (Highly Likely):69%
4
Subtopics
1
Exercises
1
Projects
1
Quiz Qs
3
Flashcards
📚 Prerequisites(1)

🎓 Learning objectives

  • Understand G-Eval evaluation using chain-of-thought grading rubrics
  • Explain LLM Arena-as-Judge and ELO scaling calculations
  • Design component-level evaluations for RAG and agent actions

What is it?

LLM evaluation is the layered practice of measuring whether a model's outputs are actually good — spanning cheap reference-based metrics (BLEU, ROUGE, BERTScore), LLM-as-judge frameworks (G-Eval, Arena-style pairwise comparison) for open-ended quality where no single correct answer exists, and human evaluation as the calibrating ground truth for both. No single layer is sufficient alone: a mature evaluation stack runs automated metrics constantly, LLM judges frequently, and human review periodically to keep the cheaper layers honest.

Why it exists

Natural language outputs are subjective; traditional NLP metrics (like BLEU, ROUGE) measure word overlap but fail to assess meaning, reasoning, or formatting.

Problem it solves

Subjective grading bottleneck, evaluating factual accuracy, safety checks, and tool call precision.

Intuition

How do we know if our AI is smart or safe? We cannot just test it once. We use "LLM-as-Judge" (G-Eval): we write a scorecard (rubric) and ask a super-smart AI (like GPT-4) to grade the younger AI's answer. We also run "Red Teaming", which means hiring hackers to try to trick the AI into giving bad advice to make sure it is safe.

Analogy

Think of evaluation like grading a college essay. Instead of counting matching words (ROUGE), you give a professor (Judge LLM) a grading sheet (Rubric) to score the essay on logic and structure.

Technical explanation

G-Eval implements chain-of-thought evaluation by prompting an evaluator LLM to generate grading steps, score outputs from 1 to 5, and output probabilities of score tokens to calculate expected values: $Score = sum_{p=1}^5 p imes P( ext{score} = p)$. Red Teaming tests jailbreak safety (e.g., adversarial suffixes, roleplay bypass). Multi-turn evaluation measures dialogue drift, topic coherence, and context leakage.

Architecture

Evaluation pipeline driving test suite datasets through model runners, exporting results to a statistical aggregator.

Workflow

  1. Load evaluation dataset -> 2. Generate responses -> 3. Run LLM Judge scoring -> 4. Compute ELO scores -> 5. Flag outliers.

Example

probs = {1: 0.1, 2: 0.1, 3: 0.8} expected_score = (1 * 0.1) + (2 * 0.1) + (3 * 0.8) # 2.7

Real-world usage

Setting up automated regression pipelines in CI/CD to evaluate prompt modifications.

Trade-offs

Manual grading is highly accurate but slow; LLM-as-a-judge is rapid but carries minor bias risks.

Visual explanation

G-Eval expected value computation: [System Rubrics] + [Input/Output] ──> [LLM Judge Prompt] │ ▼ [Generate CoT Reasoning] │ ▼ [Output token probabilities] P(1): 0.05, P(2): 0.10, P(3): 0.70, P(4): 0.10, P(5): 0.05 │ ▼ Expected Score = Sum( p * P(p) ) = 3.00

Advantages

  • Scales easily to thousands of test cases

  • Aligned well with human grading criteria

Disadvantages

  • Judge LLM can show positional and self-preference bias

Common mistakes

  • Using weak models like Llama 8B to grade complex logical prompts

  • Not evaluating retrieval components separately from generation components

🎤 Interview questions

How do you design a red-teaming pipeline to test a model against prompt injection attacks?

Explain how RAG evaluation frameworks (like Ragas) calculate faithfulness and context recall metrics.

📂 Subtopics

📝 Quiz

💬 Deep Dive with AI

Related concepts

llm-trainingllm-observability

Next to learn

llm-observability

Next Step

Continue to Model Deployment: vLLM & LitServe