Bilateral Multi-Perspective Matching for Natural Language Sentences

Zhiguo Wang, Wael Hamza, Radu Florian

Introduction

Natural Language Sentence Matching (NLSM) is a fundamental task in natural language processing, underpinning applications such as paraphrase identification, natural language inference (NLI), and question answering. The challenge lies in effectively capturing the nuanced relationship between two sentences, $P$ and $Q$. Historically, models relied on Siamese Networks, which encode sentences independently, or basic Matching-Aggregation frameworks that often lacked bidirectional depth or varied comparison perspectives.

The Bilateral Multi-Perspective Matching (BiMPM) model addresses these limitations by matching every word in one sentence against the entire context of the other from multiple perspectives and in both directions ($P \to Q$ and $Q \to P$).

Model Architecture

The BiMPM model is structured into five hierarchical layers designed to move from raw word representations to a final classification decision.

The five-layer architecture of the BiMPM model, illustrating the flow from word representation to final prediction.
  1. Word Representation Layer: This layer handles the input by combining standard GloVe word embeddings with character-level embeddings processed via a Long Short-Term Memory (LSTM) network. This hybrid approach ensures the model is robust against rare words and typographical errors.
  2. Context Representation Layer: A BiLSTM is employed to process the word sequences, wrapping each word in its surrounding context to generate "contextual vectors."
  3. Matching Layer: This is the core innovation of the model. It performs multi-perspective matching between the contextual vectors of the two sentences.
  4. Aggregation Layer: Another BiLSTM layer aggregates the sequences of matching vectors into a fixed-length representation.
  5. Prediction Layer: A fully connected network uses the aggregated vector to output the final probability for the specific task (e.g., entailment, neutral, or contradiction in NLI).

Multi-Perspective Matching Strategies

The matching layer utilizes a "multi-perspective cosine similarity" function. Unlike standard cosine similarity, this function incorporates a trainable weight matrix $W$ that allows the model to focus on different semantic dimensions of the vectors. For every word in sentence $P$, the model compares it to sentence $Q$ using four distinct strategies:

The four matching strategies: (a) Full-Matching, (b) Maxpooling-Matching, (c) Attentive-Matching, and (d) Max-Attentive-Matching.
  • Full-Matching: Compares each word vector of one sentence against the final hidden state (the summary) of the BiLSTM from the other sentence.
  • Maxpooling-Matching: Compares each word vector against every word vector in the other sentence, retaining only the maximum similarity score for each dimension.
  • Attentive-Matching: Calculates a weighted average of the entire target sentence based on similarity to the current word, then matches the word against this "attentive" representation.
  • Max-Attentive-Matching: Identifies the single most similar word in the target sentence and performs a match against that specific vector.

Key Insights and Results

The authors evaluated BiMPM across several benchmarks, demonstrating its state-of-the-art performance at the time of publication:

  • Stanford Natural Language Inference (SNLI): The model achieved 86.9% accuracy for a single model and 88.8% for an ensemble, outperforming more complex frameworks.
  • Quora Question Pairs: BiMPM reached 88.17% accuracy, significantly surpassing standard Siamese LSTMs and CNNs.
  • Bilateral Importance: Ablation studies confirmed that matching in both directions ($P \to Q$ and $Q \to P$) is superior to unidirectional matching. While $P \to Q$ is often more informative in NLI (hypothesis to premise), the combination provides the most robust results.
  • Granularity: The inclusion of all four matching strategies was found to be necessary; removing any single strategy resulted in a measurable performance decline, justifying the model's multi-perspective complexity.

Conclusion

BiMPM demonstrates that effective sentence matching requires looking beyond global summaries. By interacting at a granular, word-to-context level and employing multiple "lenses" through multi-perspective similarity, the model captures the intricate dependencies required for high-level natural language understanding. Future work may extend this framework to machine comprehension and more complex document-level matching tasks.

Summary updated

Abstract

Natural language sentence matching is a fundamental technology for a variety of tasks. Previous approaches either match sentences from a single direction or only apply single granular (word-by-word or sentence-by-sentence) matching. In this work, we propose a bilateral multi-perspective matching (BiMPM) model under the "matching-aggregation" framework. Given two sentences $P$ and $Q$, our model first encodes them with a BiLSTM encoder. Next, we match the two encoded sentences in two directions $P \rightarrow Q$ and $P \leftarrow Q$. In each matching direction, each time step of one sentence is matched against all time-steps of the other sentence from multiple perspectives. Then, another BiLSTM layer is utilized to aggregate the matching results into a fix-length matching vector. Finally, based on the matching vector, the decision is made through a fully connected layer. We evaluate our model on three tasks: paraphrase identification, natural language inference and answer sentence selection. Experimental results on standard benchmark datasets show that our model achieves the state-of-the-art performance on all tasks.
BibTeX
@inproceedings{wang2017bilateral,
  author = {Zhiguo Wang and Wael Hamza and Radu Florian},
  title = {{Bilateral Multi-Perspective Matching for Natural Language Sentences}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2017},
  doi = {10.24963/ijcai.2017/579},
}
Figure