NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Knowledge Enhanced Contextual Word Representations

Matthew E. Peters, Mark Neumann, Robert L. Logan Iv, Roy Schwartz, Vidur Joshi, Sameer Singh, Noah A. Smith

Abstract

Large language models like BERT excel at capturing syntax but often lack explicit grounding in structured factual knowledge. We present KnowBert, an architecture that incorporates structured knowledge from sources like Wikipedia and WordNet into BERT's latent representations via a novel Knowledge Attention and Recontextualization (KAR) mechanism. KnowBert demonstrates significant improvements in knowledge-intensive tasks such as relationship extraction and word sense disambiguation while maintaining computational efficiency.

Introduction: The Grounding Problem in LLMs

While BERT and its successors are highly effective at modeling local context and syntax, they are fundamentally limited by their training on unstructured text. These models often act as "statistical parrots," lacking a formal understanding of real-world entities and their relationships. This deficiency leads to several issues: a difficulty in accurately recalling specific facts (hallucinations), challenges in disambiguating homonyms (e.g., "crane" as a bird vs. machinery), and an inability to resolve long-range dependencies that require external factual context.

Methodology: KnowBert and KAR

KnowBert addresses these limitations by introducing the Knowledge Attention and Recontextualization (KAR) module. Unlike previous approaches that merely append entity vectors to word embeddings, KAR is a modular component that can be inserted between existing transformer layers.

Architecture of the Knowledge Attention and Recontextualization (KAR) module.

The KAR process operates in four stages:

  1. Mention-span Representation: Potential entity spans are identified and converted into vector representations.
  2. Integrated Entity Linking: An end-to-end trained linker retrieves candidate entities from a Knowledge Base (KB).
  3. Knowledge Enhancement: Entity information is injected into the span representations based on the linker's confidence.
  4. Recontextualization: An attention mechanism allows the original word-piece representations to incorporate this factual information, updating the model's internal "understanding."

The model is trained using a "chain-thaw" procedure, which carefully unfreezes network components to integrate new knowledge without degrading pre-trained linguistic capabilities.

Experimental Setup

KnowBert was pre-trained on English Wikipedia and the BooksCorpus. It utilizes two primary knowledge sources: WordNet for linguistic sense knowledge and a Wikipedia subset for factual entity data. Performance was evaluated across several benchmarks, including:

  • Relationship Extraction: TACRED and SemEval 2010 Task 8.
  • Word Sense Understanding: WiC (Words in Context).
  • Entity Typing: UFET.
  • Fact Recall: A custom Wikidata Probing task involving 90,000 facts.

Key Results and Discussion

KnowBert variants consistently outperform standard BERT models on knowledge-heavy benchmarks. Notably, the combination of WordNet and Wikipedia (KnowBert-W+W) provides the best overall performance, suggesting that linguistic and factual knowledge are complementary.

Performance comparison of KnowBert variants against BERT baselines.

Key findings include:

  • Factual Recall: KnowBert-W+W achieved a Wikidata MRR of 0.31, nearly tripling BERT-Base (0.09).
  • Relationship Extraction: On TACRED, KnowBert (BERT-Base backbone) reached an F1 of 71.5, surpassing the much larger BERT-Large (70.1).
  • Efficiency: Despite the added complexity, inference speed for KnowBert-Wiki is only 8% slower than BERT-Base, making it a viable option for production environments.

Conclusion and Future Work

KnowBert demonstrates that injecting structured knowledge directly into transformer layers significantly enhances a model's factual grounding. By training the entity linker end-to-end, the model learns to resolve ambiguities in a context-aware manner.

Future research will address current limitations, such as the reliance on rule-based candidate selection and the high memory footprint of large entity embedding tables. Additionally, exploring dynamic knowledge bases that can be updated without full retraining remains a promising direction for maintaining model relevance in a changing world.

Summary updated

BibTeX
@inproceedings{peters2019knowledge,
  author = {Matthew E. Peters and Mark Neumann and Robert L. Logan IV and Roy Schwartz and Vidur Joshi and Sameer Singh and Noah A. Smith},
  title = {{Knowledge Enhanced Contextual Word Representations}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2019},
  doi = {10.18653/v1/d19-1005},
}
Figure