Abstract
Previous machine comprehension (MC) datasets are either too small to train end-to-end deep learning models, or not difficult enough to evaluate the ability of current MC techniques. The newly released SQuAD dataset alleviates these limitations, and gives us a chance to develop more realistic MC models. Based on this dataset, we propose a Multi-Perspective Context Matching (MPCM) model, which is an end-to-end system that directly predicts the answer beginning and ending points in a passage. Our model first adjusts each word-embedding vector in the passage by multiplying a relevancy weight computed against the question. Then, we encode the question and weighted passage by using bi-directional LSTMs. For each point in the passage, our model matches the context of this point against the encoded question from multiple perspectives and produces a matching vector. Given those matched vectors, we employ another bi-directional LSTM to aggregate all the information and predict the beginning and ending points. Experimental result on the test set of SQuAD shows that our model achieves a competitive result on the leaderboard.
Introduction
Machine Comprehension (MC)—the ability of a computer to read a passage and answer questions about it—has long been hindered by dataset limitations. Early datasets like MCTest were too small for deep learning, while larger "Cloze-style" datasets (like CNN/Daily Mail) were often too simple, allowing models to rely on shallow pattern matching rather than true understanding.
The release of the Stanford Question Answering Dataset (SQuAD) changed the landscape: it is large, human-written, and requires identifying arbitrary spans of text as answers. We address the challenge of SQuAD by moving away from simply ranking candidate answer "chunks." Instead, we propose a model that evaluates every word in a passage to determine how well its surrounding context matches the question from multiple "perspectives."
Methods
The Multi-Perspective Context Matching (MPCM) model consists of six specialized layers designed to identify the precise start and end points of answers within a text.
- Word Representation Layer: Combines pre-trained GloVe embeddings with character-level LSTM outputs to handle out-of-vocabulary words.
- Filter Layer: A novel step that assigns a "relevancy weight" to each passage word based on its cosine similarity to the question. This helps the model ignore redundant information early on.
- Context Representation Layer: Uses Bi-directional LSTMs (BiLSTMs) to capture the temporal context of words in both the question and the passage.
- Multi-Perspective Context Matching Layer: The core innovation. It compares each passage word's context against the question using three strategies: Full-Matching (against the entire question representation), Maxpooling-Matching (against individual question words, keeping the highest similarity), and Meanpooling-Matching (averaging similarity scores).
- Aggregation Layer: Another BiLSTM that "reads" the sequence of matching vectors to understand how the matches flow together.
- Prediction Layer: Two independent classifiers that predict the probability of each word being the start or the end of the answer span.
Key Insights and Ideas
A central insight of this work is that context is multi-dimensional. A single similarity score is often insufficient to capture the nuances of language. By using multiple "perspectives"—learned weights that emphasize different dimensions of the embedding space—the model can capture complex relationships between the question and the passage.
Additionally, the model employs a filtering strategy to weight passage words by their relevance to the question before deep processing. This allows the subsequent layers to focus their "attention" on the most promising parts of the text. To maintain computational efficiency, the model predicts the start and end points of an answer independently, reducing complexity from $O(N^2)$ to $O(N)$.
Key Results
The MPCM model was evaluated on the SQuAD dataset, which contains over 100,000 question-answer pairs. At the time of submission (Dec 2016), the model was highly competitive on the leaderboard:
- Single Model: Achieved an Exact Match (EM) score of 65.5% and an F1 score of 75.1%.
- Ensemble Model: By averaging five models, performance reached 68.2% EM and 77.2% F1.
Ablation studies confirmed the necessity of each layer. Notably, the Aggregation Layer proved to be the most critical component; its removal caused the F1 score to drop by over 3%.
Discussion and Limitations
While the MPCM model performs well on standard benchmarks, it faces several limitations. Error analysis reveals that the model struggles with "how did" questions, which typically require longer, more complex answers without clear-cut boundary markers. Furthermore, performance degrades as the required answer span length increases.
Approximately 14% of errors were attributed to the need for reasoning across multiple sentences, and others required external world knowledge. Future work will focus on incorporating external knowledge and improving multi-sentence reasoning capabilities to address these gaps.
Summary updated