Advanced Text Summarization: Faithfulness and Controllability
Module: Natural Language Processing | Difficulty: Advanced
What You'll Learn
- 1Separate extractive and abstractive summarization and the failure modes of each
- 2Compute ROUGE precision, recall, and F1 for an n-gram overlap
- 3Measure factual consistency as supported claims over total claims
- 4Apply lexical and length constraints during controlled decoding
A summary is useful only when it is short, relevant, and true. Modern abstractive systems handle the first two reliably and the third unreliably, which is why this lesson spends more time on faithfulness than on fluency. It also treats control as a first class requirement, since a summary that cannot be pinned to a target length, a set of keywords, or a reading level fails a product spec even when it scores well on a benchmark.
Extraction and Abstraction
An extractive summarizer selects sentences from the source and reorders them. It cannot invent a fact, because every output span exists verbatim in the input, and the standard heuristic scores sentences by a combination of centrality, position, and connectivity:
The limit is that extracted sentences carry their original connectives and local context, so a document about a merger yields a summary that reads like a list of quotations.
An abstractive summarizer generates new tokens conditioned on the source:
The gain is fluency and compression. The risk is that nothing constrains a generated token to appear in the source, so the model can complete a plausible continuation that the document never states.
ROUGE and Its Limits
ROUGE scores n-gram overlap between a candidate and a reference summary. For a unigram set the precision, recall, and F1 are:
ROUGE-2 uses bigrams and ROUGE-L uses the longest common subsequence, which rewards keeping word order intact. A single reference makes all three noisy: two equally good summaries of the same article share different words, and the metric punishes the second one.
| Benchmark | Pairs or articles | Reference style | Dominant metric |
|---|---|---|---|
| CNN/DailyMail | about 300,000 | multi sentence highlights | ROUGE-1, ROUGE-2, ROUGE-L |
| XSum | 226,711 | single sentence, abstracted | ROUGE-1, ROUGE-2, ROUGE-L |
| SAMSum | about 16,000 | chat dialogue summaries | ROUGE-L |
| MultiNews | about 56,000 | multi document summaries | ROUGE-1, ROUGE-L |
XSum shows the metric problem clearly. Its references are single sentences written from scratch, so they are aggressively abstractive, and models trained to imitate them inherit that behavior. An analysis of XSum outputs found 64.1 percent of generated summaries containing extrinsic hallucination, meaning content absent from the source, against 26.9 percent judged fully faithful, while even gold references contained intrinsic contradictions in 7.4 percent of cases.
Measuring Faithfulness
Decompose the summary into atomic claims and check each one against the source with an entailment model or a question answering test:
Entailment based checkers report precision of the summary claims, while question answering based checkers ask the question implied by each claim and compare the answer with the source answer. The two disagree on numeric and attributive claims, so production systems often run both and flag any claim that either one rejects.
Hallucination is reported as the complement on a sampled audit:
Reporting an aggregate faithfulness number without the claim decomposition hides whether errors are concentrated in numbers, named entities, or causal connectives, and those three call for different fixes.
Controlling the Output
Control comes from constraints applied during decoding. A required keyword set can be enforced with a coverage mask that keeps a token allowed only until every required term has appeared:
Length control uses a remaining-budget term added to the logits so that the model is discouraged from opening a new clause once the budget is spent. Combining both gives a joint objective:
Every constraint has a price. Tightening the coverage weight produces summaries that mention all requested topics in a flat register, and tightening the faithfulness weight produces summaries that quote the source instead of compressing it. The tuning question is which failure the product tolerates.
Worked Examples
Worked Code
from collections import Counter
def rouge_n(reference, candidate, n):
ref = [tuple(reference[i:i + n]) for i in range(len(reference) - n + 1)]
can = [tuple(candidate[i:i + n]) for i in range(len(candidate) - n + 1)]
overlap = sum((Counter(ref) & Counter(can)).values())
precision = overlap / len(can) if can else 0.0
recall = overlap / len(ref) if ref else 0.0
f1 = 2 * precision * recall / (precision + recall) if precision + recall else 0.0
return round(precision, 3), round(recall, 3), round(f1, 3)
reference = "the committee approved the budget on tuesday".split()
candidate = "the committee approved the budget".split()
print("ROUGE-1", rouge_n(reference, candidate, 1))
print("ROUGE-2", rouge_n(reference, candidate, 2))
def greedy_extract(sentences, words, required):
picked, covered, budget = [], set(), words
order = sorted(range(len(sentences)), key=lambda i: len(sentences[i].split()))
for i in order:
tokens = set(sentences[i].split())
if len(sentences[i].split()) > budget:
continue
gain = len(tokens & (required - covered))
if gain == 0 and covered >= required:
continue
picked.append(i)
covered |= tokens
budget -= len(sentences[i].split())
return [sentences[i] for i in sorted(picked)], sorted(covered & required)
sentences = [
"the committee approved the budget",
"growth slowed in the second quarter",
"the board will meet again in march",
]
required = {"budget", "growth"}
summary, hit = greedy_extract(sentences, 10, required)
print("summary:", " ".join(summary))
print("required covered:", hit)
Real-World Applications
- News digests - Readers want one accurate sentence per story, so faithfulness audits run before publication rather than after user reports.
- Meeting notes - Action items must preserve owners and deadlines exactly, which makes numeric and attributive claims the audit focus.
- Support ticket clustering - Short descriptions are generated per cluster, and length control keeps them scannable in a queue.
- Legal and medical briefs - Faithfulness weight is set as high as the domain allows, with extraction preferred when any doubt remains.
đĄAudit claims, not sentences
Common Mistakes
Treating ROUGE as a quality score
Fix: ROUGE measures overlap with one reference, so pair it with a faithfulness number and a human rating before drawing conclusions.
Reporting faithfulness only as a mean
Fix: Break the number into contradiction and unsupported rates, because the two demand different remediation.
Adding constraints without re-tuning
Fix: Coverage and faithfulness weights shift the length and style distribution, so re-run the full evaluation after any change.
Best Practices
- Report ROUGE, faithfulness, and length deviation together for every checkpoint
- Keep an extractive fallback for domains where an unsupported claim is unacceptable
- Store the claim level audit alongside the summary so failures can be traced to a sentence
Key Takeaways
- XSum holds 226,711 articles with single sentence references written from scratch
- An audit found 64.1 percent of generated XSum summaries with extrinsic hallucination
- Factual consistency is entailed claims divided by total claims, with hallucination as its complement
- Decoding constraints trade fluency for coverage and must be re-tuned as a unit
Frequently Asked Questions
Why does XSum produce more hallucination than CNN/DailyMail?
Its references are single sentences written in the abstractor's own words, so the training signal rewards rewriting rather than copying. Models learn that style and sometimes rewrite past what the article supports.
Is a higher ROUGE score ever a bad sign?
Yes when it comes from copying. ROUGE rises with overlap, so a near extractive system can outperform a genuinely abstractive one on the metric while losing on compression and readability. Check the extraction ratio alongside the score.
When should a system stay extractive?
When the cost of a wrong claim is high and the source is already well written. Legal, medical, and financial summaries often keep the original sentence and simply select, because selection errors are visible while subtle rewording errors are not.
Interview Questions
Q1: How would you build a faithfulness checker for a summarization pipeline?
Split the summary into atomic claims, run each claim through an entailment model against the source, and separately run a question answering check for numbers and names, then reject the summary if any claim fails either test.
Q2: What does a coverage constraint cost you?
Style. Forced keyword insertion flattens the summary toward a checklist and can push length past target, so the weight needs tuning on human rated outputs rather than on ROUGE alone.