Papers › KBGAN: Adversarial Learning for Knowledge Graph Embeddings

KBGAN: Adversarial Learning for Knowledge Graph Embeddings

11 Nov 2017NAACL 2018 6arXiv:1711.04071archive 2025-07-28

Liwei Cai, William Yang Wang

We introduce KBGAN, an adversarial learning framework to improve the performances of a wide range of existing knowledge graph embedding models. Because knowledge graphs typically only contain positive facts, sampling useful negative training examples is a non-trivial task. Replacing the head or tail entity of a fact with a uniformly randomly selected entity is a conventional method for generating negative facts, but the majority of the generated negative facts can be easily discriminated from positive facts, and will contribute little towards the training. Inspired by generative adversarial networks (GANs), we use one knowledge graph embedding model as a negative sample generator to assist the training of our desired model, which acts as the discriminator in GANs. This framework is independent of the concrete form of generator and discriminator, and therefore can utilize a wide variety of knowledge graph embedding models as its building blocks. In experiments, we adversarially train two translation-based models, TransE and TransD, each with assistance from one of the two probability-based models, DistMult and ComplEx. We evaluate the performances of KBGAN on the link prediction task, using three knowledge base completion datasets: FB15k-237, WN18 and WN18RR. Experimental results show that adversarial training substantially improves the performances of target embedding models under various settings.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1711.04071")

Code

Syntology Ran 0 of 7 code samples harvested from 3 repositories linked to this paper; 7 have no recorded run.

By repository: official repository: 5 samples from 1 repository, 0 ran; community (archive-listed): 2 samples from 2 repositories, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

cai-lw/KBGAN officialmentioned in papermentioned on GitHubpytorchMIT report
WeidongLi-KG/KBGAN_PyTorch-v0.4.1 mentioned on GitHubpytorchMIT report
cdhx/KBGAN_for_RotatE mentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

7 samples harvested; 0 ran; 0 honoured the contract we drafted; 7 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

7unverified

Licence: 0 of the 7 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 3 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

get_bern_prob cai-lw/KBGAN/corrupter.py official repository unverified MIT (permissive) · db62f010de292105 · report
graph_size cai-lw/KBGAN/read_data.py official repository unverified MIT (permissive) · 833096aa3cb77f0b · report
heads_tails cai-lw/KBGAN/data_utils.py official repository unverified MIT (permissive) · 36c5046a9d1fc4c8 · report
mrr_mr_hitk cai-lw/KBGAN/metrics.py official repository unverified MIT (permissive) · 718b2a832f1896ce · report
read_data cai-lw/KBGAN/read_data.py official repository unverified MIT (permissive) · 59872d7c9c0b328a · report
mrr_mr_hitk WeidongLi-KG/KBGAN_PyTorch-v0.4.1/metrics.py community (archive-listed) unverified MIT (permissive) · 6f77d9ef5bdda39c · report
mrr_mr_hitk cdhx/KBGAN_for_RotatE/metrics.py community (archive-listed) unverified MIT (permissive) · dd4ffbbba9e475b7 · report

Tasks

Graph EmbeddingKnowledge Base CompletionKnowledge Graph EmbeddingKnowledge Graph EmbeddingsKnowledge GraphsLink Prediction

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Link Prediction FB15k-237 KBGAN (TransD + ComplEx) Hits@10 0.458 #68 of 75 Archive leaderboard report
Link Prediction FB15k-237 KBGAN (TransD + ComplEx) MRR 0.277 #68 of 75 Archive leaderboard report
Link Prediction WN18 KBGAN (TransD + ComplEx) Hits@10 0.948 #23 of 37 Archive leaderboard report
Link Prediction WN18 KBGAN (TransD + ComplEx) MRR 0.779 #23 of 37 Archive leaderboard report
Link Prediction WN18RR KBGAN (TransD + ComplEx) Hits@10 0.469 #69 of 75 Archive leaderboard report
Link Prediction WN18RR KBGAN (TransD + ComplEx) MRR 0.215 #69 of 75 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

TransE

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections