Does Knowledge Help General NLU? An Empirical Study

Ruochen Xu, Yuwei Fang, Chenguang Zhu, Michael ZengarXiv 2021

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.

Overview of the four knowledge integration methods: KT, KT-Attn, KT-Emb, and KG-Emb.
  1. Knowledge as Text (KT): Entities in the input text are identified, and their dictionary definitions from Wiktionary are appended to the input string.
  2. 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.
  3. 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.
  4. 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).

Comprehensive performance analysis across tasks and language models, showing where knowledge integration provides the most benefit.
  • 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

Abstract

It is often observed in knowledge-centric tasks (e.g., common sense question and answering, relation classification) that the integration of external knowledge such as entity representation into language models can help provide useful information to boost the performance. However, it is still unclear whether this benefit can extend to general natural language understanding (NLU) tasks. In this work, we empirically investigated the contribution of external knowledge by measuring the end-to-end performance of language models with various knowledge integration methods. We find that the introduction of knowledge can significantly improve the results on certain tasks while having no adverse effects on other tasks. We then employ mutual information to reflect the difference brought by knowledge and a neural interpretation model to reveal how a language model utilizes external knowledge. Our study provides valuable insights and guidance for practitioners to equip NLP models with knowledge.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
CoLAKT-Emb (ELECTRA-Base)Matt. corr.70.69+2.08 vs baselinefine-tuned · variant=KT-Emb · backbone=ELECTRA-Base
Source quote
L360: + KT-Emb │ 70.69 │ 95.64 │ 88.73 │ 91.15 │ 91.86 │ 88.81 │ 93.12 │ 76.53 │ 87.07
SST-2KT-Attn (ELECTRA-Base)Acc.95.76+0.46 vs baselinefine-tuned · variant=KT-Attn · backbone=ELECTRA-Base
Source quote
L359: + KT-Attn │ 69.45 │ 95.76 │ 88.97 │ 90.89 │ 91.84 │ 88.98 │ 93.03 │ 80.51 │ 87.43
RTEKT-Attn (BERT-Large-Cased)Acc.73.65+2.17 vs baselinefine-tuned · variant=KT-Attn · backbone=BERT-Large-Cased
Source quote
L344: + KT-Attn │ 65.35 │ 94.04 │ 87.25 │ 90.56 │ 91.43 │ 86.63 │ 92.57 │ 73.65 │ 85.19
Reported baseline / comparator measurements (3)
BenchmarkMethodMetricScoreProtocol / Evidence
CoLAELECTRA-Base (baseline) baselineMatt. corr.68.61fine-tuned · backbone=ELECTRA-Base
Source quote
L357: ELECTRA-Base │ 68.61 │ 95.3 │ 88.48 │ 90.99 │ 91.93 │ 88.9 │ 93.1 │ 78.7 │ 87.00
SST-2ELECTRA-Base (baseline) baselineAcc.95.3fine-tuned · backbone=ELECTRA-Base
Source quote
L357: ELECTRA-Base │ 68.61 │ 95.3 │ 88.48 │ 90.99 │ 91.93 │ 88.9 │ 93.1 │ 78.7 │ 87.00
RTEBERT-Large-Cased (baseline) baselineAcc.71.48fine-tuned · backbone=BERT-Large-Cased
Source quote
L342: BERT-Large-Cased │ 64.84 │ 93.92 │ 86.27 │ 90.29 │ 91.5 │ 86.51 │ 92.51 │ 71.48 │ 84.67
BibTeX
@misc{xu2021does,
  author = {Ruochen Xu and Yuwei Fang and Chenguang Zhu and Michael Zeng},
  title = {{Does Knowledge Help General NLU? An Empirical Study}},
  year = {2021},
  eprint = {2109.00563},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.00563},
}
Figure