Baseline for Inductive KBC

A Simple Baseline for Inductive Knowledge Base Completion

This page describes the work done with AnyBURL to evaluate benchmark datasets for inductive knowledge base completion. As such, this webpage mostly covers the contents of the KR-26 paper "A Simple Baseline for Inductive Knowledge Base Completion" by Christian Meilicke, Rainer Gemulla, Julie Naegelen, and Heiner Stuckenschmidt. It also offers some supplementary ablation results, the results of our baseline on newer benchmarks suggested by Shomer et al. 2025, as well as quick instruction on how to run our baseline on these datasets.

TL;DR: We find that the process by which current IKGC benchmark datasets are created from their transductive successors introduces systematic biases into the graph structure. We also find that a model able to exploit these biases will be able to obtain a relatively high performance without performing any meaningful relational reasoning. Moroever, we build a minimal baseline which does not perform reasoning beyond 1-hop neighbourhood lookup and find it performs on-par with the current SOTA IKGC model, ULTRA.

The Shortest Introduction to IKGC

Knowledge graph completion (KGC) in its most common form aims to answer queries such about connections between entities such as married(John, ?) for a given graph. This query is interesting because while John and his potential marital partner might already be in the dataset, their (existing!) marriage (i.e. the link between them) is not. In short, we assume that the data in the KG is incomplete. Moreoever, we assume that by reasoning over present edges, we can add true but missing ones to the graph.

If this link prediction happens between entities that entities that we saw during training, it is called transductive. If we are to perform link prediction over a graph made up of new entities, it is called inductive.

The latter task of inductive knowledge graph completion (IKGC) is usually motivated either by dynamic KGs where new entities or relations are added to a graph over time, or in the context of foundation models. In the latter case we wish to pretrain a powerful model once, and then apply it on a multitude of new KGs out of the box. Practically speaking, IKGC differs from standard, transductive, KGC in that the entities (and sometimes relations) seen in training must be strictly disjoint from the ones seen at inference time on the target graph. There exist a number of well-established IKGC benchmark datasets, created from original transductive KGC datasets.

Biases in IKGC Benchmarks

The current main benchmark datasets for IKGC are created from their corresponding transductive benchmark by randomly sampling seed entities from the original full graph, then taking their k-hop neighbourhoods for two hops as training graph (snowball sampling). The induced induced k-hop neighbourhood subgraph is removed from the original graph. Then the process is repeated to obtain one or several inference graphs. Entity-and-relation-inductive benchmark datasets are obtained in a similar fashion. Shomer et al. 2025 describe this process in more detail.

Shomer et al. 2025 additionally find that using Personalised Page Rank agnostic of query relation type is enough to obtain IKGC results close to the SOTA on the resulting benchmark datasets. They suggest that this is due to the pipeline above causing entities in negative training samples to be much farther away from each other than in the original transductive baselines. They propose alternative IKGC benchmark datasets created from the original KGs via graph partitioning algorithms.

In our paper we find that the IKGC benchmark dataset pipeline additionally induces skewed entity distributions per relation type. For example, while in the original FB15k-237 dataset the relation profession was rather evenly distributed (abstracting from the 20.7% of entities whose profession is 'actor'), in the inductive splits up to 80% of all examples are covered by only three professions. This means that while in the original graph guessing a person's profession couldn't be done without performing some relational reasoning, in its inductive variants, just returning the most 'popular' entity can give an MRR of up to 84.8%. We argue that this problem is inherently introduced when applying the strict disjointness condition to an existing KG.

A Simple Baseline

To investigate whether good performance on current IKGC benchmark datasets implies complex relational reasoning, we purposefully set up a very limited baseline. Our simple baseline consists of running rule-miner AnyBURL in a restricted setting: we only allow Anyburl to mine rules with length two (i.e. of the form If I am married to John, he is married to me or If a company is based in the US, the company pays taxes there). Additionally, we allow AnyBurl to access the frequency distribution of the target graph. This allows it to exploit the frequency skew from above with a 'popularity rule'. As an example, if the main profession in a given target graph is 'singer', then a query of the form profession(John, ?) will always return 'singer', no matter the context we actually encounter the entity John in the inference graph.

Main Results

