While external knowledge is a proven booster for "knowledge-heavy" tasks like question answering, its utility for "general" Natural Language Understanding (NLU) tasks—such as sentiment analysis or grammatical checking—has been less clear. This study demonstrates that integrating entity descriptions and embeddings into standard models like RoBERTa and ELECTRA significantly improves performance across a wide range of general NLU tasks, achieving an average gain of 0.46 points without modifying the underlying model architecture.
Addressing the Knowledge Gap in General NLU
In NLU research, a divide exists between "knowledge-centric" tasks (e.g., trivia, relation extraction) and "general" reasoning tasks (e.g., sentiment analysis, linguistic acceptability). Traditionally, performance on the latter is improved through larger models and more extensive pre-training. This paper investigates whether "plugging in" external facts can enhance general language reasoning. For instance, can the definition of a "sponge" help a model better determine the grammatical correctness of a sentence about one?
Non-Invasive Knowledge Integration Methods
The researchers explored four "non-invasive" methods to inject knowledge into pre-trained language models (LMs) like BERT, RoBERTa, ALBERT, and ELECTRA. These methods modify the input data rather than the internal Transformer architecture.
- Knowledge as Text (KT): Entities in the input text are identified, and their dictionary definitions from Wiktionary are appended to the input string.
- Knowledge as Text with Attention (KT-Attn): To mitigate "distraction" from long definitions, a visibility matrix allows original sentence tokens to see definitions while preventing definitions of different entities from interacting, thereby reducing noise.
- Knowledge as Textual Embedding (KT-Emb): The LM encodes the definition into a single vector, which is then added to the original word's embedding.
- Knowledge as Graph Embedding (KG-Emb): Pre-trained graph embeddings (TransE) from Wikidata are fused with the input embeddings.
Key Insights: Knowledge as a Noise Filter
Using Mutual Information (MI) analysis and interpretation tools like DiffMask, the authors uncovered why these methods work. Knowledge-enhanced models appear better at discarding "task-irrelevant" information, allowing them to focus on the core logic of a sentence. Furthermore, the "No-Harm" principle was observed: adding knowledge rarely degraded performance, even when the boost was marginal.
KT-Attn emerged as the most robust method. By controlling the "visibility" of knowledge, it prevents the model from being overwhelmed by long, potentially irrelevant definitions. DiffMask visualizations further showed that knowledge-aware models become more "certain" in their decision-making, correctly identifying key tokens (like function words) that drive grammatical or semantic logic.
Empirical Results
The study evaluated these methods across 10 diverse NLU tasks, including the GLUE benchmark and sequence labeling tasks (POS tagging and NER).
- Universal Improvement: Across 8 different LMs, knowledge integration improved performance by an average of 0.46 points.
- Method Effectiveness: KT-Attn improved RoBERTa-Large's average score from 89.37 to 89.77 on classification tasks.
- Model Sensitivity: BERT-Large showed the most frequent task improvements with KT-Attn, while ELECTRA-Base benefited most in sequence labeling tasks.
- Generalization: Knowledge linked to specific nouns or verbs was found to influence how the model processes every token in a sentence, leading to superior overall generalization.
Limitations and Future Directions
While promising, the approach depends on the accuracy of entity extraction and linking tools. Additionally, appending text (KT) increases computational costs due to the quadratic nature of self-attention. Future work may explore integrating "evolving" or domain-specific knowledge and scaling these non-invasive methods to massive models like GPT-4.
Summary updated