Exploiting Structured Knowledge in Text via Graph-Guided Representation Learning

Tao Shen, Yi Mao, Pengcheng He, Guodong Long, Adam Trischler, Weizhu Chen

Introduction

Large Language Models (LLMs) like BERT excel at capturing linguistic patterns but often lack a deep understanding of relational knowledge—the structured facts typically found in Knowledge Graphs (KGs). Integrating this structured data into pre-trained models is a significant challenge in natural language processing.

Historically, researchers have approached this in two ways:

  1. Retrieval-based methods: These models query KG subgraphs during both training and inference. While effective, they introduce significant latency and depend on the quality of entity linking at runtime.
  2. Triple-based methods: These models are trained directly on KG triples (e.g., [Head, Relation, Tail]). However, this often leads to "over-adaptation," where the model performs well on structured triples but loses its ability to generalize to natural, free-form text.
Comparison of paradigms for integrating Knowledge Graphs into Pre-trained Language Models.

This paper proposes the Graph-guided Masked Language Model (GLM), a "middle way" that uses KGs to guide the model during pre-training. This allows the model to internalize relational knowledge without requiring external graph access during downstream inference.

Methodology

The GLM framework introduces two self-supervised tasks that leverage KGs (such as ConceptNet) as a silent instructor during the pre-training phase.

1. KG-Guided Entity Masking

Unlike standard BERT, which masks tokens randomly, GLM identifies informative entities using a "mutual reachability" score. This score determines how easily an entity can be inferred from other entities in the same sentence via the KG. By avoiding "trivial" stop words or "undeducible" isolated entities, the model focuses on the "Goldilocks zone"—masking entities that require relational reasoning to predict.

2. Distractor-Suppressed Ranking

To further challenge the model, a ranking objective is introduced. When an entity is masked, the model must not only predict the correct word but also rank it higher than a "distractor" negative sample. These distractors are chosen from "sibling" nodes in the KG (e.g., "orange" as a distractor for "apple"), forcing the model to learn subtle nuances between closely related concepts.

Overview of the GLM pre-training framework, featuring KG-guided masking and distractor-suppressed ranking.

Experimental Results

The model was pre-trained on the Open Mind Common Sense (OMCS) and ARC corpora and evaluated across several benchmarks:

  • Commonsense Reasoning: GLM (based on RoBERTa-large) achieved a state-of-the-art 74.1% accuracy on CommonsenseQA, outperforming previous retrieval-heavy models without the inference-time overhead.
  • Social Reasoning: On SocialIQA, it reached 78.6%, demonstrating strong generalization even when the evaluation dataset was built on a different KG (ATOMIC) than the one used for training (ConceptNet).
  • Knowledge Base Completion (KBC): GLM significantly outperformed KG-BERT on the WN18RR link prediction task, setting a new standard for text-based KG models.
  • Zero-Shot Performance: In zero-shot evaluations on CKBC, GLM outperformed the baseline by over 6 points (83.4 vs 77.1 F1), indicating successful internalization of structured information.

Limitations and Future Directions

While GLM shows significant promise, it faces certain limitations. The masking scheme can occasionally be too aggressive, leaving insufficient context for the model. Additionally, because the pre-training corpora consisted of short sentences, the model struggles with long-range dependencies. Future work will explore pre-training on document-level text and integrating multiple types of KGs to provide a more comprehensive knowledge base.

Summary updated

BibTeX
@inproceedings{shen2020exploiting,
  author = {Tao Shen and Yi Mao and Pengcheng He and Guodong Long and Adam Trischler and Weizhu Chen},
  title = {{Exploiting Structured Knowledge in Text via Graph-Guided Representation Learning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.722},
}
Figure