{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/kbgan-adversarial-learning-for-knowledge","title":"KBGAN: Adversarial Learning for Knowledge Graph Embeddings","arxiv_id":"1711.04071","date":"2017-11-11","proceeding":"NAACL 2018 6","authors":["Liwei Cai","William Yang Wang"],"abstract":"We introduce KBGAN, an adversarial learning framework to improve the\nperformances of a wide range of existing knowledge graph embedding models.\nBecause knowledge graphs typically only contain positive facts, sampling useful\nnegative training examples is a non-trivial task. Replacing the head or tail\nentity of a fact with a uniformly randomly selected entity is a conventional\nmethod for generating negative facts, but the majority of the generated\nnegative facts can be easily discriminated from positive facts, and will\ncontribute little towards the training. Inspired by generative adversarial\nnetworks (GANs), we use one knowledge graph embedding model as a negative\nsample generator to assist the training of our desired model, which acts as the\ndiscriminator in GANs. This framework is independent of the concrete form of\ngenerator and discriminator, and therefore can utilize a wide variety of\nknowledge graph embedding models as its building blocks. In experiments, we\nadversarially train two translation-based models, TransE and TransD, each with\nassistance from one of the two probability-based models, DistMult and ComplEx.\nWe evaluate the performances of KBGAN on the link prediction task, using three\nknowledge base completion datasets: FB15k-237, WN18 and WN18RR. Experimental\nresults show that adversarial training substantially improves the performances\nof target embedding models under various settings.","url_abs":"http://arxiv.org/abs/1711.04071v3","url_pdf":"http://arxiv.org/pdf/1711.04071v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"kbgan-adversarial-learning-for-knowledge","repo_url":"https://github.com/cai-lw/KBGAN","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"kbgan-adversarial-learning-for-knowledge","repo_url":"https://github.com/WeidongLi-KG/KBGAN_PyTorch-v0.4.1","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"kbgan-adversarial-learning-for-knowledge","repo_url":"https://github.com/cdhx/KBGAN_for_RotatE","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"graph-embedding","task_name":"Graph Embedding"},{"task_slug":"knowledge-base-completion","task_name":"Knowledge Base Completion"},{"task_slug":"knowledge-graph-embedding","task_name":"Knowledge Graph Embedding"},{"task_slug":"knowledge-graph-embeddings","task_name":"Knowledge Graph Embeddings"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":"link-prediction","task_name":"Link Prediction"}],"methods":[{"method_slug":"transe","method_name":"TransE"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/link-prediction-on-fb15k-237","task":"Link Prediction","dataset":"FB15k-237","model":"KBGAN (TransD + ComplEx)","rank_in_archive_order":68,"of":75,"metrics":{"Hits@10":"0.458","MRR":"0.277"},"uses_additional_data":false},{"leaderboard":"/sota/link-prediction-on-wn18","task":"Link Prediction","dataset":"WN18","model":"KBGAN (TransD + ComplEx)","rank_in_archive_order":23,"of":37,"metrics":{"Hits@10":"0.948","MRR":"0.779"},"uses_additional_data":false},{"leaderboard":"/sota/link-prediction-on-wn18rr","task":"Link Prediction","dataset":"WN18RR","model":"KBGAN (TransD + ComplEx)","rank_in_archive_order":69,"of":75,"metrics":{"Hits@10":"0.469","MRR":"0.215"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1711.04071","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1711.04071"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/WeidongLi-KG/KBGAN_PyTorch-v0.4.1","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/cai-lw/KBGAN","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/cdhx/KBGAN_for_RotatE","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":7},"by_repo_kind":{"official":{"samples":5,"ran":0,"repositories":1},"listed":{"samples":2,"ran":0,"repositories":2}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"db62f010de292105","entry":"get_bern_prob","repo":"cai-lw/KBGAN","repo_kind":"official","path":"corrupter.py","file_url":"https://github.com/cai-lw/KBGAN/blob/HEAD/corrupter.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"db62f010de292105"}},{"code_sha256_prefix":"833096aa3cb77f0b","entry":"graph_size","repo":"cai-lw/KBGAN","repo_kind":"official","path":"read_data.py","file_url":"https://github.com/cai-lw/KBGAN/blob/HEAD/read_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"833096aa3cb77f0b"}},{"code_sha256_prefix":"36c5046a9d1fc4c8","entry":"heads_tails","repo":"cai-lw/KBGAN","repo_kind":"official","path":"data_utils.py","file_url":"https://github.com/cai-lw/KBGAN/blob/HEAD/data_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"36c5046a9d1fc4c8"}},{"code_sha256_prefix":"718b2a832f1896ce","entry":"mrr_mr_hitk","repo":"cai-lw/KBGAN","repo_kind":"official","path":"metrics.py","file_url":"https://github.com/cai-lw/KBGAN/blob/HEAD/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"718b2a832f1896ce"}},{"code_sha256_prefix":"6f77d9ef5bdda39c","entry":"mrr_mr_hitk","repo":"WeidongLi-KG/KBGAN_PyTorch-v0.4.1","repo_kind":"listed","path":"metrics.py","file_url":"https://github.com/WeidongLi-KG/KBGAN_PyTorch-v0.4.1/blob/HEAD/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6f77d9ef5bdda39c"}},{"code_sha256_prefix":"dd4ffbbba9e475b7","entry":"mrr_mr_hitk","repo":"cdhx/KBGAN_for_RotatE","repo_kind":"listed","path":"metrics.py","file_url":"https://github.com/cdhx/KBGAN_for_RotatE/blob/HEAD/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dd4ffbbba9e475b7"}},{"code_sha256_prefix":"59872d7c9c0b328a","entry":"read_data","repo":"cai-lw/KBGAN","repo_kind":"official","path":"read_data.py","file_url":"https://github.com/cai-lw/KBGAN/blob/HEAD/read_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"59872d7c9c0b328a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}