MERIT: Scaling KG Foundation Models with Relation Transformers
Organizations: Institute for Artificial Intelligence, University of Stuttgart, Germany · School of Informatics, University of Edinburgh, UK · University of Southampton
Abstract
Knowledge graph (KG) foundation models (KGFMs) predict links on unseen graphs zero-shot. KGFMs have been pioneered by ULTRA which builds a relation graph from co-occurrences that match motif templates, and passes messages over it to obtain relation representations. More recent KGFMs such as MOTIF and TRIX increase the size of this relation graph, and FLOCK replaces message-passing with probabilistic random-walk ensembles. However, larger relation graphs mean more messages, and more walks mean more sequences to encode, so they improve performance at higher training and inference cost. This cost hinders their use in more complex reasoning tasks, such as complex query answering. To reverse this trend, we design MERIT, the first KGFM with a transformer relation encoder: every relation name attends to every other, and the motifs enter as a soft prior rather than as edges. Over 56 benchmarks, MERIT matches the zero-shot MRR of SoTA KGFMs while being 6x faster than TRIX and over 100x faster than FLOCK at inference. Fine-tuned for complex query answering like UltraQuery, MERITQuery improves over it at matched cost.
Figures & tables
| Model | Family 1 | Family 2 | Family 3 | Total | ||||
|---|---|---|---|---|---|---|---|---|
| (13 graphs) | (18 graphs) | (23 graphs) | (54 graphs) | |||||
| MRR | Hits@10 | MRR | Hits@10 | MRR | Hits@10 | MRR | Hits@10 | |
| ULTRA | ||||||||
| MOTIF | ||||||||
| TRIX | ||||||||
| FLOCK | ||||||||
| Model | SQSA | UQSA | SQUA | UQUA |
|---|---|---|---|---|
| ULTRA | ||||
| MOTIF | ||||
| TRIX | ||||
| FLOCK | ||||
| MERIT (ours) |
| All | Conjunctive | Union | Negation | |||||
|---|---|---|---|---|---|---|---|---|
| Family | UltraQuery | MERITQuery | UltraQuery | MERITQuery | UltraQuery | MERITQuery | UltraQuery | MERITQuery |
| Family 1 ( ) | ||||||||
| Family 2 ( ) | ||||||||
| Family 3 ( ) | ||||||||
| All ( ) | ||||||||
Appendix figures & tables18 assets
Supplementary material from the paper’s appendix.
Appendix
| axis | bin | median | benchmarks | |
|---|---|---|---|---|
| relation names | to | 13 | 11 | Wiki MT1 health, WN v1, WN v4, Wiki MT1 tax, WN v2, HM 1k, HM 3k, HM 5k, WN18RR, WN v3, Wiki MT2 org, NELL v1, Wiki MT2 sci |
| to | 13 | 37 | Wiki MT4 health, Hetionet, Wiki MT3 infra, Metafam, ConceptNet100k, WK-100, YAGO310, CoDEx Small, Wiki MT4 sci, Wiki MT3 art, ILPC Small, CoDEx Medium, NL-100 | |
| to | 17 | 112 | ILPC Large, WK-75, CoDEx Large, WK-25, NELL v4, FB-100, NELL v2, WK-50, NL-0, NL-75, NL-50, NL-25, WDsinger, NELL v3, FB v1, FBNELL, FB-75 | |
| to | 12 | 217 | FB v2, NELL23k, NELL995, FB-50, FB v3, FB-25, FB v4, IndigoBM, FB15k237, FB15k237_10, FB15k237_20, FB15k237_50 | |
| to | 2 | 1.04k | DBpedia100k, AristoV4 ∗ | |
| entities | to | 7 | 1.09k | NELL v1, Metafam, WN v1, FB v1, NL-75, FB v2, NL-100 |
| Model | 54 benchmarks | 57 benchmarks | ||
|---|---|---|---|---|
| MRR | Hits@10 | MRR | Hits@10 | |
| ULTRA | ||||
| MOTIF | ||||
| TRIX | ||||
| FLOCK | ||||
| MERIT (ours) | ||||
| Model | inference time (h) | MRR |
|---|---|---|
| ULTRA | ||
| MOTIF | ∗ | |
| TRIX | ||
| FLOCK | ||
| MERIT (ours) |
| Benchmark | ULTRA | MOTIF | TRIX | FLOCK | MERIT |
|---|---|---|---|---|---|
| Family 1 (16) | |||||
| CoDEx Small | |||||
| CoDEx Medium | |||||
| CoDEx Large | |||||
| WDsinger | |||||
| FB15k237_10 | |||||
| Benchmark | ULTRA | MOTIF | TRIX | FLOCK | MERIT |
|---|---|---|---|---|---|
| Family 1 (16) | |||||
| CoDEx Small | |||||
| CoDEx Medium | |||||
| CoDEx Large | |||||
| WDsinger | |||||
| FB15k237_10 | |||||
| model | Orig | SQSA | UQSA | SQUA | UQUA |
|---|---|---|---|---|---|
| zero-shot | |||||
| ULTRA | |||||
| MOTIF | |||||
| TRIX | |||||
| FLOCK | |||||
| MERIT | |||||
| Benchmark | ULTRA | MOTIF | TRIX | FLOCK | MERIT |
|---|---|---|---|---|---|
| FB-25 | |||||
| FB-50 | |||||
| FB-75 | |||||
| FB-100 | |||||
| WK-25 | |||||
| WK-50 |
| Benchmark | ULTRA | MOTIF | TRIX | FLOCK | MERIT |
|---|---|---|---|---|---|
| FB-25 | |||||
| FB-50 | |||||
| FB-75 | |||||
| FB-100 | |||||
| WK-25 | |||||
| WK-50 |
| Model | runs | MRR |
|---|---|---|
| MERIT (motif bias and relation signature) | 5 | |
| motif bias only | 3 | |
| relation signature only | 1 | |
| neither (plain transformer) | 1 | |
| ULTRA | 5 | |
| masked MERIT | 3 |
| Benchmark | Entities | Relation names | Triples | Test triples |
|---|---|---|---|---|
| Family 1 (16) | ||||
| CoDEx Small | ||||
| CoDEx Medium | ||||
| CoDEx Large | ||||
| WDsinger | ||||
| FB15k237_10 | ||||
| Dataset | Entities | Relation names | Training triples | Inference triples | Test triples |
|---|---|---|---|---|---|
| Family 1 | |||||
| FB15k237+H | – | ||||
| NELL995+H | – | ||||
| ICEWS18+H | – | ||||
| Family 2 | |||||
| FB 106%+H | |||||
| conjunction | union | negation | ||||||||||||||
| Dataset | 1p | 2p | 3p | 4p | 2i | 3i | 4i | 1p2i | 2i1p | 2u | 2u1p | 2in | 3in | 2in1p | 2pi1pn | 2nu1p |
| FB15k237, the fine-tuning dataset | ||||||||||||||||
| Training | – | – | – | – | – | – | ||||||||||
| Validation | – | – | ||||||||||||||
| Family 1 | ||||||||||||||||
| FB15k237+H | ||||||||||||||||
Graph Foundation Models
Graph Foundation Models are pretrained graph-learning systems designed to transfer across datasets, tasks, and domains with different structures and features.
See all 96 papers