# Teaching Machines to Read and Comprehend

Machine readers learn to answer questions from news articles using attention

Karl Moritz Hermann, Tomáš Kočiský, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman and 1 more · arXiv · 2015-6-10

- **Problem** Machine reading lacked large labelled training data, since earlier reading comprehension datasets had only hundreds of examples. Without it, models could not be trained at scale to read documents and answer questions.
- **Method** The authors turn news summary bullet points into Cloze queries by replacing entities with abstract markers that are shuffled at every load. Attention-based readers, such as the Attentive Reader, then learn to find the answer in the document.
- **Results** The Attentive Reader reaches 63.0 accuracy on the CNN test split and 69.0 on the Daily Mail test split. These scores beat the simpler Deep LSTM Reader and the heuristic benchmarks.

## From summaries to reading questions

The task is framed as estimating the probability of an answer given a context document and a query about that document. The design deliberately removes outside information such as world knowledge, so that a score reflects how well a model understands the relations between entities in the document itself. Earlier supervised corpora for this task were limited to hundreds of examples, which made them mostly useful for testing.

The new corpora are built from CNN and Daily Mail news articles, with 93k CNN articles and 220k Daily Mail articles collected. Each article comes with bullet-point summaries that are abstractive rather than copied sentences from the article.

The training splits contain 90,266 CNN documents with 380,298 queries and 196,961 Daily Mail documents with 879,450 queries. The splits are separated by time: validation data comes from March 2015 and test data from April 2015, and articles longer than 2000 tokens were filtered out.

## Anonymising entities against shortcuts

Without further steps, a language model trained on the corpus could answer many queries from how often a phrase co-occurs with an entity, regardless of the document. The procedure runs a coreference system over each data point, replaces every entity with an abstract marker according to its coreference cluster, and permutes the markers each time a data point is loaded.

In the example from the Daily Mail validation set, the entity Jeremy Clarkson becomes the marker ent212 in the query, and the answer Oisin Tymon becomes ent193. Because the markers change at every load, a model cannot learn that a fixed name is the answer, and a background-knowledge reader gains nothing from the name itself.

Under this setup the context document is needed to answer the query, so the remaining way to answer is to exploit the context, which the authors take as the measure of reading comprehension. The models do not treat entity markers differently from ordinary words, so they must learn to tell entities and variables apart from the input sequence.

## How far frequency alone goes

Table 2 measures how often the correct answer is among the top N most frequent entities in a document. The correct answer is the most frequent entity in 30.5 percent of CNN cases and 25.6 percent of Daily Mail cases, and it is among the top five entities in 70.6 and 68.1 percent of cases.

Picking the most frequent entity therefore caps out well below full accuracy, so a model has to use the context beyond entity frequency. The split used for Table 2 is not stated in the table, so these shares should not be read as test-set figures.

## Three neural readers and how they use the document

Every neural model scores each word type a in the vocabulary through an exponential of a weight row times a joint embedding of the document and query, as \\( p(a \\mid d,q) \\propto \\exp(W(a)\\, g(d,q)) \\) over the vocabulary. The vocabulary includes the entity markers and the unknown-entity marker, so the answer is chosen among these word types.

The Deep LSTM Reader is the simplest model: it feeds the document one word at a time into a deep LSTM encoder, adds a delimiter, and then feeds the query, so the whole pair becomes one long sequence. Its prediction is read from the final state, which is passed through a linear layer to pick the document token that answers the query.

The Attentive Reader encodes the query and the document with separate bidirectional single-layer LSTMs, and the query encoding is the concatenation of the final forward and backward outputs. Each document token receives a normalised attention weight from a score computed over a non-linear transform of its encoding, and the document representation is the weighted sum of the token outputs.

That weighted sum is then combined with the query encoding through a tanh non-linearity to form the joint representation.

The Impatient Reader adds rereading: at every query token it computes a new document representation with its own attention weights, and it updates the running representation from the previous step. The final joint representation is computed from the last of these document representations and the query encoding. Memory Networks apply attention at the level of whole sentences, each represented by a bag of embeddings, whereas the Attentive Reader attends token by token using the full past and future context.

