SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.12306 · 2023

Understanding Expressivity of GNN in Rule Learning

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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, 0 violated it and 3 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2303.12306.json · badge: /api/ran/2303.12306.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
lars-research/rule-learning-expressivity canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
cal_performance Ran
ran; our contract draft was wrong, not the code
lars-research/rule-learning-expressivity/synthetic/utils.py
code served (permissive licence) · get_code("c02f55c5f11539dd")
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

torch.manual_seed(0)

# The function cal_performance takes 'ranks' parameter
# Looking at the function body:
# - ranks is used with (1.0 / ranks) so it needs to support division
# - ranks is used with .sum() so it needs to be a sequence/tensor
# - ranks is used with len(ranks)
# - ranks is used with <= comparisons (ranks <= 1, ranks <= 10)
# This suggests ranks should be a 1D array-like of numeric values

# Create a small tensor of rank values (some <= 1, some <= 10, some > 10)
ranks = torch.tensor([1.0, 2.0, 5.0, 15.0, 3.0, 8.0], dtype=torch.float32)

ARGS = {
    "ranks": ranks
}
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
cal_ranks Ran
ran, honoured the contract we drafted
lars-research/rule-learning-expressivity/synthetic/utils.py
code served (permissive licence) · get_code("78de15054eb2f1ef")
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 list, 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 numpy as np
from scipy.stats import rankdata

# Set random seed for reproducibility
np.random.seed(0)

# Create small test data
batch_size = 2
num_items = 4

# scores: array of shape (batch_size, num_items) with numeric values
scores = np.array([
    [0.5, 0.3, 0.8, 0.2],
    [0.9, 0.1, 0.4, 0.6]
], dtype=np.float32)

# labels: array of shape (batch_size, num_items) with binary or numeric values
labels = np.array([
    [1, 0, 1, 0],
    [0, 1, 1, 0]
], dtype=np.float32)

# filters: array of shape (batch_size, num_items) with binary or numeric values
# Used as a mask to filter scores
filters = np.array([
    [1, 1, 0, 1],
    [1, 0, 1, 1]
], dtype=np.float32)

