Advanced Evaluation

Advanced Evaluation

Teaches building LLM-as-judge systems: direct scoring, pairwise comparison, rubric calibration and bias mitigation for reliable automated quality assessment.

Skill files6 files

references/

scripts/

SKILL.md410 lines
1
---
2
name: advanced-evaluation
3
description: "This skill should be used for advanced LLM evaluation: LLM-as-judge systems, direct scoring, pairwise comparison, rubric calibration, evaluator bias mitigation, confidence scoring, and automated quality assessment."
4
---
5
6
# Advanced Evaluation
7
8
This skill covers production-grade techniques for evaluating LLM outputs using LLMs as judges. It synthesizes research from academic papers, industry practices, and practical implementation experience into actionable patterns for building reliable evaluation systems.
9
10
**Key insight**: LLM-as-a-Judge is not a single technique but a family of approaches, each suited to different evaluation contexts. Choosing the right approach and mitigating known biases is the core competency this skill develops.
11
12
## When to Activate
13
14
Activate this skill when:
15
16
- Building LLM-as-judge systems for LLM outputs
17
- Comparing multiple model responses to select the best one
18
- Establishing consistent quality standards across evaluation teams
19
- Debugging evaluation systems that show inconsistent results
20
- Designing A/B tests for prompt or model changes
21
- Creating rubrics specifically for LLM or human/LLM hybrid judges
22
- Analyzing correlation between automated and human judgments
23
24
Do not activate this skill for adjacent work owned by other skills:
25
- General deterministic checks, regression suites, production quality gates, or outcome metrics: `evaluation`.
26
- Autonomous loop governance, locked rubrics, rollback, or PR approval boundaries: `harness-engineering`.
27
- Tool API contracts for evaluation tools: `tool-design`.
28
29
## Core Concepts
30
31
### The Evaluation Taxonomy
32
33
Select between two primary approaches based on whether ground truth exists:
34
35
**Direct Scoring** — Use when objective criteria exist (factual accuracy, instruction following, toxicity). A single LLM rates one response on a defined scale. Achieves moderate-to-high reliability for well-defined criteria. Watch for score calibration drift and inconsistent scale interpretation.
36
37
**Pairwise Comparison** — Use for subjective preferences (tone, style, persuasiveness). An LLM compares two responses and selects the better one. Pairwise methods often correlate better with human preference than open-ended direct scoring for subjective tasks (claim-advanced-evaluation-position-swap). Watch for position bias and length bias.
38
39
### The Bias Landscape
40
41
Mitigate these systematic biases in every evaluation system:
42
43
**Position Bias**: First-position responses get preferential treatment. Mitigate by evaluating twice with swapped positions, then apply majority vote or consistency check.
44
45
**Length Bias**: Longer responses score higher regardless of quality. Mitigate by explicitly prompting to ignore length and applying length-normalized scoring.
46
47
**Self-Enhancement Bias**: Models rate their own outputs higher. Mitigate by using different models for generation and evaluation.
48
49
**Verbosity Bias**: Excessive detail scores higher even when unnecessary. Mitigate with criteria-specific rubrics that penalize irrelevant detail.
50
51
**Authority Bias**: Confident tone scores higher regardless of accuracy. Mitigate by requiring evidence citation and adding a fact-checking layer.
52
53
### Metric Selection Framework
54
55
Match metrics to the evaluation task structure:
56
57
| Task Type | Primary Metrics | Secondary Metrics |
58
|-----------|-----------------|-------------------|
59
| Binary classification (pass/fail) | Recall, Precision, F1 | Cohen's kappa |
60
| Ordinal scale (1-5 rating) | Spearman's rho, Kendall's tau | Cohen's kappa (weighted) |
61
| Pairwise preference | Agreement rate, Position consistency | Confidence calibration |
62
| Multi-label | Macro-F1, Micro-F1 | Per-label precision/recall |
63
64
Prioritize systematic disagreement patterns over absolute agreement rates because a judge that consistently disagrees with humans on specific criteria is more problematic than one with random noise.
65
66
## Evaluation Approaches
67
68
### Direct Scoring Implementation
69
70
Build direct scoring with three components: clear criteria, a calibrated scale, and structured output format.
71
72
**Criteria Definition Pattern**:
73
```
74
Criterion: [Name]
75
Description: [What this criterion measures]
76
Weight: [Relative importance, 0-1]
77
```
78
79
**Scale Calibration** — Choose scale granularity based on rubric detail:
80
- 1-3: Binary with neutral option, lowest cognitive load
81
- 1-5: Standard Likert, best balance of granularity and reliability
82
- 1-10: Use only with detailed per-level rubrics because calibration is harder
83
84
**Prompt Structure for Direct Scoring**:
85
```
86
You are an expert evaluator assessing response quality.
87
88
## Task
89
Evaluate the following response against each criterion.
90
91
## Original Prompt
92
{prompt}
93
94
## Response to Evaluate
95
{response}
96
97
## Criteria
98
{for each criterion: name, description, weight}
99
100
## Instructions
101
For each criterion:
102
1. Find specific evidence in the response
103
2. Score according to the rubric (1-{max} scale)
104
3. Justify your score with evidence
105
4. Suggest one specific improvement
106
107
## Output Format
108
Respond with structured JSON containing scores, justifications, and summary.
109
```
110
111
Require evidence before the score in scoring prompts so the judge must anchor its decision in observable output features before emitting a number.
112
113
### Pairwise Comparison Implementation
114
115
Apply position bias mitigation in every pairwise evaluation:
116
117
1. Run deterministic pre-checks first: both candidates must satisfy the same schema, source-evidence requirements, and scope constraints.
118
2. First judge pass: Response A in first position, Response B in second.
119
3. Second judge pass: Response B in first position, Response A in second.
120
4. Consistency check: If passes disagree, return TIE with reduced confidence.
121
5. Final verdict: Consistent winner with averaged confidence and explicit tie-breaker rationale.
122
123
**Prompt Structure for Pairwise Comparison**:
124
```
125
You are an expert evaluator comparing two AI responses.
126
127
## Critical Instructions
128
- Do NOT prefer responses because they are longer
129
- Do NOT prefer responses based on position (first vs second)
130
- Focus ONLY on quality according to the specified criteria
131
- Ties are acceptable when responses are genuinely equivalent
132
133
## Original Prompt
134
{prompt}
135
136
## Response A
137
{response_a}
138
139
## Response B
140
{response_b}
141
142
## Comparison Criteria
143
{criteria list}
144
145
## Instructions
146
1. Analyze each response independently first
147
2. Compare them on each criterion
148
3. Determine overall winner with confidence level
149
150
## Output Format
151
JSON with per-criterion comparison, overall winner, confidence (0-1), and reasoning.
152
```
153
154
**Confidence Calibration** — Map confidence to position consistency:
155
- Both passes agree: confidence = average of individual confidences
156
- Passes disagree: confidence = 0.5, verdict = TIE
157
158
### Rubric Generation
159
160
Generate rubrics to reduce evaluation variance compared to open-ended scoring. Treat exact variance reduction as workload-specific unless measured on the target eval set.
161
162
**Include these rubric components**:
163
1. **Level descriptions**: Clear boundaries for each score level
164
2. **Characteristics**: Observable features that define each level
165
3. **Examples**: Representative text for each level (optional but valuable)
166
4. **Edge cases**: Guidance for ambiguous situations
167
5. **Scoring guidelines**: General principles for consistent application
168
169
**Set strictness calibration** for the use case:
170
- **Lenient**: Lower passing bar, appropriate for encouraging iteration
171
- **Balanced**: Typical production expectations
172
- **Strict**: High standards for safety-critical or high-stakes evaluation
173
174
Adapt rubrics to the domain — use domain-specific terminology. A code readability rubric mentions variables, functions, and comments. A medical accuracy rubric references clinical terminology and evidence standards.
175
176
## Practical Guidance
177
178
### Evaluation Pipeline Design
179
180
Build production evaluation systems with these layers: Criteria Loader (rubrics + weights) -> Primary Scorer (direct or pairwise) -> Bias Mitigation (position swap, etc.) -> Confidence Scoring (calibration) -> Output (scores + justifications + confidence). See [Evaluation Pipeline Diagram](./references/evaluation-pipeline.md) for the full visual layout.
181
182
### Decision Framework: Direct vs. Pairwise
183
184
Apply this decision tree:
185
186
```
187
Is there an objective ground truth?
188
+-- Yes -> Direct Scoring
189
| Examples: factual accuracy, instruction following, format compliance
190
|
191
+-- No -> Is it a preference or quality judgment?
192
+-- Yes -> Pairwise Comparison
193
| Examples: tone, style, persuasiveness, creativity
194
|
195
+-- No -> Consider reference-based evaluation
196
Examples: summarization (compare to source), translation (compare to reference)
197
```
198
199
### Scaling Evaluation
200
201
For high-volume evaluation, apply one of these strategies:
202
203
1. **Panel of LLMs (PoLL)**: Use multiple models as judges and aggregate votes to reduce individual model bias. More expensive but more reliable for high-stakes decisions.
204
205
2. **Hierarchical evaluation**: Use a fast cheap model for screening and an expensive model for edge cases. Requires calibration of the screening threshold.
206
207
3. **Human-in-the-loop**: Automate clear cases and route low-confidence decisions to human review. Design feedback loops to improve automated evaluation over time.
208
209
## Examples
210
211
### Example 1: Direct Scoring for Accuracy
212
213
**Input**:
214
```
215
Prompt: "What causes seasons on Earth?"
216
Response: "Seasons are caused by Earth's tilted axis. As Earth orbits the Sun,
217
different hemispheres receive more direct sunlight at different times of year."
218
Criterion: Factual Accuracy (weight: 1.0)
219
Scale: 1-5
220
```
221
222
**Output**:
223
```json
224
{
225
"criterion": "Factual Accuracy",
226
"score": 5,
227
"evidence": [
228
"Correctly identifies axial tilt as primary cause",
229
"Correctly explains differential sunlight by hemisphere",
230
"No factual errors present"
231
],
232
"justification": "Response accurately explains the cause of seasons with correct
233
scientific reasoning. Both the axial tilt and its effect on sunlight distribution
234
are correctly described.",
235
"improvement": "Could add the specific tilt angle (23.5 degrees) for completeness."
236
}
237
```
238
239
### Example 2: Pairwise Comparison with Position Swap
240
241
**Input**:
242
```
243
Prompt: "Explain machine learning to a beginner"
244
Response A: [Technical explanation with jargon]
245
Response B: [Simple analogy-based explanation]
246
Criteria: ["clarity", "accessibility"]
247
```
248
249
**First Pass (A first)**:
250
```json
251
{ "winner": "B", "confidence": 0.8 }
252
```
253
254
**Second Pass (B first)**:
255
```json
256
{ "winner": "A", "confidence": 0.6 }
257
```
258
(Note: Winner is A because B was in first position)
259
260
**Mapped Second Pass**:
261
```json
262
{ "winner": "B", "confidence": 0.6 }
263
```
264
265
**Final Result**:
266
```json
267
{
268
"winner": "B",
269
"confidence": 0.7,
270
"positionConsistency": {
271
"consistent": true,
272
"firstPassWinner": "B",
273
"secondPassWinner": "B"
274
}
275
}
276
```
277
278
### Example 3: Rubric Generation
279
280
**Input**:
281
```
282
criterionName: "Code Readability"
283
criterionDescription: "How easy the code is to understand and maintain"
284
domain: "software engineering"
285
scale: "1-5"
286
strictness: "balanced"
287
```
288
289
**Output** (abbreviated):
290
```json
291
{
292
"levels": [
293
{
294
"score": 1,
295
"label": "Poor",
296
"description": "Code is difficult to understand without significant effort",
297
"characteristics": [
298
"No meaningful variable or function names",
299
"No comments or documentation",
300
"Deeply nested or convoluted logic"
301
]
302
},
303
{
304
"score": 3,
305
"label": "Adequate",
306
"description": "Code is understandable with some effort",
307
"characteristics": [
308
"Most variables have meaningful names",
309
"Basic comments present for complex sections",
310
"Logic is followable but could be cleaner"
311
]
312
},
313
{
314
"score": 5,
315
"label": "Excellent",
316
"description": "Code is immediately clear and maintainable",
317
"characteristics": [
318
"All names are descriptive and consistent",
319
"Comprehensive documentation",
320
"Clean, modular structure"
321
]
322
}
323
],
324
"edgeCases": [
325
{
326
"situation": "Code is well-structured but uses domain-specific abbreviations",
327
"guidance": "Score based on readability for domain experts, not general audience"
328
}
329
]
330
}
331
```
332
333
## Guidelines
334
335
1. **Always require evidence before scores** - Evidence-first prompts make judgments easier to audit and reduce ungrounded numeric scoring
336
337
2. **Always swap positions in pairwise comparison** - Single-pass comparison is corrupted by position bias
338
339
3. **Match scale granularity to rubric specificity** - Don't use 1-10 without detailed level descriptions
340
341
4. **Separate objective and subjective criteria** - Use direct scoring for objective, pairwise for subjective
342
343
5. **Include confidence scores** - Calibrate to position consistency and evidence strength
344
345
6. **Define edge cases explicitly** - Ambiguous situations cause the most evaluation variance
346
347
7. **Use domain-specific rubrics** - Generic rubrics produce generic (less useful) evaluations
348
349
8. **Validate against human judgments** - Automated evaluation is only valuable if it correlates with human assessment
350
351
9. **Monitor for systematic bias** - Track disagreement patterns by criterion, response type, model
352
353
10. **Design for iteration** - Evaluation systems improve with feedback loops
354
355
## Gotchas
356
357
1. **Scoring without justification**: Scores lack grounding and are difficult to debug. Always require evidence-based justification before the score.
358
359
2. **Single-pass pairwise comparison**: Position bias corrupts results when positions are not swapped. Always evaluate twice with swapped positions and check consistency.
360
361
3. **Overloaded criteria**: Criteria that measure multiple things at once produce unreliable scores. Enforce one criterion = one measurable aspect.
362
363
4. **Missing edge case guidance**: Evaluators handle ambiguous cases inconsistently without explicit instructions. Include edge cases in rubrics with clear resolution rules.
364
365
5. **Ignoring confidence calibration**: High-confidence wrong judgments are worse than low-confidence ones. Calibrate confidence to position consistency and evidence strength.
366
367
6. **Rubric drift**: Rubrics become miscalibrated as quality standards evolve or model capabilities improve. Schedule periodic rubric reviews and re-anchor score levels against fresh human-annotated examples.
368
369
7. **Evaluation prompt sensitivity**: Minor wording changes in evaluation prompts can cause material score swings. Version-control evaluation prompts and run regression tests before deploying prompt changes.
370
371
8. **Uncontrolled length bias**: Longer responses systematically score higher even when conciseness is preferred. Add explicit length-neutrality instructions to evaluation prompts and validate with length-controlled test pairs.
372
373
## Integration
374
375
This skill owns judge design and bias mitigation. Adjacent skills own broader quality gates and infrastructure:
376
377
- `evaluation`: general deterministic checks, regression suites, quality gates, and production monitoring.
378
- `context-fundamentals`: context structure for judge prompts.
379
- `tool-design`: schemas and error handling for evaluation tools.
380
- `context-optimization`: token and latency efficiency for high-volume evals.
381
- `harness-engineering`: locked evaluator surfaces and governance for autonomous loops.
382
383
## References
384
385
Internal reference:
386
- [LLM-as-Judge Implementation Patterns](./references/implementation-patterns.md) - Read when: building an evaluation pipeline from scratch or integrating LLM judges into CI/CD
387
- [Bias Mitigation Techniques](./references/bias-mitigation.md) - Read when: evaluation results show inconsistent or suspicious scoring patterns
388
- [Metric Selection Guide](./references/metrics-guide.md) - Read when: choosing statistical metrics to validate evaluation reliability
389
- [Evaluation Pipeline Diagram](./references/evaluation-pipeline.md) - Read when: designing the architecture of a multi-stage evaluation system
390
391
External research:
392
- [Eugene Yan: Evaluating the Effectiveness of LLM-Evaluators](https://eugeneyan.com/writing/llm-evaluators/) - Read when: surveying the state of the art in LLM evaluation
393
- [Judging LLM-as-a-Judge (Zheng et al., 2023)](https://arxiv.org/abs/2306.05685) - Read when: understanding position bias and MT-Bench methodology
394
- [G-Eval: NLG Evaluation using GPT-4 (Liu et al., 2023)](https://arxiv.org/abs/2303.16634) - Read when: implementing chain-of-thought evaluation scoring
395
- [Large Language Models are not Fair Evaluators (Wang et al., 2023)](https://arxiv.org/abs/2305.17926) - Read when: diagnosing systematic bias in evaluation outputs
396
397
Related skills in this collection:
398
- evaluation - Foundational evaluation concepts
399
- context-fundamentals - Context structure for evaluation prompts
400
- tool-design - Building evaluation tools
401
402
---
403
404
## Skill Metadata
405
406
**Created**: 2025-12-24
407
**Last Updated**: 2026-05-15
408
**Author**: Agent Skills for Context Engineering Contributors
409
**Version**: 2.1.0
410

© Context Engineering Agent Skills Contributors · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,587 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen, realistic-person

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…