Combining pre-trained language models and structured knowledge

Pedro Colon-Hernandez, Catherine Havasi, Jason B. Alonso, Matthew Huggins, Cynthia BreazealarXiv 2021

Introduction

Modern transformer-based language models (LMs), such as BERT and GPT, excel at distributional learning—predicting word sequences based on statistical patterns in massive text corpora. However, these models often lack a grounded understanding of factual relationships, leading to "hallucinations." While a model may associate "Paris" with "France," it does not inherently grasp the structured relationship (Paris, is_capital_of, France) found in a Knowledge Graph (KG). This paper provides a comprehensive survey of techniques designed to bridge the gap between structured KGs and unstructured language models.

Taxonomy of Knowledge Injection

The authors propose a taxonomy to organize the various ways researchers "inject" knowledge into models, categorizing methods based on where they occur in the model pipeline: input, architecture, or output.

Taxonomy of knowledge injection techniques across the model pipeline, showing input, architecture, and output stages.

Input-Focused Injections

These methods modify data before it enters the transformer layers. Common approaches include converting KG triples into "pseudo-sentences" (e.g., "dog is an animal") or fusing entity embeddings directly into the initial word embeddings. For instance, the COMET model ingests formatted sentence versions of triples from ConceptNet and Atomic to improve reasoning capabilities.

Examples of how structured knowledge graph assertions are transformed into model-readable inputs.

Architecture-Focused Injections

This approach involves internal modifications to the model's "plumbing." A popular technique is the use of Adapters—small, trainable layers inserted between standard transformer blocks. These allow for fine-tuning on specific knowledge without "breaking" the model's general pre-trained knowledge, effectively mitigating the problem of catastrophic forgetting.

Output-Focused and Hybrid Injections

Output-focused injections modify how the model is trained or evaluated, often by adding custom loss functions that penalize predictions contradicting known factual triples. The most sophisticated systems, such as ERNIE 2.0 or K-BERT, utilize hybrid approaches. For example, K-BERT modifies attention masks so the model can "see" graph connections as if they were physically connected in the text sequence.

Key Insights and Performance

The survey identifies several critical takeaways for the field:

  • Factual Anchoring: Injecting KGs acts as a necessary anchor, preventing the model from drifting into bias or factual error.
  • Efficiency of Adapters: Architecture-based adapters are highly promising for "continual learning," allowing models to ingest new facts over time.
  • Distributional vs. Semantic: While input-focused methods are easy to implement, they are often overshadowed by the model's original distributional training. The most effective models enforce knowledge at the architectural or loss-function level.

Empirical results across various benchmarks demonstrate significant performance boosts:

  • ERNIE 2.0 (Large): Achieved a 3.87% improvement on the GLUE benchmark.
  • KnowBERT: Saw an 8% jump on the TACRED relation extraction task.
  • BERT-MK: Improved medical entity typing and relation classification by over 6% by incorporating UMLS knowledge.

Limitations and Future Directions

Despite these advancements, several gaps remain. Most current research focuses on encoder models (like BERT) rather than generative, decoder-only models (like the GPT family). Furthermore, many hybrid approaches are computationally heavy, making them difficult to scale. Future work should aim to integrate all three injection types—input, architecture, and output—simultaneously to create more robust, factually grounded AI systems.

Summary updated

BibTeX
@misc{colonhernandez2021combining,
  author = {Pedro Colon-Hernandez and Catherine Havasi and Jason B. Alonso and Matthew Huggins and Cynthia Breazeal},
  title = {{Combining pre-trained language models and structured knowledge}},
  year = {2021},
  eprint = {2101.12294},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2101.12294},
}
Figure