Sub topic 8
Human evaluation and labeling guidelines
This chapter assumes you can write basic Python, have called an LLM through an API, and know the mean and proportion from statistics. It also assumes you have an evaluation harness like the one from the earlier chapter. Here you will learn when to use human reviewers, how to write labeling guidelines, and how to check that reviewers agree.
Why humans still matter
Programmatic checks and LLM judges are cheap, but they only approximate what you care about. Human review is the reference they are measured against. Use people when:
- The quality criterion is subjective, such as tone or helpfulness.
- You need ground truth to validate an LLM judge.
- You are starting out and do not yet know what failures look like.
Human review is slow and costly. Plan to label a small, carefully chosen sample, not the whole dataset.
Write the guidelines first
Two reviewers who read the same vague instruction will label the same output differently. A good guideline has these parts:
- One criterion per question, for example "Is every claim supported by the context?"
- A fixed label set, such as PASS and FAIL, or a 1–3 scale with each level defined.
- Worked examples for each label, including borderline cases.
- A rule for unclear cases, such as "If you cannot decide, mark UNSURE and add a note."
Prefer binary or small scales. A 1–10 scale produces noise because reviewers use it differently.
Run the labeling process
Start with a pilot of 20 to 30 items labeled by at least two people. Discuss each disagreement. Most disagreements point to a gap in the guidelines, not a careless reviewer.
Measure agreement
Raw agreement is the fraction of items where two reviewers give the same label. It looks better than it is, because reviewers will agree by chance. If 90% of outputs are good, two reviewers who label almost everything PASS will agree often without reading closely.
Cohen's kappa corrects for this. It compares observed agreement to the agreement expected by chance. A value of 1 is perfect agreement and 0 is chance level.
def cohens_kappa(labels_a, labels_b):
n = len(labels_a)
observed = sum(a == b for a, b in zip(labels_a, labels_b)) / n
categories = set(labels_a) | set(labels_b)
expected = sum(
(labels_a.count(c) / n) * (labels_b.count(c) / n)
for c in categories
)
if expected == 1:
return 1.0
return (observed - expected) / (1 - expected)
a = ["PASS", "PASS", "FAIL", "PASS", "FAIL", "PASS", "PASS", "FAIL"]
b = ["PASS", "PASS", "FAIL", "FAIL", "FAIL", "PASS", "PASS", "PASS"]
print(round(cohens_kappa(a, b), 2)) # 0.47Here raw agreement is 6 of 8, or 0.75, but kappa is only 0.47. A common rough reading treats values above 0.6 as substantial agreement. Treat that as a guide, not a rule.
Common errors
- Labeling without guidelines. Reviewers invent their own standards, and the labels cannot be reused.
- Showing the model's score to reviewers. This anchors their judgment. Hide scores and model identity.
- A single reviewer for everything. You cannot detect inconsistency without overlap. Have a second reviewer label at least a subset.
- Never updating the guidelines. Add new borderline cases as you find them, and keep a version number so old labels stay interpretable.
Store each label with the reviewer ID, guideline version, and any notes. Later chapters use these labels to check an LLM judge.
Exercise
Two reviewers label 100 outputs. Both mark 95 as PASS. They agree on 94 of the 100 outputs. Why might a high raw agreement of 94% still hide a problem, and which statistic would you compute next?
Show answer
Because nearly every label is PASS, the reviewers would agree often by chance alone, so 94% overstates real agreement. Compute Cohen's kappa, which subtracts the agreement expected by chance. Also review the FAIL cases directly, since those are where the reviewers' judgment matters most.