We find that our baseline performs very similar to the current SOTA zero-shot model ULTRA, even when we allow ULTRA to perform finetuning on the data domain. We also find that using the alternative inductive splits obtained via graph partitioning does not result in significantly more challenging benchmarks. Lastly, the amount of explanatory power provided by the "popularity rule" alone varies among benchmarks, but it is never insignificant. See the tables below for all results.

Dataset MRR ULTRA-F MRR ULTRA-0 MRR Baseline MRR SOTA
WN-v1 0.685 0.648 0.6464 0.741
WN-v2 0.679 0.663 0.6227 0.704
WN-v3 0.411 0.376 0.3766 0.452
WN-v4 0.614 0.611 0.5893 0.661
FB-v1 0.509 0.498 0.4671 0.457
FB-v2 0.524 0.512 0.5162 0.51
FB-v3 0.504 0.491 0.49 0.476
FB-v4 0.496 0.486 0.4736 0.466
NELL-v1 0.757 0.785 0.8098 0.637
NELL-v2 0.575 0.526 0.6097 0.419
NELL-v3 0.563 0.515 0.5768 0.436
NELL-v4 0.469 0.479 0.5492 0.363
NL-0 0.329 0.342 0.3308 0.269
NL-25 0.407 0.395 0.349 0.334
NL-50 0.418 0.407 0.3757 0.281
NL-75 0.374 0.368 0.3 0.261
NL-100 0.458 0.471 0.4744 0.309
WK-25 0.321 0.316 0.2802 0.186
WK-50 0.14 0.166 0.1589 0.068
WK-75 0.38 0.365 0.3788 0.247
WK-100 0.168 0.164 0.1856 0.107
FB-25 0.383 0.388 0.3587 0.133
FB-75 0.4 0.403 0.3749 0.189
FB-50 0.334 0.338 0.3066 0.117
FB-100 0.444 0.449 0.4062 0.223
ILPC-s 0.303 0.302 0.2794 0.13
ILPC-l 0.308 0.29 0.292 0.07

Ablation Results: New Benchmarks Through Graph Partitioning (Shomer et al. 2025)

Dataset Hits@10 Baseline Hits@10 ULTRA
wn18rr_e_0 0,666 0,719
wn18rr_e_1 0,4301 0,388
fb15k-237_ER_0 0,6437 0,696
fb15k-237_ER_1 0,5964 0,645
codex_m_E_0 0,4418 0,466
codex_m_ER_0 0,443 0,457
codex_m_ER_1 0,8754 0,913

Ablation Results: Popularity Rule Only

Dataset hits@1 Hits@3 Hits@10 MRR
WN18RR-v1 0,0053 0,016 0,0452 0,0176
WN18RR-v2 0,0079 0,0125 0,0363 0,0157
WN18RR-v3 0,0421 0,0669 0,0992 0,0627
WN18RR-v4 0,0031 0,0056 0,0147 0,0067
wn18rr_e_0 0,0126 0,0175 0,0276 0,018
wn18rr_e_1 0,0708 0,118 0,2107 0,1147
fb237-v1 0,1488 0,2293 0,2537 0,19
fb237-v2 0,1548 0,2741 0,3358 0,2187
fb237-v3 0,1543 0,2243 0,3006 0,2021
fb237-v4 0,1352 0,2107 0,2928 0,1865
fb15k-237_ER_0 0,2092 0,3413 0,499 0,3032
fb15k-237_ER_1 0,1161 0,2097 0,3575 0,1943
FB-25 0,1624 0,269 0,4149 0,2402
FB-50 0,1618 0,2506 0,3538 0,2221
FB-75 0,2133 0,3295 0,4177 0,2825
FB-100 0,2596 0,3806 0,4854 0,3363
ILPC-small 0,1084 0,1912 0,3091 0,173
ILPC-large 0,1141 0,212 0,3113 0,1801
codex_m_E_0 0,0615 0,1291 0,2198 0,1127
codex_m_ER_0 0,0903 0,1774 0,2832 0,1538
codex_m_ER_1 0,2365 0,4142 0,6057 0,3591
Nell-v1 0,5 0,5 0,5 0,5
Nell-v2 0,1639 0,25 0,3582 0,2278
Nell-v3 0,2206 0,3158 0,4036 0,2803
Nell-v4 0,1293 0,1778 0,2415 0,1725
NL-0 0,1088 0,1972 0,2195 0,1542
NL-25 0,2129 0,3032 0,3066 0,2556
NL-50 0,2453 0,3362 0,3479 0,2885
NL-75 0,1672 0,2496 0,2974 0,2141
NL-100 0,3058 0,4199 0,459 0,3671
WK-25 0,1141 0,2378 0,305 0,1821
WK-50 0,0423 0,1073 0,2039 0,0918
WK-75 0,1949 0,2915 0,3885 0,2567
WK-100 0,0867 0,1506 0,2394 0,1353