ARGS = {
    "scores": scores,
    "labels": labels,
    "filters": filters
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
cal_ranks_v2 Ran
ran on a synthesized input
lars-research/rule-learning-expressivity/synthetic/utils.py
code served (permissive licence) · get_code("bef91f5fe3ef9108")
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 list, 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 numpy as np
from scipy.stats import rankdata

# Create small test arrays
np.random.seed(0)

# scores: 2D array of shape (batch_size, num_items)
# The function performs operations like np.min(scores, axis=1, keepdims=True)
# and rankdata(-scores, method='average', axis=1)
scores = np.array([
    [0.5, 1.2, 0.8, 1.5],
    [0.3, 0.9, 1.1, 0.6]
], dtype=np.float32)

# labels: 2D array of same shape as scores
# Used for element-wise multiplication with ranks: ranks = full_rank * labels
# Typically binary labels (0 or 1)
labels = np.array([
    [1, 0, 1, 0],
    [0, 1, 1, 0]
], dtype=np.float32)

# filters: 2D array of same shape as scores
# Used to set certain positions to low values: scores[np.nonzero(filters)] = 1e-05
# Typically boolean or binary mask
filters = np.array([
    [0, 1, 0, 1],
    [1, 0, 0, 1]
], dtype=bool)

ARGS = {
    "scores": scores,
    "labels": labels,
    "filters": filters
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
detect_variables Ran
ran; our contract draft was wrong, not the code
lars-research/rule-learning-expressivity/real/nbfnet/util.py
pointer only (licence: MIT); the stored copy get_code serves, from ahart34/protein, is pointer only (licence: NONE) · get_code("eab8b6a6ced6d93e")
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 ahart34/protein, 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.

get_root_logger Ran
ran; our contract draft was wrong, not the code
lars-research/rule-learning-expressivity/real/nbfnet/util.py
pointer only (licence: MIT); the stored copy get_code serves, from ahart34/protein, is pointer only (licence: NONE) · get_code("70a68fd646c6e4a7")
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 ahart34/protein, 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.

hits_at_k Ran
ran on a synthesized input
lars-research/rule-learning-expressivity/synthetic/util.py
code served (permissive licence) · get_code("b20e1197f520896c")
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 int, ndim 0, dtype family int, shape () 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 torch

torch.manual_seed(0)

# Create small tensors matching the function signature
batch_size = 2
num_nodes = 4
k = 2

# predicted_prob: (batch_size, num_nodes) - probabilities for each node
predicted_prob = torch.randn(batch_size, num_nodes)

# target_indices: (batch_size,) - ground truth node indices
target_indices = torch.tensor([1, 3])

ARGS = {
    "predicted_prob": predicted_prob,
    "target_indices": target_indices,
    "k": k,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () 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
pad Ran
ran on a synthesized input
lars-research/rule-learning-expressivity/synthetic/util.py
code served (permissive licence) · get_code("651b1389337ea11d")
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. 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 torch

torch.manual_seed(0)

# Create a list of tensors with different lengths
# Each tensor has shape [length, feature_dim]
tensor_list = [
    torch.randn(3, 4),  # 3 timesteps, 4 features
    torch.randn(5, 4),  # 5 timesteps, 4 features
    torch.randn(2, 4),  # 2 timesteps, 4 features
]

pad_idx = 0

ARGS = {
    "tensor_list": tensor_list,
    "pad_idx": pad_idx,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
load_checkpoint Not yet run
unverified (harvested, no recorded run)
lars-research/rule-learning-expressivity/synthetic/util.py
code served (permissive licence) · get_code("8f7351170d2bfdf9")
How it ran

no invocation recorded.

load_extension Not yet run
unverified (harvested, no recorded run)
lars-research/rule-learning-expressivity/synthetic/rspmm/rspmm.py
code served (permissive licence) · get_code("44ca08fdbdeee762")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 4 later) and 5 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
get_root_logger 8 other papers
4 dated earlier, 4 later
2106.06935 (2021-06)
Neural Bellman-Ford Networks: A General Graph Neural Network Framework for Link Prediction
2205.10128 (2022-05)
Neural-Symbolic Models for Logical Queries on Knowledge Graphs
2206.04798 (2022-06)
A*Net: A Scalable Path-based Reasoning Approach for Knowledge Graphs
and 5 more not named here
detect_variables 7 other papers
3 dated earlier, 4 later
2106.06935 (2021-06)
Neural Bellman-Ford Networks: A General Graph Neural Network Framework for Link Prediction
2205.10128 (2022-05)
Neural-Symbolic Models for Logical Queries on Knowledge Graphs
2302.02209 (2023-02)
A Theory of Link Prediction via Relational Weisfeiler-Leman on Knowledge Graphs
and 4 more not named here
cal_performance 1 other paper
1 later
2507.11229 (2025-07)
DuetGraph: Coarse-to-Fine Knowledge Graph Reasoning with Dual-Pathway Global-Local Fusion
cal_ranks 1 other paper
1 later
2507.11229 (2025-07)
DuetGraph: Coarse-to-Fine Knowledge Graph Reasoning with Dual-Pathway Global-Local Fusion

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-22.

Repositories linked to this paper

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

Abstract

Rule learning is critical to improving knowledge graph (KG) reasoning due to their ability to provide logical and interpretable explanations. Recently, Graph Neural Networks (GNNs) with tail entity scoring achieve the state-of-the-art performance on KG reasoning. However, the theoretical understandings for these GNNs are either lacking or focusing on single-relational graphs, leaving what the kind of rules these GNNs can learn an open problem. We propose to fill the above gap in this paper. Specifically, GNNs with tail entity scoring are unified into a common framework. Then, we analyze their expressivity by formally describing the rule structures they can learn and theoretically demonstrating their superiority. These results further inspire us to propose a novel labeling strategy to learn more rules in KG reasoning. Experimental results are consistent with our theoretical findings and verify the effectiveness of our proposed method. The code is publicly available at https://github.com/LARS-research/Rule-learning-expressivity.

For agents

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

get_harvested_code_for_paper("2303.12306")
get_code_for_paper("2303.12306")
have("2303.12306")

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

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

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

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

Connect an agent — have() is free.