Syntax-based Attention Model for Natural Language Inference

Pengfei Liu, Xipeng Qiu, Xuanjing HuangarXiv 2016

Introduction

Natural Language Inference (NLI) serves as a fundamental benchmark for evaluating a machine's ability to understand semantic relationships between sentences. Given a premise and a hypothesis, a model must determine if the relationship is one of entailment, contradiction, or neutrality. While modern deep learning models have made significant strides using attention mechanisms, most treat language as a linear sequence. This "flat" approach often fails to capture the hierarchical nature of human language, where words group into phrases to form meaning. Researchers from Fudan University address this by introducing a syntax-based attention model that aligns tree-structured representations.

The SAT-LSTM Framework

The proposed Syntax-based Attention Matching Model (SAT-LSTM) moves beyond word-to-word alignment. Instead of processing sentences as simple lists, it utilizes the underlying syntactic structure.

Tree-Structured Encoding

The model employs Tree-LSTMs to encode sentences. Unlike standard LSTMs that process tokens sequentially, Tree-LSTMs compose the hidden state of a parent node from its children, effectively capturing phrase-level semantics. The authors explored two variants: constituency-based (cLSTM), which groups words into nested phrases, and dependency-based (dLSTM), which focuses on grammatical relations.

Comparison of sequence-based (left) and tree-structured (right) sentence representations.

Topological Attention

The core innovation is the topological attention mechanism. While standard attention maps individual words in the hypothesis to words in the premise, SAT-LSTM maps subtrees to subtrees. This allows the model to perform phrase-level alignment, recognizing that a concept like "autumn" in the hypothesis might be best supported by the phrase "fallen leaves" in the premise.

Comparison between standard sequence-to-sequence attention (top) and the proposed syntax-based tree-to-tree attention (bottom).

Experimental Evaluation

The model was evaluated on the Stanford Natural Language Inference (SNLI) dataset, which contains 570,000 human-labeled sentence pairs.

Performance and Insights

The constituency-based SAT-cLSTM achieved a state-of-the-art accuracy of 84.1% on the SNLI test set. This represents a 2.1% improvement over standard sequence-based attention models and a 3.8% gain over basic Tree-LSTM encoders without attention.

Key findings include:

  • Structural Superiority: Constituency trees outperformed dependency trees, likely because they better capture semantic compositionality.
  • Semantic Robustness: The model demonstrated a high degree of robustness to syntactic variations, correctly identifying that phrases like "wearing a pink dress" and "in a pink dress" share nearly identical semantic representations.
  • Interpretability: Visualizations of attention weights showed that the model's internal logic aligns closely with human intuition, successfully identifying the specific sub-components of a sentence that drive the inference.

Conclusion

By integrating syntactic structure into the attention mechanism, the SAT-LSTM provides a more nuanced and accurate approach to NLI. While the model currently relies on external parsers and requires more computational resources than flat models, it offers a significant step forward in building machines that understand the hierarchical "scaffolding" of human language. Future work may involve training on larger paraphrase datasets to further generalize these structural representations.

Summary updated

BibTeX
@misc{liu2016syntax,
  author = {Pengfei Liu and Xipeng Qiu and Xuanjing Huang},
  title = {{Syntax-based Attention Model for Natural Language Inference}},
  year = {2016},
  eprint = {1607.06556},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1607.06556},
}
Figure