## Heuristic and symbolic benchmarks

The majority baseline picks the entity most frequently observed in the context, and the exclusive majority baseline picks the most frequent context entity that does not occur in the query. The maximum frequency baseline reaches 33.2 on the CNN test split and 25.5 on the Daily Mail test split.

The frame-semantic benchmark parses queries and documents with a frame-semantic parser and extracts entity-predicate triples, which are then matched with a series of rules ordered by precedence. The rules run from exact matches of predicate and entity through matching frames and permuted arguments to matching entities, and a final back-off picks the most frequent entity not in the query.

This benchmark runs on the unanonymised corpora, and its rule set was tuned on the validation data.

The word distance benchmark aligns the placeholder with every candidate entity and sums, for each query word, the distance to its nearest aligned word in the document. The maximum penalty per word, m, is set to 8 by tuning on the validation data.

On the test splits, the frame-semantic model reaches 40.2 on CNN and 35.5 on Daily Mail, while the word distance model reaches 50.9 and 55.5. The authors explain the gap by the frame-semantic pipeline's poor coverage, since many relations do not follow the default predicate-argument structure. Daily Mail highlights often overlap lexically with passages of the article, which the word distance measure exploits.

## Accuracy of the neural readers

The Attentive Reader reaches 63.0 accuracy on the CNN test split and 69.0 on the Daily Mail test split. The Impatient Reader reaches 63.8 on CNN and 68.0 on Daily Mail, so the two attention models are close to each other, with the Impatient Reader higher on CNN and the Attentive Reader higher on Daily Mail.

The Deep LSTM Reader reaches 57.0 on CNN and 62.2 on Daily Mail, below both attention-based readers on each corpus. The Deep LSTM Reader still handles documents of up to about two thousand tokens, and the authors read its results as evidence that a simple sequential encoder can learn long inputs. It nevertheless falls short of the attention-based readers, even though those use only single-layer LSTMs.

Hyperparameters were searched over the validation splits, with the Deep LSTM Reader comparing two feed orders, cqa and qca, and the qca setup giving the reported model. All models were trained with asynchronous RmsProp using a momentum of 0.9 and a decay of 0.95.

## What removing attention costs

The Uniform Reader is identical to the Attentive Reader except that it sets all document token weights to be equal, so attention is ignored. It reaches 39.4 on the CNN test split and 34.4 on the Daily Mail test split, against 63.0 and 69.0 for the Attentive Reader.

The precision-recall curves for the attention models on CNN validation data point the same way, with the attentive approach showing the stronger curve. Heatmaps for two correctly answered validation queries show that the attended tokens depend on lexical generalisation and on coreference, such as linking a verb form to a paraphrase and a pronoun to the marker.

These are two hand-picked examples, and the authors note that they were short, while the average CNN validation document holds 763 tokens and 27 entities.

## Limits of the evidence

The frame-semantic pipeline covers relatively few relations, and it does not scale easily to queries that need several sentences, which was true for most queries in the dataset. Memory constraints prevented the authors from testing deeper Attentive Readers, so only single-layer versions were evaluated.

The authors expect the word distance model to perform much worse on machine reading data that uses questions rather than Cloze queries, but this was not tested.

## Paper info

