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

Do Pre-trained Models Benefit Knowledge Graph Completion? A Reliable Evaluation and a Reasonable Approach

Xin Lv, Yankai Lin, Yixin Cao, Lei Hou, Juanzi Li, Zhiyuan Liu, Peng Li, Jie Zhou

Abstract

Knowledge Graph Completion (KGC) is the task of predicting missing links in a graph. Despite the vast factual knowledge contained within Pre-trained Language Models (PLMs), they have historically lagged behind specialized Knowledge Graph Embedding (KGE) models. This paper identifies two critical bottlenecks: the "Closed-World" evaluation trap and the use of incoherent input formats. We introduce PKGC (Prompt-based Knowledge Graph Completion), a model that leverages natural language prompts and auxiliary support information to unlock PLM potential. By transitioning to an "Open-World" evaluation setting, we demonstrate that PLMs are significantly more effective at KGC than previously thought, outperforming traditional state-of-the-art methods.

Introduction: The Evaluation Gap

The standard approach to KGC evaluation relies on the Closed-World Assumption (CWA), which posits that any fact not explicitly present in the knowledge graph is false. However, PLMs like BERT or RoBERTa often "know" valid facts that are simply missing from the graph. Under CWA, a model is penalized for correctly predicting a real-world fact if that fact hasn't been recorded in the specific dataset being used.

The difference between Closed-world and Open-world assumptions in KGC evaluation.

Furthermore, previous PLM-based KGC attempts often used "gibberish" inputs—concatenating entity and relation labels (e.g., "England contains London")—which deviates from the natural language patterns the models were trained on. This prevents the PLM from effectively accessing its internal knowledge.

Methodology: The PKGC Model

To address these issues, we propose PKGC, which transforms KGC into a prompt-based classification task. The model architecture consists of several key components designed to maximize the utility of the PLM's pre-existing knowledge.

Architecture of the PKGC model, showing the integration of triple prompts and support information.

Natural and Soft Prompts

Instead of raw label splicing, PKGC uses "hard templates" to convert triples into natural sentences (e.g., "[X] plays for [Y]"). To further refine the model's understanding of specific relations, we introduce learnable soft prompt vectors. These vectors are tuned during training to capture the nuanced semantics of each relation type.

Support Information

PKGC enhances the input by incorporating "support prompts," which include entity definitions and attributes. For instance, providing the definition "Lebron James: American basketball player" helps the model disambiguate entities and provides richer context for the prediction task.

Open-World Assumption (OWA) Evaluation

We introduce a more realistic evaluation setting where "unseen" triples—those predicted by the model but missing from the graph—are manually annotated. This ensures that models are rewarded, rather than penalized, for discovering true facts that were previously unrecorded.

Experimental Setup and Datasets

We evaluated PKGC on three primary datasets:

  • Wiki27K: A new Wikidata-based dataset with manual annotations for open-world evaluation.
  • FB15K-237-N: A refined version of the Freebase dataset that removes mediator nodes to prevent "easy" predictions.
  • FB15K-237-NH: A version of the above featuring "hard" negative samples to increase the difficulty of triple classification.

Key Results and Insights

Our experiments reveal that PLMs are remarkably effective for KGC when evaluated and prompted correctly.

  • Superior Performance: On the Wiki27K dataset, PKGC achieved 47.5% accuracy (CR@1) under the open-world setting, significantly higher than the 33.0% achieved by the leading KGE model, TuckER. In triple classification, PKGC reached 90.0% accuracy, outperforming previous models like KG-BERT (83.7%).
  • The Power of Context: Entity definitions proved to be the most valuable form of support information, suggesting that descriptive text is crucial for entity disambiguation.
  • Data Efficiency: PKGC is highly robust to data scarcity. When training data was reduced to 10%, PKGC maintained high performance, whereas traditional KGE models, which must learn entity embeddings from scratch, saw dramatic declines.

Conclusion and Future Work

The success of PKGC highlights that the perceived weakness of PLMs in KGC was largely a result of suboptimal evaluation and input formatting. While PKGC offers state-of-the-art accuracy, its primary limitation is computational overhead. Future work will focus on optimizing the "recall and re-rank" strategy to improve inference speed and extending the open-world evaluation to a broader range of KGC benchmarks.

Summary updated

BibTeX
@inproceedings{lv2022do,
  author = {Xin Lv and Yankai Lin and Yixin Cao and Lei Hou and Juanzi Li and Zhiyuan Liu and Peng Li and Jie Zhou},
  title = {{Do Pre-trained Models Benefit Knowledge Graph Completion? A Reliable Evaluation and a Reasonable Approach}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.findings-acl.282},
}
Figure