Sequential Attention: A Context-Aware Alignment Function for Machine Reading

Sebastian Brarda, Philip Yeres, Samuel R. Bowman

TL;DR

This paper introduces "Sequential Attention," a novel neural network layer for machine reading that improves how models focus on relevant parts of a text. By considering not just how well a word matches a query but also how its neighbors do, Sequential Attention significantly boosts performance on reading comprehension tasks, achieving state-of-the-art results.

What Problem Does This Paper Address?

Reading comprehension models aim to understand text and answer questions about it. A key component in these models is "attention," which helps the model decide which words in a passage are most important for answering a given question. Traditional attention mechanisms often focus on individual words in isolation, considering only their direct match to the query. This can be limiting, as the meaning and relevance of a word are often influenced by its surrounding context. The authors identify this limitation and propose a method to incorporate contextual information directly into the attention scoring function, leading to a more nuanced understanding of text.

Methods

The core innovation is the "Sequential Attention" (SA) layer. Unlike standard soft attention, which computes a single scalar score for each word based on its match with a query, SA first computes a vector representation of the word's relevance to the query using a partial-bilinear function. This vector captures more nuanced similarity information. Crucially, these vectors are then fed into a bidirectional GRU (Gated Recurrent Unit) layer. This GRU processes the sequence of relevance vectors, allowing it to learn how surrounding words influence the attention score of a given word. This contextual awareness is then used to compute the final attention weights. The authors integrate this SA layer into the Stanford Reader model, a strong baseline for reading comprehension.

Datasets

The paper evaluates their model on two datasets:

  • CNN Dataset: Introduced by Hermann et al. (2015), this dataset is widely used for evaluating neural networks on language understanding tasks.
  • Who did What (WDW) Dataset: Introduced by Onishi et al. (2016), this is a newer, quality-controlled dataset for cloze-style reading comprehension.

Key Insights and Ideas

  • Context is King for Attention: The most significant insight is that considering the context of words, not just their isolated match to a query, dramatically improves attention mechanisms. This is because word meaning and relevance are inherently contextual.
  • GRU for Contextual Attention: Using a bidirectional GRU to process the initial relevance vectors is a clever way to inject sequential context into the attention calculation. This allows the model to learn dependencies between attention scores.
  • Simpler is Sometimes Better: The paper finds that bilinear attention parameters don't significantly improve performance over simpler dot-product attention. Furthermore, adding an extra GRU layer to the SA mechanism (making it more "context-aware") yields substantial performance gains with fewer parameters than adding more layers to the initial passage/question encoding.
  • Architecture Matters: The SA model's simpler architecture (compared to some other state-of-the-art models like Bidirectional Attention Flow) is highlighted as a benefit, achieving strong results without excessive complexity.

Key Results

  • Significant Improvement over Baseline: The Sequential Attention model, when integrated into the Stanford Reader, achieved a 3.7% accuracy gain on the CNN dataset compared to the original Stanford Reader.
  • Competitive with State-of-the-Art: On the WDW dataset, the SA model achieved 67.2% accuracy, making it the second-best performing model at the time, only slightly behind the Gated Attention Reader which used additional features.
  • CNN Performance: On the CNN dataset, the SA model achieved 77.1% accuracy, outperforming the Stanford Reader by a notable margin.
  • Element-wise SA Advantage: Interestingly, the element-wise version of SA (which omits the partial-bilinear parameters) performed even better on the CNN dataset (77.3%) than the partial-bilinear version, suggesting that the core contextual GRU layer is the primary driver of improvement.

Limitations and Future Work

  • Parameter Efficiency: While SA is more parameter-efficient than some complex models, the authors note that the bilinear parameters themselves don't seem to add significant value.
  • Dataset Size Impact: The paper suggests that the performance gap between CNN and WDW datasets is partially due to differences in training set sizes.
  • Future Directions: The authors propose exploring other machine reading datasets like SQuAD and MS MARCO. They also suggest combining SA with ideas from other recent research (Gated Attention Reader, Bidirectional Attention Flow) and exploring its applicability to other tasks like machine translation.

Summary updated

BibTeX
@inproceedings{brarda2017sequential,
  author = {Sebastian Brarda and Philip Yeres and Samuel R. Bowman},
  title = {{Sequential Attention: A Context-Aware Alignment Function for Machine Reading}},
  booktitle = {Rep4NLP @ ACL},
  year = {2017},
  url = {https://openreview.net/forum?id=Bj_YTdGlnk1},
}
Figure