[Paper Review] Knowledge Enhanced Attention for Robust Natural Language Inference
This paper proposes a knowledge-enhanced attention mechanism that injects external lexical knowledge into multi-head attention layers to improve robustness in natural language inference (NLI). By transforming attention scores using structured knowledge embeddings without adding parameters, the method significantly boosts performance on adversarial NLI benchmarks, achieving human-level accuracy on the adversarial SNLI set when combined with BERT.
Neural network models have been very successful at achieving high accuracy on natural language inference (NLI) tasks. However, as demonstrated in recent literature, when tested on some simple adversarial examples, most of the models suffer a significant drop in performance. This raises the concern about the robustness of NLI models. In this paper, we propose to make NLI models robust by incorporating external knowledge to the attention mechanism using a simple transformation. We apply the new attention to two popular types of NLI models: one is Transformer encoder, and the other is a decomposable model, and show that our method can significantly improve their robustness. Moreover, when combined with BERT pretraining, our method achieves the human-level performance on the adversarial SNLI data set.
Motivation & Objective
- Address the poor robustness of state-of-the-art NLI models on adversarial examples, where performance drops by over 20%.
- Overcome the limitations of existing knowledge integration methods that are model-specific and require architectural changes.
- Develop a general-purpose, parameter-free method to inject external knowledge into attention mechanisms across diverse NLI architectures.
- Demonstrate that knowledge injection at inference and training time is essential for robustness improvement.
- Achieve human-level performance on the adversarial SNLI benchmark using a simple, transferable attention modification.
Proposed method
- Introduce a knowledge-enhanced attention mechanism that modifies the attention score computation by incorporating structured embeddings from external knowledge sources (e.g., WordNet).
- Transform the raw attention scores using a learned projection of external knowledge embeddings, enabling attention to attend to semantically related tokens beyond the input distribution.
- Apply the modified attention layer to both decomposable attention models and Transformer-based models (e.g., BERT), without altering the model architecture or adding parameters.
- Ensure knowledge injection occurs during both training and inference to allow the model to learn effective use of external knowledge.
- Use pre-trained models like BERT and OpenAI GPT as base architectures, and apply the knowledge-enhanced attention to their multi-head attention layers.
- Leverage lexical knowledge such as synonyms, hypernyms, and antonyms to generate adversarial examples and improve alignment in attention mechanisms.
Experimental results
Research questions
- RQ1Can injecting external lexical knowledge into the attention mechanism improve the robustness of NLI models on adversarial examples?
- RQ2Does the proposed method generalize across different NLI architectures, including decomposable models and Transformers?
- RQ3Is the performance gain from knowledge injection dependent on applying it during both training and inference?
- RQ4Can the method achieve human-level performance on adversarial NLI benchmarks when combined with pre-trained models like BERT?
- RQ5How does the method compare to model-specific knowledge integration techniques in terms of simplicity, transferability, and effectiveness?
Key findings
- The knowledge-enhanced attention mechanism improves adversarial accuracy by over 20 percentage points on the SNLI dataset, with Model I achieving 84.4% on adversarial SNLI compared to 63.2% without knowledge.
- When combined with BERT, the method achieves 93.9% accuracy on the adversarial SNLI test set, matching the estimated human-level performance reported in Glockner et al. (2018).
- The method significantly improves recall on the neutral class (from 11% to 23%) and precision on entailment examples (from 74% to 85%) in BERT, indicating better generalization.
- Post-hoc knowledge injection at inference only fails to improve robustness, proving that knowledge must be integrated during both training and inference for effectiveness.
- The method provides a 3% accuracy boost over standard BERT on adversarial SNLI, demonstrating that even large pre-trained models benefit from the knowledge-enhanced attention mechanism.
- The approach is model-agnostic and parameter-free, enabling broad applicability to any attention-based model without architectural modifications.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.