Sub topic 12
Evaluating summary quality
This chapter assumes you can write basic Python, have sent prompts to an LLM through an API, and know roughly what a token is. It also assumes you have read the earlier chapters on summarisation strategies and faithfulness. Here you learn how to tell whether a summary is good, using human review, reference-based metrics, and LLM-based judging, and how to combine them.
Why evaluation is hard
A summary has no single correct answer. Two summaries of the same report can both be good: one for an executive, one for an engineer. Evaluation therefore starts from the goal you set at the beginning: purpose, audience, and length.
Most quality problems fall into four dimensions:
| Dimension | Question | Typical failure |
|---|---|---|
| Faithfulness | Does every claim appear in the source? | Invented numbers, wrong names, reversed conclusions |
| Coverage | Does it include the important points? | Early sections dominate, the middle is skipped |
| Concision | Is it within length and free of repetition? | Padding, restated points after a reduce step |
| Fluency and fit | Is it readable and right for the audience? | Wrong tone, jargon for a lay reader |
Keep these dimensions separate when you score. A single "quality" number hides the trade-offs. A summary can be perfectly faithful and useless because it covers nothing.
Three families of methods
Each family has a different cost and a different blind spot.
| Method | Strength | Weakness | Cost |
|---|---|---|---|
| Human review | Most trustworthy, catches subtle errors | Slow, expensive, raters disagree | High |
| Reference-based metrics | Cheap, repeatable, fast to run | Needs reference summaries, rewards word overlap | Low |
| LLM judge | Scales, needs no reference, handles meaning | Biased, can be wrong, needs calibration | Medium |
The practical approach is to use all three at different scales. Humans score a small sample and set the standard. Cheap automatic checks run on everything. An LLM judge sits between them, validated against the human scores.
Human review
Human review is the reference point for the other methods. To make it useful:
- Write a rubric. Define each dimension with a 1 to 5 scale and an example for each score.
- Show raters the source and the summary together. Faithfulness cannot be judged from the summary alone.
- Ask for specific evidence. A rater who marks a summary unfaithful should quote the unsupported claim.
- Use at least two raters on a subset and measure agreement. If they disagree often, the rubric is unclear, not the raters.
For long documents, human review is costly because the rater must read the source. Reduce the load by scoring claim by claim. Split the summary into sentences, and have the rater mark each as supported, unsupported, or contradicted. A 200-word summary has maybe ten claims, which is much quicker to check than a holistic impression of a 50-page document.
Reference-based metrics
A reference-based metric compares your summary to a human-written reference summary.
- ROUGE counts overlapping words. ROUGE-1 uses single words, ROUGE-2 uses word pairs, and ROUGE-L uses the longest common subsequence. Recall-oriented in origin, it is usually reported as precision, recall, and F1.
- BERTScore compares embeddings of words instead of exact matches, so a paraphrase scores better than under ROUGE.
Here is a small ROUGE-1 implementation so you see exactly what is being measured:
from collections import Counter
def rouge1(candidate, reference):
cand = Counter(candidate.lower().split())
ref = Counter(reference.lower().split())
overlap = sum((cand & ref).values())
precision = overlap / max(sum(cand.values()), 1)
recall = overlap / max(sum(ref.values()), 1)
if precision + recall == 0:
return 0.0, 0.0, 0.0
f1 = 2 * precision * recall / (precision + recall)
return precision, recall, f1
reference = "The council approved the budget and delayed the road project."
good = "The council approved the budget but delayed the road project."
wrong = "The council rejected the budget and approved the road project."
print(rouge1(good, reference))
print(rouge1(wrong, reference))Run this and you will see both candidates score highly, though wrong reverses two facts. That is the central limit of overlap metrics: they measure shared words, not shared meaning.
Other limits to keep in mind:
- You need reference summaries, and for long documents these are expensive to write.
- A single reference penalises valid alternatives. Use several references if you can.
- Scores depend on tokenisation and stemming settings, so compare numbers only when produced by the same tool and configuration.
- Metrics tuned on short news articles may not carry over to long reports.
Use these metrics for regression testing: when you change a prompt or chunk size, a sudden drop on a fixed test set signals something changed. Treat small differences as noise.
LLM-based judging
An LLM judge is a second model call that scores a summary against the source. It handles paraphrase and can check meaning, and it needs no reference.
There are three common designs:
- Scoring against a rubric. Give the source, the summary, and the rubric, and ask for scores per dimension.
- Pairwise comparison. Show two summaries and ask which is better. This is usually more reliable than absolute scores, because models and people compare better than they rate.
- Claim verification. Split the summary into claims, then ask for each claim whether the source supports it. This targets faithfulness directly.
Here is a claim-verification checker. It reuses the call_llm convention from earlier chapters: any function that takes a prompt string and returns text.
import json
def check_claims(source, summary, call_llm):
claims = [s.strip() for s in summary.split('.') if s.strip()]
results = []
for claim in claims:
prompt = (
'You are checking a summary against its source.\n'
'Answer with JSON only: {"verdict": "supported" | "unsupported" | "contradicted", '
'"evidence": "<short quote from the source or empty>"}\n\n'
'SOURCE:\n' + source + '\n\nCLAIM:\n' + claim
)
raw = call_llm(prompt)
try:
data = json.loads(raw)
except json.JSONDecodeError:
data = {'verdict': 'unparsed', 'evidence': raw[:100]}
results.append({'claim': claim, **data})
supported = sum(1 for r in results if r['verdict'] == 'supported')
score = supported / len(results) if results else 0.0
return score, resultsThe sentence split on periods is crude. It breaks on abbreviations and decimals such as "3.5 million". For real use, split with a sentence tokenizer, or ask the model to list the claims first.
For a long source, you cannot always pass the whole document with every claim. Retrieve the passages most similar to the claim, or pass the chunk each claim came from, and note that this makes the check weaker: a claim is "unsupported" only relative to the text you showed the judge.
Known judge biases
- Position bias. In pairwise tests, judges favour the first or second option more than chance. Run each pair twice with the order swapped and count only consistent wins.
- Length bias. Longer summaries often score higher. Control for length or state the limit in the rubric.
- Self-preference. A model may rate its own style higher. Use a different model as judge where possible.
- Format sensitivity. Small changes in the rubric wording can move scores. Keep the judge prompt fixed once calibrated.
Calibrating the judge against humans
An unvalidated judge is only an opinion. Calibrate it:
- Collect 50 to 100 summaries and have humans label them.
- Run the judge on the same items.
- Compare. For binary labels such as supported or unsupported, report agreement and look at false negatives, where the judge missed a real error. For scores, report rank correlation.
- Read the disagreements. They show whether the rubric, the judge prompt, or the human labels are the problem.
Repeat this whenever you change the judge model or the prompt. A judge that agrees well on short news summaries may fail on legal or medical text.
Checking coverage
Faithfulness checks look from the summary to the source. Coverage checks go the other way, from the source to the summary. A common approach:
- Ask a model, or a human, to list the key points of the source, ideally before seeing your summary.
- For each key point, ask whether the summary includes it.
- Report the fraction covered.
For long documents, check coverage by position as well. Divide the source into thirds and note which key points come from each. If the summary rarely mentions points from the middle, you may be seeing the long-context effect from earlier chapters, or a map-reduce step that dropped details. Position-level coverage tells you where in the pipeline to look.
Building an evaluation set
A small, fixed test set makes every other decision measurable.
- Choose 20 to 50 documents that reflect real use: different lengths, topics, and layouts such as tables and lists.
- Include hard cases: documents with many numbers, negations, near-duplicate sections, or conflicting statements.
- Keep a few documents that exceed your context window so chunking strategies are tested.
- Store the human labels and the reference summaries with the documents.
- Freeze the set. Add new documents rather than editing old ones, so past results stay comparable.
Then compare strategies on the same set. A table like this one is the output you want:
| Strategy | Claim support | Key-point coverage | Avg. words | Cost per document |
|---|---|---|---|---|
| Single pass | measured | measured | measured | measured |
| Map-reduce | measured | measured | measured | measured |
| Refine | measured | measured | measured | measured |
Fill each cell from your own runs. Numbers from other people's documents and models are not a reliable guide to yours.
Common mistakes
- Trusting one metric. A high ROUGE score with low claim support means fluent but wrong.
- Judging without the source. A judge that sees only the summary can rate only style.
- Testing on the examples you tuned on. Keep a held-out set for final checks.
- Ignoring variance. Model output changes between runs. Run several times, or at least avoid reading meaning into a one-point difference.
- Averaging away rare failures. One invented figure in a financial summary matters more than ten fluent sentences. Report the count of unsupported claims, not only the mean.
- Evaluating only the final summary. In map-reduce, check the partial summaries too. If errors appear in the partials, fix the map prompt. If they appear only in the final output, fix the reduce step.
Exercises
Exercise
A new prompt raises your ROUGE-1 F1 from 0.42 to 0.47 on your test set, but a claim-verification check shows the share of supported claims fell from 94% to 85%. Which result should drive your decision, and why?
Show answer
The claim-support drop should drive it. ROUGE-1 only measures word overlap with a reference, so it can rise while the summary invents or distorts facts. The fall in supported claims means more statements are not backed by the source, which is a faithfulness regression. Inspect the unsupported claims, then fix the prompt before adopting it.
Exercise
You are comparing two summaries with an LLM judge in a pairwise test, and summary A wins 70% of the time. What should you do before trusting that result?
Show answer
Check for position bias by running every pair twice with the order swapped, and count only wins that hold in both orders. Also check length bias (is A simply longer?), use a judge model different from the one that wrote the summaries if possible, and compare the judge's choices with human labels on a sample.
Exercise
Why is claim-by-claim human review cheaper than a holistic rating for a 50-page document, and what extra step does it need?
Show answer
The rater checks about ten short claims against the source instead of forming an overall impression of the whole document. Each claim is marked supported, unsupported, or contradicted, with a quote as evidence. The extra step is splitting the summary into discrete claims first, and for long sources, locating the relevant passage for each claim.