Sub topic 11
Keeping summaries faithful to the source
This chapter assumes you can write basic Python, have sent prompts to an LLM through an API, and know what tokens are. You should also have read the chapters on map-reduce and refine summarisation, because the failure modes below depend on how those pipelines pass text between calls.
A summary is faithful when every claim in it is supported by the source. An unfaithful summary may still read well, which is why it is dangerous. Models fill gaps with plausible details, and multi-step pipelines give those details more chances to appear.
Common faithfulness failures
| Failure | What it looks like | Typical cause |
|---|---|---|
| Fabrication | A number, name or date that is not in the source | The model completes a pattern from its training data |
| Distortion | "May cause" becomes "causes" | Paraphrase drops hedges and qualifiers |
| Omission | A key caveat or conclusion is missing | Chunking, length limits, or middle-of-input neglect |
| Attribution error | A claim is credited to the wrong person | Merging sections that mention several people |
| Compounding drift | Small errors grow across stages | Summarising summaries in map-reduce or refine |
Compounding drift deserves attention. In map-reduce, the reduce step never sees the original text. If a map call distorts a claim, the reduce call treats the distorted version as fact. Refine has the same issue, and it also lets early details fade as the running summary is rewritten.
Reduce errors with prompt constraints
Constraints in the prompt lower the rate of fabrication, though they do not remove it. The prompts in the earlier code already say "Use only information in the text". Add more:
- Say what to do when information is missing: "If the text does not say, write 'not stated'."
- Ask the model to keep qualifiers such as "may", "approximately" and "preliminary".
- Ask for names, numbers and dates to be copied exactly.
- For high-stakes use, ask for a short supporting quote with each claim, so a reader can verify it.
Set temperature low (0 or close to it) for summaries. Higher values add variety, which here means more room for invention.
Check the summary against the source
Prompts reduce errors, but a separate check finds the ones that remain. A common approach is to split the summary into claims and ask a model whether each claim is supported by the source text. This works best when the check call is short and sees only one claim and the relevant source.
def check_claims(summary, source_chunks, call_llm):
claims = [line.strip('-• ').strip()
for line in summary.splitlines() if line.strip()]
source = '\n\n'.join(source_chunks)
results = []
for claim in claims:
prompt = (
'Source text:\n' + source +
'\n\nClaim: ' + claim +
'\n\nIs the claim fully supported by the source text? '
'Answer SUPPORTED or UNSUPPORTED, then give one sentence of reason.'
)
verdict = call_llm(prompt).strip().upper().startswith('SUPPORTED')
results.append((claim, verdict))
return resultsThis function sends the whole source with every claim, so it only works when the source fits in the context window. For longer documents, retrieve the few chunks most related to each claim, for example by keyword overlap or embedding similarity, and pass only those.
Note that 'UNSUPPORTED'.startswith('SUPPORTED') is false, so the check correctly separates the two answers. A plain substring test for "SUPPORTED" would not.
Practical habits
- Keep chunk summaries and attach them to the final result, so a reader can trace a claim back to its section.
- Prefer extractive details, such as exact figures and quotes, for facts that must not change.
- Spot-check a sample of summaries by hand, focusing on numbers, negations and named people.
- When the reduce step must combine many partials, tell it not to add anything that is absent from them.
Exercise
A map-reduce pipeline produces a final summary that says a drug "reduces symptoms". The source chunk said it "may reduce symptoms in some patients". At which stage did the distortion most likely occur, and name two ways to reduce it.
Show answer
It most likely occurred in a map call (or in reduce, if the map output was already hedged), where paraphrase dropped the qualifier. Because the reduce step never sees the source, it cannot restore the hedge. Two fixes: instruct every stage to keep qualifiers such as "may" and "in some patients", and run a claim check that compares the final summary against the source chunks to flag unsupported or overstated claims.