- **Authors**: Karl Moritz Hermann, Tomáš Kočiský, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, Phil Blunsom
- **Venue**: arXiv · Preprint
- **First published**: 2015-6-10
- **Added**: 2026-11-12
- **Updated**: 2015-11-19
- **Version**: v3
- **arXiv**: 1506.03340
- **Category**: cs.CL · cs.AI · cs.NE
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1506.03340v3) · [PDF ↗](https://arxiv.org/pdf/1506.03340v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Karl Moritz Hermann, Tomáš Kočiský, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, Phil Blunsom (2015). Teaching Machines to Read and Comprehend. arXiv:1506.03340v3. https://arxiv.org/abs/1506.03340v3

**BibTeX**

```
@misc{hermann2015teaching,
  title = {{Teaching Machines to Read and Comprehend}},
  author = {Karl Moritz Hermann and Tomáš Kočiský and Edward Grefenstette and Lasse Espeholt and Will Kay and Mustafa Suleyman and Phil Blunsom},
  year = {2015},
  eprint = {1506.03340},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1506.03340v3}
}
```

## Other paper commentary

- [End-to-end Sequence Labeling via Bi-directional LSTM-CNNs-CRF](https://refivu.com/en/papers/ce633cbf-8295-40aa-a4ee-656b431af25f-end-to-end-sequence-labeling-via-bi-directional.md)
- [Crowdsourcing a Word-Emotion Association Lexicon](https://refivu.com/en/papers/3b0b67cb-6dd6-4162-9110-cdbb5d2cea2a-crowdsourcing-a-word-emotion-association-lexicon.md)
- [A Neural Attention Model for Abstractive Sentence Summarization](https://refivu.com/en/papers/d68d7c9a-7c6e-4b4f-a4e9-ba1853fdfad2-a-neural-attention-model-for-abstractive-sentence.md)
- [From Frequency to Meaning: Vector Space Models of Semantics](https://refivu.com/en/papers/dc10591f-f090-4830-a33f-924cbfeba0ff-from-frequency-to-meaning-vector-space-models-of.md)
- [Semantic Similarity Based on Corpus Statistics and Lexical Taxonomy](https://refivu.com/en/papers/fc160cc9-5a90-432c-8808-b3a1a431f015-semantic-similarity-based-on-corpus-statistics-and-lexical.md)
- [Pointer Sentinel Mixture Models](https://refivu.com/en/papers/8f7d0844-f517-4c18-ba24-8cd7dc616a74-pointer-sentinel-mixture-models.md)
- [Robust Physical-World Attacks on Deep Learning Models](https://refivu.com/en/papers/07947804-f6f2-481e-a0c5-1e222ca2e06f-robust-physical-world-attacks-on-deep-learning-models.md)
- [Barren plateaus in quantum neural network training landscapes](https://refivu.com/en/papers/6ab9d494-e0b9-4bee-b003-0d509557c07c-barren-plateaus-in-quantum-neural-network-training.md)
- [Speed/accuracy trade-offs for modern convolutional object detectors](https://refivu.com/en/papers/d59f0ced-71a6-4425-a177-e2e9ad7b8370-speed-accuracy-trade-offs-for-modern-convolutional-object.md)
- [Building Machines That Learn and Think Like People](https://refivu.com/en/papers/1c62e17f-b645-4165-8400-ffcbcd4abc96-building-machines-that-learn-and-think-like-people.md)
- [EnlightenGAN: Deep Light Enhancement without Paired Supervision](https://refivu.com/en/papers/1b24a8a7-0c9f-4dc7-b6db-20e08b8a1feb-enlightengan-deep-light-enhancement-without-paired.md)
- [Invariant Risk Minimization](https://refivu.com/en/papers/7f6a0d34-8d04-4205-b5c5-1e73e1c91b62-invariant-risk-minimization.md)

## Terms in this paper

- [Accuracy](https://refivu.com/en/terms/1995c0cd6282-accuracy)
- [LSTM](https://refivu.com/en/terms/ba10547646d9-lstm)
- [CNN](https://refivu.com/en/terms/06880f5198e6-cnn)
- [attention mechanism](https://refivu.com/en/terms/977ee0201459-attention-mechanism)
- [RMSProp](https://refivu.com/en/terms/a1984fdf7b1d-rmsprop)
- [reading comprehension](https://refivu.com/en/terms/6601ee93db35-reading-comprehension)
- [Memory Networks](https://refivu.com/en/terms/d80ee338df0c-memory-networks)
- [Attentive Reader](https://refivu.com/en/terms/663de72aacfb-attentive-reader)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/c971169f-9440-4e65-a62d-d8affa24f16a-teaching-machines-to-read-and-comprehend)
