SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1905.07854 · 2019

KGAT: Knowledge Graph Attention Network for Recommendation

arXiv · PDF · Open in the Atlas

Code that ran

10 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 3 have no contract verdict; 5 failures of our instrument; 3 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1905.07854.json · badge: /api/ran/1905.07854.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
xiangwang1223/knowledge_graph_attention_network canonical (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
zju-dbl/metakg community (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
LunaBlack/KGAT-pytorch reimplementation (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
average_precision Ran
ran; our contract draft was wrong, not the code
zju-dbl/metakg/utility/metrics.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from zhao254014/clustergcf, is pointer only (licence: NONE) · get_code("ea02c0066939a02c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from zhao254014/clustergcf, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

hasNumbers Ran
ran, violated the contract we drafted
xiangwang1223/knowledge_graph_attention_network/Model/utility/helper.py
pointer only (licence: MIT); the stored copy get_code serves, from Tingting2477/DGCF_torch, is pointer only (licence: NONE) · get_code("f16f715a59169c8a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Tingting2477/DGCF_torch, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

precision_at_k Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zju-dbl/metakg/utility/metrics.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from zhao254014/clustergcf, is pointer only (licence: NONE) · get_code("de0d0e47ac6bbe6c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from zhao254014/clustergcf, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

read_cf Ran
ran, honoured the contract we drafted
zju-dbl/metakg/utility/data_loader.py
code served (permissive licence) · get_code("a943eb44a36720f5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family int, shape (10, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import tempfile
import os

# Create a temporary file with valid input data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("0 1 2 3\n")
temp_file.write("1 4 5 2\n")
temp_file.write("2 6 7 8 9\n")
temp_file.close()

ARGS = {
    'file_name': temp_file.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (10, 2) — shape (10, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_item_list Ran
ran on a synthesized input
zju-dbl/metakg/construct_data.py
code served (permissive licence) · get_code("3f00ab41756c7332")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary file with test data in the expected format
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "items.txt")

# Write test data: header line followed by item entries
with open(temp_file, 'w') as f:
    f.write("org_id\n")
    f.write("org_001\n")
    f.write("org_002\n")
    f.write("org_003\n")

ARGS = {
    'path': temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_user_list Ran
ran on a synthesized input
zju-dbl/metakg/construct_data.py
code served (permissive licence) · get_code("62574d6b7ffda3a6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary file with valid user list data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("org_id user_id\n")
temp_file.write("org_123 user_456\n")
temp_file.write("org_789 user_012\n")
temp_file.write("org_345 user_678\n")
temp_file.close()

ARGS = {
    'path': temp_file.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
recall Ran
ran; our contract draft was wrong, not the code
zju-dbl/metakg/utility/metrics.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from zhao254014/clustergcf, is pointer only (licence: NONE) · get_code("4437293713f250ee")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from zhao254014/clustergcf, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

remap_item Ran
ran on a synthesized input
zju-dbl/metakg/utility/data_loader.py
code served (permissive licence) · get_code("9d48d59360417a6e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from collections import defaultdict

# Construct train_data as a list of (user_id, item_id) tuples
train_data = [
    (0, 5),
    (1, 10),
    (2, 15),
    (0, 20),
    (3, 8)
]

# Construct test_data as a list of (user_id, item_id) tuples
test_data = [
    (0, 25),
    (1, 30),
    (4, 12)
]

# Construct dataset parameter - must be one of the keys in n_user_dataset and n_item_dataset
dataset = 'amazon-book'

ARGS = {
    'train_data': train_data,
    'test_data': test_data,
    'dataset': dataset
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
txt2list Ran
ran; our contract draft was wrong, not the code
xiangwang1223/knowledge_graph_attention_network/Model/utility/helper.py
pointer only (licence: MIT); the stored copy get_code serves, from Tingting2477/DGCF_torch, is pointer only (licence: NONE) · get_code("b07be870060c7e26")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Tingting2477/DGCF_torch, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

uni2str Ran
ran; our contract draft was wrong, not the code
xiangwang1223/knowledge_graph_attention_network/Model/utility/helper.py
pointer only (licence: MIT); the stored copy get_code serves, from Tingting2477/DGCF_torch, is pointer only (licence: NONE) · get_code("ddd78902563c0d71")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Tingting2477/DGCF_torch, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

evaluate Not yet run
unverified (harvested, no recorded run)
LunaBlack/KGAT-pytorch/main_kgat.py
pointer only (licence: NONE) · get_code("9a27969aaabab082")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, LunaBlack/KGAT-pytorch when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_auc Not yet run
unverified (harvested, no recorded run)
zju-dbl/metakg/utility/evaluate.py
code served (permissive licence) · get_code("0671d5a4cbb1c2ac")
How it ran

no invocation recorded.

read_triplets Not yet run
unverified (harvested, no recorded run)
zju-dbl/metakg/utility/data_loader.py
code served (permissive licence) · get_code("a62b98b0ef1ddefd")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 9 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 6 the same month, 9 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
precision_at_k 6 other papers
1 the same month, 5 later
1905.08108 (2019-05)
Neural Graph Collaborative Filtering
2309.17133 (2023-09)
Fine-grained Late-interaction Multi-modal Retrieval for Retrieval Augmented Visual Question Answering
2311.00423 (2023-11)
LLMRec: Large Language Models with Graph Augmentation for Recommendation
and 3 more not named here
recall 6 other papers
1 the same month, 5 later
1905.08108 (2019-05)
Neural Graph Collaborative Filtering
2309.17133 (2023-09)
Fine-grained Late-interaction Multi-modal Retrieval for Retrieval Augmented Visual Question Answering
2311.00423 (2023-11)
LLMRec: Large Language Models with Graph Augmentation for Recommendation
and 3 more not named here
average_precision 5 other papers
1 the same month, 4 later
1905.08108 (2019-05)
Neural Graph Collaborative Filtering
2311.00423 (2023-11)
LLMRec: Large Language Models with Graph Augmentation for Recommendation
2312.16203 (2023-12)
User Consented Federated Recommender System Against Personalized Attribute Inference Attack
and 2 more not named here
hasNumbers 4 other papers
1 the same month, 3 later
1905.08108 (2019-05)
Neural Graph Collaborative Filtering
2007.01764 (2020-07)
Disentangled Graph Collaborative Filtering
2312.16203 (2023-12)
User Consented Federated Recommender System Against Personalized Attribute Inference Attack
and 1 more not named here
txt2list 4 other papers
1 the same month, 3 later
1905.08108 (2019-05)
Neural Graph Collaborative Filtering
2007.01764 (2020-07)
Disentangled Graph Collaborative Filtering
2312.16203 (2023-12)
User Consented Federated Recommender System Against Personalized Attribute Inference Attack
and 1 more not named here
uni2str 4 other papers
1 the same month, 3 later
1905.08108 (2019-05)
Neural Graph Collaborative Filtering
2007.01764 (2020-07)
Disentangled Graph Collaborative Filtering
2312.16203 (2023-12)
User Consented Federated Recommender System Against Personalized Attribute Inference Attack
and 1 more not named here
get_auc 1 other paper
1 later
2307.02759 (2023-07)
Knowledge Graph Self-Supervised Rationalization for Recommendation
read_cf 1 other paper
1 later
2307.02759 (2023-07)
Knowledge Graph Self-Supervised Rationalization for Recommendation
read_triplets 1 other paper
1 later
2307.02759 (2023-07)
Knowledge Graph Self-Supervised Rationalization for Recommendation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

To provide more accurate, diverse, and explainable recommendation, it is compulsory to go beyond modeling user-item interactions and take side information into account. Traditional methods like factorization machine (FM) cast it as a supervised learning problem, which assumes each interaction as an independent instance with side information encoded. Due to the overlook of the relations among instances or items (e.g., the director of a movie is also an actor of another movie), these methods are insufficient to distill the collaborative signal from the collective behaviors of users. In this work, we investigate the utility of knowledge graph (KG), which breaks down the independent interaction assumption by linking items with their attributes. We argue that in such a hybrid structure of KG and user-item graph, high-order relations --- which connect two items with one or multiple linked attributes --- are an essential factor for successful recommendation. We propose a new method named Knowledge Graph Attention Network (KGAT) which explicitly models the high-order connectivities in KG in an end-to-end fashion. It recursively propagates the embeddings from a node's neighbors (which can be users, items, or attributes) to refine the node's embedding, and employs an attention mechanism to discriminate the importance of the neighbors. Our KGAT is conceptually advantageous to existing KG-based recommendation methods, which either exploit high-order relations by extracting paths or implicitly modeling them with regularization. Empirical results on three public benchmarks show that KGAT significantly outperforms state-of-the-art methods like Neural FM and RippleNet. Further studies verify the efficacy of embedding propagation for high-order relation modeling and the interpretability benefits brought by the attention mechanism.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1905.07854")
get_code_for_paper("1905.07854")
have("1905.07854")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1905.07854.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1905.07854.svg)](https://syntology.ai/paper/1905.07854)

Connect an agent — have() is free.