

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Manual Evaluation
incomplete
2: Golden Dataset
incomplete
3: Precision Metrics
incomplete
4: Recall Metrics
incomplete
5: F1 Score
incomplete
6: Error Analysis
incomplete
7: LLM Evaluation
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Manual evaluation is slow. Automated metrics miss nuance.
Can an LLM "manually" judge search quality... automatically? For example, can we use a prompt like this?
prompt = f"""Rate how relevant each result is to this query:
Query: "{query}"
Results: {format_results(results)}
Rate each 0-3 where:
- 3: Highly relevant
- 2: Relevant
- 1: Marginally relevant
- 0: Not relevant"""
It turns out, the LLM can produce reasonable scores, but what's even more helpful is that building this kind of system forces you to define what "good" means.
To create an LLM judge, you must:
This clarity improves your entire evaluation system, even if you end up not using the LLM.
LLMs almost certainly don't understand your domain as well as human experts do. But human experts are slow and sometimes inconsistent.
The best practice? Have the domain experts create the evaluation prompt and criteria. Then have them judge whether the LLM's scores are up to par.
An LLM as a judge is not going to be as good as a human expert, so why use one?
Here's the system prompt I used:
f"""Rate how relevant each result is to this query on a 0-3 scale:
Query: "{query}"
Results:
{chr(10).join(formatted_results)}
Scale:
- 3: Highly relevant
- 2: Relevant
- 1: Marginally relevant
- 0: Not relevant
Do NOT give any numbers other than 0, 1, 2, or 3.
Return ONLY the scores in the same order you were given the documents. Return a valid JSON list, nothing else. For example:
[2, 0, 3, 2, 0, 1]"""
1. Bugs Bunny and the Three Bears: 2/3
2. Care Bears Movie II: A New Generation: 2/3
3. Swiss Army Man: 0/3
4. Disaster Movie: 0/3
Submit the CLI tests.