Abstract
In this paper, we proposed a sentence encoding-based model for recognizing text entailment. In our approach, the encoding of sentence is a two-stage process. Firstly, average pooling was used over word-level bidirectional LSTM (biLSTM) to generate a first-stage sentence representation. Secondly, attention mechanism was employed to replace average pooling on the same sentence for better representations. Instead of using target sentence to attend words in source sentence, we utilized the sentence's first-stage representation to attend words appeared in itself, which is called "Inner-Attention" in our paper. Experiments conducted on Stanford Natural Language Inference (SNLI) Corpus has proved the effectiveness of "Inner-Attention" mechanism. With less number of parameters, our model outperformed the existing best sentence encoding-based approach by a large margin.
Introduction
Recognizing Textual Entailment (RTE), also known as Natural Language Inference (NLI), is a fundamental challenge in natural language processing. Given a "premise" and a "hypothesis," the goal is to determine if the relationship is one of Entailment, Contradiction, or Neutrality. While deep learning has shifted the focus from manual feature engineering to automatic extraction, many sentence encoding-based models struggle to capture the semantic density of individual sentences. This paper introduces a novel "Inner-Attention" mechanism designed to create high-quality, standalone sentence embeddings by identifying the most semantically significant words within a sentence independently of its counterpart.
Methodology: The Two-Stage Encoding Process
The proposed architecture follows a Siamese-style design where both the premise and hypothesis are processed through identical encoders with shared weights. The core innovation lies in a unique two-stage encoding process:
- Stage 1: BiLSTM + Mean Pooling: Each sentence passes through a word-level Bidirectional LSTM (biLSTM) to capture contextual information from both directions. These hidden states are then averaged to create a preliminary "intuition" or first-stage representation of the sentence.
- Stage 2: Inner-Attention: Instead of using cross-sentence attention (which requires both sentences to be present), the model uses its own Stage 1 representation to calculate attention weights for its own words. This allows the model to re-read the sentence and focus on "content" words like nouns and verbs while downplaying functional grammar words.
Once both sentences are encoded into vectors, they are combined using concatenation, element-wise product, and element-wise difference. This relation vector is then fed into a SoftMax layer for final classification. The authors also introduced a "Differentiating Input" strategy, which removes words appearing in both sentences to force the model to focus on discriminative differences.
Experimental Results
The model was evaluated on the Stanford Natural Language Inference (SNLI) Corpus, which consists of approximately 570,000 human-written sentence pairs.
As shown in the results table, the Inner-Attention model significantly outperformed several complex architectures. The basic model with Inner-Attention achieved 84.2% accuracy, which rose to 85.0% when combined with the Differentiating Input strategy. Notably, the model achieved these state-of-the-art results with only 2.8 million parameters, proving to be far more efficient than larger models like the 15M parameter GRU encoder.
Conclusion
The "Inner-Attention" mechanism effectively mimics human reading behavior by forming a quick gist of a sentence and then focusing on the specific keywords that define its logical meaning. By prioritizing semantic density over raw scale, the proposed model provides a highly efficient and accurate solution for natural language inference. Future work will explore applying this architecture to related tasks such as Question Answering and Semantic Textual Similarity.
Summary updated