A Framework for Adapting Pre-Trained Language Models to Knowledge Graph Completion

Justin Lovelace, Carolyn P. RoséEMNLP 2022

Abstract

This paper introduces a novel framework for Knowledge Graph Completion (KGC) that decouples the representation of entities for queries versus retrieval. By applying lightweight supervised transformations, such as Residual MLPs, and parameter-efficient tuning techniques like prompt-tuning, the authors significantly enhance the performance of Pre-trained Language Models (PLMs) on KGC tasks. This approach achieves state-of-the-art results without the massive computational overhead or the overfitting risks associated with full model fine-tuning.

Introduction

Knowledge Graphs (KGs) serve as the structural backbone for modern AI applications, including search engines, recommendation systems, and medical diagnostics. Despite their utility, KGs are notoriously incomplete. Knowledge Graph Completion (KGC) is the task of predicting these missing links, essentially solving a "fill-in-the-blank" problem for triples such as (Paris, capital_of, ?).

While Pre-trained Language Models (PLMs) like BERT store vast amounts of factual knowledge, adapting them for KGC presents a significant challenge. Researchers typically face a trade-off: full fine-tuning provides high accuracy but is computationally prohibitive for large-scale retrieval, while static embedding extraction is fast but fails to capture the specific structural nuances of the knowledge graph. This paper proposes a middle ground that leverages the power of PLMs efficiently through a decoupled architecture.

Methodology: Decoupled Representations

The core innovation of this framework is the decoupling of entity representations. Instead of a monolithic approach, the system distinguishes between two types of representations:

  1. Query Representation: Computed on-the-fly using the PLM to capture the specific context of the link prediction task.
  2. Candidate Representations: Extracted and cached beforehand to enable rapid retrieval and ranking against thousands of potential entities.
Figure 2: Overview of the decoupled KGC framework architecture, showing the separation between query processing and candidate retrieval.

To bridge these two representations, the authors introduce Embedding Transformations. A primary challenge with raw PLM embeddings is "anisotropy"—the tendency for embeddings to cluster in a narrow cone in vector space, which reduces their discriminative power. The framework tests several methods to "spread out" these embeddings, including unsupervised Normalizing Flows and supervised Residual MLPs. The Residual MLP emerged as the most effective, as it preserves the original semantic meaning of the PLM while learning to emphasize features relevant to the KG structure.

Parameter-Efficient Tuning

Rather than updating all parameters of the PLM, which often leads to overfitting on sparse graph data, the framework utilizes parameter-efficient techniques like Prompt-tuning and Linear Probing. These methods allow the model to adapt to the specific vocabulary and structure of the KG while keeping the core linguistic knowledge of the PLM frozen. This prevents the "overfitting trap" where a model forgets general knowledge in favor of memorizing specific, sparse graph connections.

Experimental Results and Insights

The framework was evaluated on four diverse datasets: SNOMED CT Core (biomedical), CN-82K (commonsense), FB15k-237 (encyclopedic), and WN18RR (lexical).

Figure 4: Analysis of embedding transformations on the WN18RR dataset, illustrating the relationship between effective dimensionality, knowledge alignment, and Mean Reciprocal Rank (MRR).

As shown in Figure 4, the Residual MLP significantly improves both the alignment of the embeddings with the knowledge graph and the overall Mean Reciprocal Rank (MRR). On the WN18RR dataset, the best-performing model achieved an MRR of .608, a substantial improvement over the BERT-ResNet baseline of .575. Similar gains were observed in the biomedical domain (SNOMED CT Core), where the model reached an MRR of .550 compared to the .492 baseline.

Conclusion

By decoupling query and candidate representations and employing targeted embedding transformations, this framework allows PLMs to be adapted for KGC with high efficiency and accuracy. The results demonstrate that a "text-first" approach, when properly aligned with graph structures, can outperform traditional graph-based models even on benchmarks where structural information was previously considered dominant. Future work will explore hybrid models that can adaptively integrate structural graph features when textual descriptions are sparse or unavailable.

Summary updated

BibTeX
@inproceedings{lovelace2022framework,
  author = {Justin Lovelace and Carolyn P. Rosé},
  title = {{A Framework for Adapting Pre-Trained Language Models to Knowledge Graph Completion}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.398},
}
Figure