After this chapter you will be able to
separate extractive from abstractive summarisation and say what each can and cannot do;
measure how extractive a corpus is and use it to decide what a model must learn;
choose between truncation, sparse attention and hierarchical summarisation for a long input;
explain teacher forcing, exposure bias and the loss mask;
rank sentences with a frequency score, score four candidates with ROUGE, and see where two cheap faithfulness checks fail.
say why ROUGE does not measure faithfulness and what does.
This chapter builds on Chapters 19, 23 and 20, which supply the models, the metrics and the controls.
Translation has a target, in that two competent translators produce texts that say the same thing, even when the wording differs. Summarisation does not work that way, because two competent people summarising the same article will disagree about what mattered and both can be right. That makes it the hardest generation task to evaluate, and a good one to study. Four problems from Part V meet in it. A decoder must choose its words, and the choice can drift from the source. A summary can read well and still say something the source did not. ROUGE can score it highly anyway. And a long document may not fit in the context window. Each gets a section below.
The word covers two different problems, and they should be separated.
| extractive | abstractive | |
|---|---|---|
| what it does | selects sentences from the source | generates new text |
| can it hallucinate? | no, by construction | yes |
| how it reads | disjointed | fluent |
| what it is | a ranking problem | a generation problem |
Extractive summarisation cannot state anything the source did not, which is a guarantee no generative system can offer, and it reads badly because sentences lifted out of context do not join up. Abstractive summarisation reads well and can compress genuinely, saying in one clause what the source took a paragraph to say, and it can also state things the source never said. Transformers made abstractive summarisation practical and made faithfulness the central problem, and those two facts are the same fact.
This is the part most often skipped and it changes everything downstream, because two datasets dominate the literature and they are not the same task. CNN/DailyMail pairs news articles with their bullet-point highlights, and those highlights are largely extractive, since most of their content appears near-verbatim in the first few sentences of the article. XSum pairs BBC articles with their one-sentence opening summary, which is written to be genuinely abstractive and often states something no single sentence of the article states.
Three consequences follow. A model tuned on one transfers poorly to the other, because they reward different behaviour. On CNN/DailyMail a lead-sentence baseline, which simply returns the first few sentences, is competitive, so if your model cannot beat it then you have not established that it learned anything. And hallucination rates on XSum are far higher, which is not a defect of the models, because the dataset asks for statements not present in the source and a model that obliges will sometimes oblige incorrectly.
The practical rule is short. Before choosing a model, measure how extractive your target summaries are, because that number tells you what you are actually training.
The practical rule above needs a number, and the simplest one is the share of summary bigrams that appear in the source. Take a source sentence the council approved the new budget on tuesday after a long debate and two candidate summaries.
| summary | bigrams in the source | share |
|---|---|---|
| council approved new budget | 2 of 3 | 0.667 |
| the council approved the new budget | 5 of 5 | 1.000 |
| lawmakers back spending plan | 0 of 3 | 0.000 |
The first summary has two bigrams from the source, council approved and new budget, and one that joins them, approved new, which the source does not contain. The second is a lead-style extract and scores one. The third says the same thing in new words and scores zero, although a reader would call it correct. A corpus whose summaries score near one is an extractive task, and a lead baseline will be hard to beat. A corpus near zero is abstractive, and it is where faithfulness errors appear.
Extractive summarisation is a ranking problem, and the simplest ranker scores each sentence by how often its content words recur in the article. A sentence made of words the article keeps returning to is probably about the article’s topic. Content words are what remains after dropping function words such as the, of and by. Take an article of seven sentences.
| sentence | |
|---|---|
| S1 | Heavy rain fell across the region on Tuesday. |
| S2 | The city council approved a new budget after a long debate. |
| S3 | The budget raises spending on roads by 12 percent. |
| S4 | Council members from the northern wards argued that the increase was too small. |
| S5 | Residents had asked for repairs to the bridge for three years. |
| S6 | The mayor said the first repairs will begin in March. |
| S7 | A public meeting on the plan will be held next month. |
Three content words occur twice in the article, budget, council and repairs, and every other content word occurs once. The score of a sentence is the sum of its words’ counts divided by the number of content words, and the division stops a long sentence from winning on length alone.
| sentence | content words | sum of counts | score |
|---|---|---|---|
| S1 | 6 | 6 | 1.000 |
| S2 | 6 | 8 | 1.333 |
| S3 | 6 | 7 | 1.167 |
| S4 | 8 | 9 | 1.125 |
| S5 | 6 | 7 | 1.167 |
| S6 | 6 | 7 | 1.167 |
| S7 | 5 | 5 | 1.000 |
The best sentence is S2 at . Three sentences then tie at , and as with the BPE merges of Chapter 5 a tie needs a rule or the run cannot be reproduced. Here the earlier sentence wins, so the summary is S2 followed by S3. The lead baseline takes S1 and S2, and S1 is about the weather, which is why the lead does badly on this article. Whether the scored summary is actually better is a question for a metric, and the evaluation section below scores both.
Two shapes are available and both are in Chapter 19. An encoder-decoder reads the document with a bidirectional encoder and writes with a causal decoder, so the encoder sees the whole source at once. This is the natural fit and what the architecture was designed for. A decoder-only model puts the document and the summary in one sequence and continues it, which is what a general instruction-tuned model does when you ask it to summarise.
The encoder-decoder shape has the better inductive bias and needs fine-tuning, while the decoder-only shape needs no fine-tuning at all and arrives already competent, which usually wins on engineering grounds. Pretraining objective matters more than shape, though, since models pretrained by reconstructing corrupted spans of text and not by predicting the next token transfer to summarisation better, because span reconstruction is the same operation summarisation performs.
Chapter 17 established that attention costs in the sequence length, and summarisation is where that bill arrives. A news article fits in a few hundred tokens, a scientific paper is five to ten thousand, a transcript or a legal filing is longer still, and many checkpoints cap at 512 or 1024.
There are three responses, each with a cost. Truncation is cheap and silently discards the tail of the document, which on news is nearly free because news is written with the important part first, and on a paper removes the results. Sparse attention, as in Longformer (whose encoder-decoder variant is LED) and BigBird, has each position attend to a local window plus a few global positions. This brings the cost back to roughly linear and buys length at some cost in quality. And hierarchical summarisation summarises chunks and then summarises the summaries, which handles any length and compounds errors, because a mistake in a chunk summary is invisible at the next level.
Take a transcript of tokens, a model that reads tokens at a time, and a chunk summary of tokens.
| level | input tokens | chunks | output tokens |
|---|---|---|---|
| 1 | 30,000 | 6 | 3,000 |
| 2 | 3,000 | 1 | 500 |
Six chunks give six summaries of tokens, which together are tokens and fit in one window, so a single further call writes the final summary. That is two levels and seven model calls. Each level shrinks the text by a factor of ten, so the number of levels grows with the logarithm of the length and the cost is rarely the problem. Faithfulness is. If each step keeps per cent of the claims it was given, then survive one level, survive two and survive four, because the losses multiply. The second level also reads six summaries and cannot tell which of them contains a mistake.
Measure the length distribution of your inputs and your targets before you set the truncation limits. Truncating inputs is visible, since you know you did it, whereas truncating targets is silent and it is a common bug.
A target cut at the limit teaches the model to stop early, and the loss looks fine throughout training because the model is correctly predicting a truncated target. The failure only appears at generation time, as summaries that end mid-thought.
Training is the cross-entropy of Chapter 11, with two details that matter. Mask the loss, because padding tokens must not contribute, and an unmasked loss over a heavily padded batch is mostly measuring the model’s ability to predict padding, which will look encouragingly low. And teacher forcing feeds the decoder the correct previous token at each step and not its own prediction, which makes training parallel and stable and introduces the problem below.
A batch of four summaries has , , and text tokens, each padded to .
| summary | text tokens | padding |
|---|---|---|
| 1 | 62 | 38 |
| 2 | 48 | 52 |
| 3 | 90 | 10 |
| 4 | 40 | 60 |
| total | 240 | 160 |
That is text tokens among positions, so per cent of the positions are padding. Suppose a text token costs nats and a padding token costs nothing, because it is trivially predictable. Averaged over every position the unmasked loss is , while the masked loss, averaged over the text tokens only, is . The unmasked curve reads per cent lower than the model deserves. It falls further whenever a batch is padded more heavily, and that is a change in the data pipeline that says nothing about the model.
The mismatch is exact. During training every previous token the model sees is correct. During generation the model consumes its own output. The model has never been trained on the distribution it faces at inference, and one early error shifts the context for everything after it. The model has no experience of recovering from its own mistakes, because in training it never made any.
Three partial remedies exist and none is a cure. Label smoothing stops the model becoming over-confident, which makes it less brittle when the context is unfamiliar, scheduled sampling occasionally feeds the model’s own predictions during training, and sequence-level fine-tuning optimises against the evaluation metric, not per-token likelihood.
Exposure bias is also the cleanest reason decoding matters here, since sampling at high temperature compounds it, because an unlikely token early is a corrupted context for everything that follows. Summarisation wants the low-entropy end of Chapter 20’s table.
Chapter 23 covered ROUGE, the standard here, and two things matter about using it. Evaluate with generation, not loss, because validation loss measures next-token prediction under teacher forcing, which is not the task, so generate summaries and score them. This is slower, and it is the number that matters, since watching loss alone means watching a quantity that improves while the thing you care about does not, and Chapter 23 named that failure.
ROUGE rewards overlap, and overlap is not faithfulness, so a summary can score well and state something false while a correct paraphrase can score near zero, as Chapter 23 showed with the feline rests upon the rug. For summarisation the gap is specific and it has a name. Faithfulness is whether every claim in the summary is supported by the source, and ROUGE does not measure it, cannot measure it, and a system tuned on ROUGE alone will drift away from it.
Measuring faithfulness needs a different instrument, whether entailment models asking whether the source entails each summary sentence, question-answering consistency checks, or human annotation. All three are more expensive than ROUGE, so ROUGE is still reported.
Score four summaries of the article above against the reference the council approved a budget that raises road spending by 12 percent, and repairs will begin in March, which has words. The first two candidates are the lead baseline and the frequency summary. The third is a faithful paraphrase, lawmakers passed a spending plan that puts 12 percent more into roads, and work starts in March. The fourth is a copy of the reference with one number wrong, in place of . ROUGE- counts overlapping -grams, clipped as in Chapter 23, and its F-score reduces to a short form. With overlapping -grams, a candidate with of them and a reference with , precision is , recall is and .
| candidate | words | R-1 overlap | R-1 | R-2 overlap | R-2 |
|---|---|---|---|---|---|
| lead-2 | 19 | 5 | 0.270 | 2 | 0.114 |
| frequency-2 | 20 | 10 | 0.526 | 4 | 0.222 |
| faithful paraphrase | 17 | 8 | 0.457 | 2 | 0.121 |
| wrong number | 18 | 17 | 0.944 | 15 | 0.882 |
The frequency summary beats the lead baseline, against , and that gap is the margin a trained system has to improve on. The faithful paraphrase scores , below the frequency summary that only copies. The candidate with the wrong number scores , the highest in the table, because it differs from the reference in one word. ROUGE ranks the summary that states a falsehood first.
Two checks run without a model. The first flags content words in the summary that never occur in the source, and the second flags numbers that do not. A third summary, residents approved the first repairs on Tuesday, joins the two above.
| summary | novel content words | unsupported numbers |
|---|---|---|
| faithful paraphrase | lawmakers, passed, puts, work, starts | none |
| wrong number | road, 21 | 21 |
| wrong claim | none | none |
The number check is narrow and exact, and it catches the . The word check raises a false alarm on every paraphrase, and on road, a plural that lost its s. The third summary passes both checks, because every word in it appears in the article and it contains no number, yet the article never says that residents approved anything. Catching it needs a model that reads the source and the claim together, which is the entailment test described above, and a person to audit that model on a sample.
Run it.
code/worked_examples/summarization.pyproduces every table in this chapter.--extractranks the sentences,--rougescores the four candidates,--faithfulruns the two checks,--longbuilds the hierarchy and--maskcompares the two losses.
The chapter has assumed you are training a model, and often you should not. A general instruction-tuned model summarises well with no training at all, which is Chapter 20’s point, and fine-tuning pays for itself when you need a specific style, a specific length, a specific domain vocabulary or an on-premises model.
When you do fine-tune, Chapter 25 applies unchanged, where LoRA at rank 8 trains four tenths of one per cent of the weights, which is usually enough for a task this close to what the model already does. The order to work in is Chapter 20’s hierarchy. Prompt first, measure, and fine-tune only when you can say what prompting failed to achieve.
Summary
Summarisation has no single right answer, so it is hard to evaluate, and it brings together four problems from Part V: decoding, faithfulness, evaluation and long inputs. Extractive summaries select sentences, for example by a frequency score, and cannot state anything the source did not. Abstractive summaries read well and can hallucinate. The dataset decides the task, so measure how extractive the targets are before choosing a model, and beat a lead baseline. Long inputs meet the quadratic cost of attention, and truncation, sparse attention and hierarchical summarisation each pay a different price. Training masks the loss on padding and uses teacher forcing, which leaves exposure bias, so decoding should be low-entropy. Evaluate by generation, because loss is not the task, and remember that ROUGE rewards overlap instead of faithfulness: a summary with one number changed scored , above every honest candidate. Cheap checks catch a wrong number and miss a false claim built from the source’s own words. Prompt first and fine-tune only when you can say what prompting failed to achieve.
Key terms
extractive summarisation. selecting sentences from the source.
abstractive summarisation. generating new text that conveys the source.
lead baseline. a summary made of the first few sentences of the source.
faithfulness. the property that every claim in a summary is supported by the source.
exposure bias. the mismatch between training on gold prefixes and generating from the model’s own.
Lin (2004) is ROUGE, and its limitations are best read alongside Zhang et al. (2020). Lewis et al. (2020) introduced the denoising pretraining that transfers so well here. Jurafsky and Martin (2025) cover both extractive and abstractive summarisation with more task detail.
26.1 Bigram share by hand. For the source the council approved the new budget on tuesday after a long debate, compute the share of source bigrams in the summary the council approved a budget. Say whether it is extractive.
26.2 Hierarchy by hand. A transcript is tokens and the model reads at a time, writing tokens per chunk summary. How many levels of summarisation are needed, and how many model calls?
26.3 Compounding faithfulness. If each summarisation step keeps per cent of the claims faithful, what share of claims in the final summary is faithful after three levels?
26.4 The ROUGE shortcut. A candidate of words shares unigrams with a reference of words. Compute ROUGE-1 precision, recall and , and check that .
Build and measure
26.5 Measure your dataset. For a summarisation corpus of your choice, compute what fraction of summary bigrams appear verbatim in the source. Compare it against a lead-sentence baseline’s ROUGE. What does the gap tell you about what a trained model would have to learn?
26.6 Rank by frequency. Implement the frequency score of this chapter and pick the two best sentences, breaking ties by position. Run it and the lead-2 baseline over a hundred articles of a corpus you choose, and report the difference in mean ROUGE-1 . State when the lead baseline wins.
26.7 Beat the lead baseline. Implement the baseline that returns the first three sentences and score it. Then argue what a model must do to justify its cost, and state the margin you would require.
26.8 The silent truncation. Explain why truncating targets produces a training loss that looks healthy while generation fails. Describe the check you would add to a training script to make the bug loud.
26.9 Exposure bias, concretely. Trace what happens when a decoder generates one wrong token at position three of a twenty-token summary. Explain why teacher forcing gives the model no experience of this, and say which of the three remedies addresses it most directly.
In practice
26.10 Two metrics disagree. Construct a summary that scores well on ROUGE and is unfaithful to its source, and one that is faithful and scores poorly. Then describe an evaluation that separates them.
26.11 Choose the architecture. You must summarise ten-thousand-token legal filings, on-premises, in a fixed house style. Work through the choices in this chapter: extractive or abstractive, encoder-decoder or decoder-only, truncate or sparse or hierarchical, prompt or fine-tune. Justify each, and name the one you are least sure about.
26.12 The cheap checks at scale. Run the number check and the novel-word check over the twenty summaries of the next problem. Count how many unsupported claims each check finds, how many false alarms it raises, and how many claims neither finds.
26.13 Faithfulness check. Take twenty summaries from a model and check each claim against the source by hand. Report the share of unsupported claims, and say how ROUGE scored those summaries.
26.14 Prompt or fine-tune? A team needs summaries in a fixed house style at low latency. Describe the experiment that decides between prompting and fine-tuning, and what result would make you fine-tune.
26.15 Mask the loss. A batch has summaries of tokens padded to . Estimate what share of an unmasked loss comes from padding, and say what the training curve would look like.
Each one reproduces the tables above. Run it in the page, change an input and watch which numbers move.
summarization.pyExtractive scores, ROUGE and a false claim
One six-sentence article summarised three ways, scored by ROUGE, checked for faithfulness by two cheap tests, then pushed through a long-input hierarchy and a padded loss.
runs in your browser Run itFrom Natural Language Processing: From Corpus Statistics to Grounded LLMs, by Ramaseshan Ramachandran.