How to Run It

Within the file suppl-mat.zip you find the code/commands and (links to) all datasets that you need to generate the baseline results presented in the paper "A Simple Baseline for Inductive Knowledge Base Completion". Donwload the file and unzip it. There will be a folder suppl, which contains all relevant files.

To run AnyBURL you need to have Java installed on our device. Any version >=12 should work properly (e.g., openjdk12). Type java -version to check your installation.

Results for FB237

We prepared everything to generate the results for the splits of the FB237 datasets from [1]. At the end of this section we explain where to get the other datasets and how to generate results for them.

In each of the experiments, we first need to learn the rules sets. Make the suppl folder the working directory and run AnyBURL with this command:

java -Xmx12G -cp AnyBURL-23-1x.jar de.unima.ki.anyburl.Learn exp/fb237/config-learn.properties

This will run AnyBURL for 30 seconds in the restricted setting that corresponds to the baseline. You can take a look at the config file to see the parameters that result in this setting. The command generates the rule file rules-v1-30 in the exp/fb237 folder. Now you can use these rules to create a ranking file. Use this command:

java -Xmx12G -cp AnyBURL-23-1x.jar de.unima.ki.anyburl.Apply exp/fb237/config-apply.properties 

The resulting ranking file can be evaluated with this command:

java -Xmx12G -cp AnyBURL-23-1x.jar de.unima.ki.anyburl.Eval exp/fb237/config-eval.properties

This generates the following command line output. The first value is the hits@1 score, the second value is the hits@3 score, the third value is the hits@10 score and the last value is the MRR score, which we show in the results tables of our paper.

...
* loading result set at exp/fb237/preds-v1-30
0.4000   0.5341   0.5854   0.4720

There might a slight difference compared to the MRR number shown in the FBe v1 column (which is 46.7 in the paper) , which might be caused by the sampling done within AnyBURL. Differences are usually very small, exception might be the v1 splits of the datasets which are very small in number of test triples.

If you want to generate the results for the v2, v3, and v4 splits of this dataset, you have to change the config-files and rerun the commands above.

All Datasets

The other datasets can be obtained from:

The file names of the target graph differ between these datasets. In [1] it is the train.txt file in the _ind folders. In [2] this file is called inference.txt. In [3] it is the msg.txt file. Once the datasets are downloaded, the config files can be copied and easily adapted to generate the baseline results for all of the datasets. You have to add subfolders manually in the exp folder. [TODO: how to run on the [4] datasets from Shomer et al.]

Contact

If you have any questions, feel free to write an email at any time. We are also very interested if you happened to use our simple baseline!

License

AnyBURL is available under the 3-clause BSD, sometimes referred to as modified BSD license:

Copyright (c) University Mannheim, Data and Web Science Group

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

References

[1] Teru, K.; Denis, E.; and Hamilton, W. 2020. Inductive relation prediction by subgraph reasoning. In International conference on machine learning, PMLR.

[2] Galkin, M.; Berrendorf, M.; and Hoyt, C. T. 2022. An open challenge for inductive link prediction on knowledge graphs. arXiv preprint arXiv:2203.01520.

[3] Lee, J.; Chung, C.; and Whang, J. J. 2023. Ingram: Inductive knowledge graph embedding via relation graphs. In International conference on machine learning, PMLR.

[4] Shomer, H; Revolinsky, J.; and Tang, J. 2025. Towards Better Benchmark Datasets for Inductive Knowledge Graph Completion. In Proceedings of the 32st ACM SIGKDD Conference on Knowledge Discovery and Data Mining, ACM.