# From Discrimination to Generation: Knowledge Graph Completion with Generative Transformer

Source: [From Discrimination to Generation: Knowledge Graph Completion with Generative Transformer](<https://www.sota2.com/research/paper/68fa6eca1e209131cea42268>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-01-04T03:38:08.417Z

Authors: Xin Xie, Ningyu Zhang, Zhoubo Li, Shumin Deng, Hui Chen, Feiyu Xiong, Mosha Chen, Huajun Chen

Published: 2022-02-04T12:52:32.000Z

## Abstract

Knowledge graph completion aims to address the problem of extending a KG with missing triples. In this paper, we provide an approach GenKGC, which converts knowledge graph completion to sequence-to-sequence generation task with the pre-trained language model. We further introduce relation-guided demonstration and entity-aware hierarchical decoding for better representation learning and fast inference. Experimental results on three datasets show that our approach can obtain better or comparable performance than baselines and achieve faster inference speed compared with previous methods with pre-trained language models. We also release a new large-scale Chinese knowledge graph dataset AliopenKG500 for research purpose. Code and datasets are available in https://github.com/zjunlp/PromptKG/tree/main/GenKGC.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Link Prediction on OpenBG500 (test)](<https://www.sota2.com/research/sota/link-prediction-on-openbg500-test.md>): Link Prediction; OpenBG500 (test); Hits@1: 20.3.

- [Link Prediction on WN18RR (test)](<https://www.sota2.com/research/sota/link-prediction-on-wn18rr-test.md>): Link Prediction; WN18RR (test); Hits@10: 53.5.

- [Link Prediction on FB15k-237 (test)](<https://www.sota2.com/research/sota/link-prediction-on-fb15k-237-test.md>): Link Prediction; FB15k-237 (test); Hits@10: 43.9.

- [Knowledge Graph Completion on WN18RR](<https://www.sota2.com/research/sota/knowledge-graph-completion-on-wn18rr.md>): Knowledge Graph Completion; WN18RR; Hits@1: not recorded.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2202.02113>)

[PDF](<https://arxiv.org/pdf/2202.02113.pdf>)

[Implementation](<https://github.com/zjunlp/PromptKG/tree/main/research/GenKGC>)
