LLM Evaluation Methods – Complete Notes (Interview + Production Ready)
This section explains who performs the evaluation in an LLM evaluation pipeline.
Question: Who decides whether the LLM output is good or bad?
The answer is called the Evaluation Method.
What is an LLM Evaluation Method?
Definition
An LLM Evaluation Method is the mechanism used to determine whether an LLM's output is good or bad.
It is the procedure that takes the model output and produces a judgment.
Every evaluation pipeline eventually uses one of three methods.
LLM Output
│
▼
Evaluation Method
│
▼
Score / Pass / Fail
Three Evaluation Methods
Evaluation Methods
┌───────────────────────────┐
│ Who performs evaluation? │
└─────────────┬─────────────┘
│
┌─────────────────────┼──────────────────────┐
│ │ │
▼ ▼ ▼
Programmatic Human Evaluation LLM Evaluation
(Deterministic) (Human Judge) (LLM-as-a-Judge)
1. Programmatic (Deterministic) Evaluation
Definition
Evaluation is performed by a program.
Python code calculates the metric automatically.
No human judgment is needed during evaluation.
Flow
Dataset
│
▼
LLM Component
│
▼
Python Program
│
▼
Metric
Example
Evaluate the Retriever of a RAG chatbot.
Question:
"What are the prerequisites for the ML course?"
Suppose the correct documents are
1001
1003
Retriever returns Top-5
1001
1002
1004
1005
1006
Recall@K
Formula
Recall@K
=
Relevant Retrieved
----------------------
Total Relevant Documents
Here
Relevant documents
1001
1003
Retrieved relevant
1001
Therefore
Recall@5
=
1
--
2
= 0.5
=50%
Complete Pipeline
Questions
│
▼
Retriever
│
▼
Top-K Documents
│
▼
Python compares
with Ground Truth
│
▼
Recall@K
Advantages
- Fast
- Cheap
- Repeatable
- Objective
- Fully automated
Disadvantages
Cannot evaluate subjective qualities like
- Helpfulness
- Tone
- Creativity
- Reasoning quality
Recall@K
Definition
Out of all relevant documents,
how many were retrieved?
Formula
Recall@K
=
Retrieved Relevant Docs
---------------------------
All Relevant Docs
Range
0
↓
1
Higher is better.
Precision@K
Definition
Out of retrieved documents,
how many are actually relevant?
Formula
Precision@K
=
Relevant Retrieved
-----------------------
Retrieved Documents
When to Use Programmatic Evaluation
Use when evaluation is objective.
Examples
- Classification accuracy
- Retriever evaluation
- Exact Match
- BLEU
- ROUGE
- Code execution
- JSON validation
2. Human Evaluation
Here,
a human evaluates the output.
Pipeline
Questions
│
▼
Chatbot
│
▼
Generated Answer
│
▼
Human Judge
│
▼
Score
Example
CampusX Chatbot
Question
Can I pay the fee in installments?
Chatbot Answer
↓
Human checks
- Accuracy
- Completeness
- Tone
↓
Assigns score
1–5
Rubric
Example
| Score | Meaning |
|---|---|
| 5 | Accurate, complete, helpful |
| 4 | Minor mistakes |
| 3 | Partially helpful |
| 2 | Poor |
| 1 | Completely wrong |
Complete Flow
Dataset
│
▼
Chatbot
│
▼
Answers
│
▼
Human reads
│
▼
Assign Score
│
▼
Average Score
Why Multiple Human Evaluators?
Example
Human A → 2
Human B → 5
Large disagreement means
Rubric is ambiguous
Agreement means
Rubric is good.
Human Evaluation Types
1. Direct Rating
Read output
↓
Give score
2. Red Teaming
Humans intentionally try to break the system.
Examples
- Prompt Injection
- Jailbreak
- Harmful prompts
Purpose
Find vulnerabilities before deployment.
3. A/B Testing
Two chatbot versions
Users
↓
Version A
Version B
↓
Compare ratings
Deploy the better version.
4. Golden Dataset Creation
Humans create
- Correct answers
- Labels
- Ground truth
- Rubrics
5. Human-in-the-Loop
Complex cases are sent to humans.
Example
LLM uncertain
↓
Human reviews
↓
Final decision
Advantages
- Most reliable
- Understands context
- Handles ambiguity
- Best judgment
Disadvantages
- Expensive
- Slow
- Doesn't scale
- Requires experts
3. LLM Evaluation (LLM-as-a-Judge)
Instead of humans,
another LLM evaluates the output.
This is the most popular evaluation method today.
Why?
Suppose
10,000 UPSC students submit subjective answers.
Human evaluation
Very expensive
Programmatic evaluation
Impossible
Solution
LLM evaluates
all answers.
Pipeline
Student Answer
│
▼
Evaluation Prompt
│
▼
Judge LLM
│
▼
Marks + Reason
Example
Question
Discuss ethical governance.
Rubric
- Ethics explained
- Accountability discussed
- Examples
- Mechanisms
- Balanced conclusion
Prompt
You are a UPSSC evaluator.
Use this rubric.
Assign marks.
Explain reasoning.
Output
Score : 12/15
Reason:
Good examples.
Weak conclusion.
How to Evaluate the Judge LLM?
Need a Golden Dataset.
Student Answer
↓
Human Marks
↓
LLM Marks
↓
Compare
Example
| Answer | Human | LLM |
|---|---|---|
| A1 | 13 | 12 |
| A2 | 8 | 9 |
| A3 | 4 | 4 |
Metric
Mean Absolute Error (MAE)
Formula
MAE
=
Σ |Human Score - LLM Score|
-----------------------------
Number of Answers
Example
Human
13
8
4
LLM
12
9
4
Difference
1
1
0
MAE
(1+1+0)/3
=0.67
Lower MAE is better.
MAE = 0
Perfect Judge
Advantages
- Much cheaper than humans
- Faster
- Scalable
- Good reasoning ability
Disadvantages
- Can hallucinate
- May inherit model bias
- Not as trustworthy as experts
- Prompt sensitive
Comparison
| Feature | Programmatic | Human | LLM Judge |
|---|---|---|---|
| Cost | Very Low | High | Medium |
| Speed | Very Fast | Slow | Fast |
| Scalable | Yes | No | Yes |
| Subjective Tasks | No | Yes | Yes |
| Reliability | High (objective) | Highest | Good |
Which Method Should You Use?
Objective Metric?
│
▼
Programmatic
Need Human Judgment?
│
▼
Can afford Humans?
│
Yes ─────► Human
│
No
▼
LLM-as-a-Judge
Reference-Based Evaluation
Definition
Correct answer already exists.
Model output is compared against the reference.
Example
Retriever Evaluation
Question
↓
Correct document IDs already known
↓
Compute Recall
Another Example
Human marks
13
LLM gives
12
Compare both.
Reference already exists.
Reference-Free Evaluation
No correct answer exists.
Judge evaluates quality directly using a rubric.
Example
Question
↓
Chatbot Answer
↓
Human reads
↓
Rate Helpfulness
No predefined correct answer.
Difference
| Reference-Based | Reference-Free |
|---|---|
| Ground truth available | No ground truth |
| Compare against reference | Judge directly |
| Objective | Subjective |
| Uses labels | Uses rubric |
Complete Evaluation Pipeline
Step 1
Define Task
↓
Step 2
Define Success Metric
↓
Step 3
Create Evaluation Dataset
↓
Step 4
Choose Evaluation Method
Program
Human
LLM
↓
Step 5
Run Evaluation
↓
Step 6
Calculate Metrics
↓
Step 7
Analyze Failures
↓
Step 8
Improve System
↓
Repeat
Interview Questions
Q1. What are the three LLM evaluation methods?
- Programmatic (Deterministic)
- Human Evaluation
- LLM-as-a-Judge
Q2. When should Programmatic Evaluation be used?
When outputs can be measured objectively (accuracy, Recall@K, Exact Match, JSON validity, etc.).
Q3. Why is Human Evaluation considered the gold standard?
Because humans best understand context, nuance, reasoning, tone, and helpfulness.
Q4. Why use LLM-as-a-Judge?
It offers a balance between scalability and quality—far cheaper than humans while handling subjective evaluation better than deterministic metrics.
Q5. What is Recall@K?
The fraction of all relevant documents that appear within the top K retrieved results.
Q6. What is MAE in LLM evaluation?
Mean Absolute Error measures the average absolute difference between human scores and LLM-generated scores. Lower MAE indicates closer agreement.
Q7. What is a Golden Dataset?
A manually curated dataset containing trusted ground-truth labels, answers, or scores used as the benchmark for evaluation.
Q8. What is a Rubric?
A predefined set of evaluation criteria (e.g., accuracy, completeness, reasoning, tone) used to consistently score outputs.
Q9. What is Reference-Based Evaluation?
Evaluation where a known correct answer or label exists and model output is compared against it.
Q10. What is Reference-Free Evaluation?
Evaluation where no ground-truth answer exists; quality is judged directly using criteria or a rubric.
Absolutely—I've converted this lecture into structured, interview-ready notes with the same teaching flow, diagrams, examples, formulas, and important points.
You can use these notes directly for LLM Evaluation, RAG Evaluation, LLM-as-a-Judge, and AI Engineer interviews.
LLM Evaluation Methods (Complete Notes)
What is an Evaluation Method?
Definition
An LLM Evaluation Method is the mechanism that decides whether an LLM's output is good or bad.
It is simply who performs the evaluation.
LLM Output
│
▼
Evaluation Method
│
▼
Good / Bad
Score / Pass / Fail
Every LLM evaluation pipeline eventually uses only one of these three methods.
Three Evaluation Methods
LLM Evaluation
│
┌──────────────┼──────────────┐
│ │ │
▼ ▼ ▼
Programmatic Human LLM-as-a-Judge
(Deterministic) Evaluation (Model-Graded)
1. Programmatic (Deterministic) Evaluation
Definition
A program (Python code) performs the evaluation.
No human judgment is involved during evaluation.
The evaluation is completely deterministic.
When is it used?
Whenever quality can be measured mathematically.
Examples
- Accuracy
- Precision
- Recall
- Exact Match
- BLEU
- ROUGE
- JSON Validation
- SQL correctness
- Classification accuracy
- Retriever evaluation
Example
Evaluate a RAG Retriever
Retriever's job
Question
│
▼
Retriever
│
▼
Relevant Documents
Question
What are the prerequisites for ML Course?
Ground Truth
1001
1003
Retriever returns Top-5
1001
1002
1004
1005
1006
Recall@K
Definition
Out of all relevant documents,
how many were retrieved?
Formula
Recall@K
=
Relevant Retrieved
------------------------
Total Relevant Documents
Example
Relevant documents
1001
1003
Retrieved relevant
1001
Therefore
Recall@5
=
1
──
2
=
0.5
=
50%
Evaluation Pipeline
Evaluation Dataset
│
▼
Retriever
│
▼
Top-K Documents
│
▼
Python compares
with Ground Truth
│
▼
Recall@K
Complete Pipeline
Step 1
Define Task
Evaluate Retriever
Step 2
Success Metric
Recall@K
Step 3
Create Evaluation Dataset
Example
| Question | Correct Documents |
|---|---|
| Q1 | 1001 |
| Q2 | 1001,1003 |
| Q3 | 1005 |
This is called the Golden Dataset.
Step 4
Run Retriever
Question
↓
Retriever
↓
Top-K Docs
Step 5
Program Calculates Recall
Example
Q1
Correct
1001
Retrieved
1001
Recall
1
Q2
Correct
1001
1003
Retrieved
1001
Recall
0.5
Average Recall
Recall@5
=
Average of all recalls
How to Improve Recall?
- Better Embedding Model
- Better Chunking
- Query Expansion
- Increase K
- Re-ranking
- Hybrid Search
Advantages
✅ Fast
✅ Cheap
✅ Repeatable
✅ Fully Automated
Disadvantages
Cannot evaluate
- Helpfulness
- Tone
- Creativity
- Reasoning
- Naturalness
2. Human Evaluation
Instead of a program,
a human performs the evaluation.
Pipeline
Question
↓
Chatbot
↓
Answer
↓
Human Judge
↓
Score
Example
Question
Can I pay fee in installments?
Chatbot generates answer.
Human checks
- Correctness
- Completeness
- Tone
- Helpfulness
Then gives score.
Rubric
Example
| Score | Meaning |
|---|---|
| 5 | Excellent |
| 4 | Good |
| 3 | Average |
| 2 | Poor |
| 1 | Wrong |
Human Evaluation Flow
Evaluation Dataset
↓
Questions
↓
Chatbot
↓
Generated Answers
↓
Human reads
↓
Assign Score
↓
Average Score
Why Multiple Human Evaluators?
Suppose
Evaluator A
2
Evaluator B
5
Large disagreement means
Rubric is ambiguous.
If both give similar scores
Rubric is reliable.
This is called Inter-Annotator Agreement.
Types of Human Evaluation
1. Direct Rating
Human directly gives score.
Read
↓
Judge
↓
Score
2. Red Teaming
Humans intentionally attack the LLM.
Goal
Find
- Jailbreaks
- Prompt Injection
- Harmful outputs
- Safety failures
3. A/B Testing
Two chatbot versions
Users
↓
Version A
Version B
↓
Ratings
↓
Choose Better Version
4. Golden Dataset Creation
Humans create
- Correct Answers
- Labels
- Ground Truth
- Rubrics
5. Human-in-the-Loop
Complex cases
↓
Sent to Human
↓
Human decides final output
Advantages
Highest reliability
Best reasoning
Handles ambiguity
Disadvantages
Very expensive
Slow
Not scalable
Needs experts
3. LLM-as-a-Judge (Model-Graded Evaluation)
Instead of humans,
another LLM evaluates outputs.
This is currently the most popular evaluation method in production LLM systems.
Why?
Suppose
10,000 UPSC students submit subjective answers.
Human evaluation
❌ Very expensive
Programmatic evaluation
❌ Impossible
Solution
Student Answer
↓
Judge LLM
↓
Marks
Example
Question
Discuss Ethical Governance
Rubric
- Ethics explained
- Accountability
- Examples
- Mechanisms
- Conclusion
Prompt
You are a UPSC evaluator.
Use the following rubric.
Assign marks.
Explain your reasoning.
Output
Marks
12/15
Reason
Good explanation
Weak conclusion
Evaluation Pipeline
Student Answer
↓
Judge Prompt
↓
Judge LLM
↓
Marks
+
Reasoning
How to Evaluate the Judge LLM?
Need a Golden Dataset.
Example
| Answer | Human Marks | LLM Marks |
|---|---|---|
| A1 | 13 | 12 |
| A2 | 4 | 5 |
| A3 | 8 | 8 |
Now compare both.
Metric
Mean Absolute Error (MAE)
Formula
MAE
=
Σ |Human − LLM|
-------------------
Number of Answers
Example
Human
13
8
4
LLM
12
9
4
Difference
1
1
0
MAE
(1+1+0)
────────
3
=
0.67
Lower is better.
Ideal
MAE
=
0
How to Improve Judge LLM?
- Better Prompt
- Better Rubric
- Better Judge Model
- Few-shot Examples
- Better Instructions
Advantages
Much cheaper than humans
Fast
Scalable
Reasoning capable
Disadvantages
Can hallucinate
May inherit bias
Prompt sensitive
Less reliable than experts
Comparison
| Feature | Programmatic | Human | LLM Judge |
|---|---|---|---|
| Speed | ⭐⭐⭐⭐⭐ | ⭐ | ⭐⭐⭐⭐ |
| Cost | Very Low | Very High | Medium |
| Scalability | Excellent | Poor | Excellent |
| Subjective Tasks | No | Yes | Yes |
| Reliability | High (objective) | Highest | Good |
Which Evaluation Method Should You Use?
Objective Metric?
↓
Yes
↓
Programmatic
Need Human Judgment?
↓
Can afford Humans?
↓
Yes
↓
Human
No
↓
LLM-as-a-Judge
Reference-Based Evaluation
Definition
A correct answer already exists.
Evaluation compares model output with this reference.
Examples
- Classification labels
- Retriever ground-truth documents
- Human-assigned scores
- Exact answers
Ground Truth
↓
Model Output
↓
Comparison
↓
Score
Reference-Free Evaluation
Definition
No predefined correct answer exists.
The evaluator judges quality directly using a rubric.
Question
↓
Chatbot Answer
↓
Judge
↓
Helpfulness
Examples
- Helpfulness
- Tone
- Fluency
- Naturalness
- Creativity
Reference-Based vs Reference-Free
| Reference-Based | Reference-Free |
|---|---|
| Ground truth available | No ground truth |
| Compare with reference | Judge directly |
| Objective | Subjective |
| Uses labels | Uses rubrics |
Complete LLM Evaluation Pipeline
Step 1
Define Task
↓
Step 2
Choose Target
(Component / Workflow / Application)
↓
Step 3
Define Success Metric
↓
Step 4
Create Evaluation Dataset
↓
Step 5
Choose Evaluation Method
Programmatic
Human
LLM Judge
↓
Step 6
Run Evaluation
↓
Step 7
Compute Metrics
↓
Step 8
Analyze Failures
↓
Step 9
Improve System
↓
Repeat
Interview Questions
1. What are the three LLM evaluation methods?
- Programmatic (Deterministic)
- Human Evaluation
- LLM-as-a-Judge (Model-Graded)
2. When should Programmatic Evaluation be used?
When output quality can be measured objectively using metrics such as Accuracy, Recall@K, Precision, Exact Match, or JSON validation.
3. Why is Human Evaluation considered the gold standard?
Because humans best understand context, nuance, reasoning, tone, helpfulness, and subjective quality.
4. Why is LLM-as-a-Judge widely used?
It provides a practical balance between cost, speed, scalability, and evaluation quality, making it suitable for production systems.
5. What is Recall@K?
The fraction of all relevant documents that appear in the top K retrieved results.
6. What is MAE?
Mean Absolute Error measures the average absolute difference between human-assigned scores and LLM-assigned scores. A lower MAE indicates better agreement.
7. What is a Golden Dataset?
A curated dataset containing trusted ground-truth labels, answers, or scores used as the benchmark for evaluation.
8. What is a Rubric?
A predefined set of scoring criteria (e.g., accuracy, completeness, reasoning, examples, tone) used to evaluate outputs consistently.
9. What is Reference-Based Evaluation?
Evaluation where a known correct answer or label exists and model output is compared against that reference.
10. What is Reference-Free Evaluation?
Evaluation where no ground-truth answer exists; outputs are judged directly against a rubric or quality criteria.
These notes capture the complete lecture in a structured, production-oriented format while preserving the concepts, examples, formulas, diagrams, and interview-relevant details.
I'm glad the notes helped! This lecture covers one of the most important topics in LLM Evaluation. The notes above already include the complete explanation in a structured format, so you can use them directly for revision and interviews.
The next topic in this course, as mentioned at the end of the lecture, is:
Offline vs Online Evaluation
This is another core production concept. If you share that lecture transcript as well, I'll convert it into notes in the same style:
- ✅ Production-ready explanations
- ✅ ASCII diagrams
- ✅ Real-world examples
- ✅ Interview questions
- ✅ Formulas and metrics
- ✅ Comparison tables
- ✅ Easy-to-revise format
That way, you'll have a complete LLM Evaluation Handbook covering every topic in a consistent format.
Perfect! Send the next lecture, and I'll convert it into the same detailed, production-ready notes with:
- 📖 Simple explanations
- 📊 Tables
- 🌳 Flow diagrams
- 💡 Real-world examples
- 🧠 Interview questions
- 📌 Key points
- ⚠️ Common mistakes
- 🎯 Production insights
I'll maintain the same format throughout so that, by the end, you'll have a complete LLM Evaluation Notes / Handbook suitable for interviews and revision.