LLM Evaluation: Rubrics & Judges
Learn evaluation frameworks: G-Eval, Arena-as-Judge, Multi-turn evaluation, and Red Teaming.
G-Eval Rubric Weights:
▶📚 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
- 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
Automated Metrics: BLEU, ROUGE and BERTScore
Reference-based metrics score an output by comparing it to a 'gold' answer. BLEU and ROUGE count overlapping words; BERTScore compares meaning via embeddings. All are cheap but blind to correctness the reference didn't anticipate.
~13 min
LLM-as-Judge: Using a Model to Grade Outputs (G-Eval, Arena)
An LLM-as-judge uses a strong model (GPT-4, Claude) to score or compare outputs against a rubric — flexible enough for open-ended tasks where reference metrics fail, but carrying real biases you must design around.
~14 min
Human Evaluation: When Automation Isn't Enough
Human evaluation is the gold standard for subjective, high-stakes, or novel quality dimensions. Its value depends entirely on clear annotation guidelines and measuring inter-rater agreement.
~12 min
RAG-Specific Evaluation with RAGAS
RAG systems have two failure surfaces — retrieval and generation — so they need metrics that isolate each. RAGAS measures faithfulness, answer relevancy, context precision and context recall, often without needing gold answers.
~14 min