SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.17396 · 2024

Systematic Relational Reasoning With Epistemic Graph Neural Networks

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 9 failures of our instrument; 1 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/2407.17396.json · badge: /api/ran/2407.17396.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
erg0dic/gnn-sg canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
apply_prob_constraints_row_col Ran
ran; our contract draft was wrong, not the code
erg0dic/gnn-sg/src/utils.py
code served (permissive licence) · get_code("b499d63f3e151bcc")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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)

# The function takes a Tensor and performs probability constraint operations
# It normalizes along the last dimension, then adjusts for row/column constraints
# The tensor should be 2D or higher dimensional

# Create a small test tensor with shape (2, 4)
# This will be normalized along dim=-1 (columns), then adjusted for dim=-2 (rows)
x = torch.rand(2, 4)

ARGS = {
    'x': x
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
compute_algebraic_closure_for_paths Ran
ran; our contract draft was wrong, not the code
erg0dic/gnn-sg/src/comp_dataset_generator.py
code served (permissive licence) · get_code("1f4eed9bd5dab8be")
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 set. 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
import numpy as np
from typing import Dict, List, Set, Tuple

# Construct valid arguments for compute_algebraic_closure_for_paths

# Create a simple composition table
# Maps (label1, label2) tuples to lists of resulting labels
composition_table = {
    (0, 0): [0, 1],
    (0, 1): [1, 2],
    (1, 0): [0, 2],
    (1, 1): [1],
    (2, 0): [0],
    (2, 1): [1, 2],
}

# Create edge_list with multiple edges (as lists of ints representing labels)
# The function expects a list of label sets (or will convert them)
# Looking at the code: edge_list[0] is converted to set(), and edge_list[i+1] is converted to set()
# So edge_list should be a list of lists/sets of integers
edge_list = [
    [0],      # First edge has label 0
    [1],      # Second edge has label 1
    [0, 1],   # Third edge has labels 0 and 1
]

ARGS = {
    "edge_list": edge_list,
    "composition_table": composition_table,
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
compute_sim Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
erg0dic/gnn-sg/src/model_nbf_general.py
code served (permissive licence) · get_code("450e7e3a9b1078da")
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 Tensor, ndim 2, dtype family float, shape (2, 3) 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
from torch.nn.functional import normalize

torch.manual_seed(0)

# Create small tensors with distinct dimensions
# input shape: (n_samples, hidden_dim) = (2, 4)
input_tensor = torch.randn(2, 4)

# relation_in_proto_basis shape: (n_prototypes, hidden_dim) = (3, 4)
relation_in_proto_basis = torch.randn(3, 4)

# Define ARGS dict with all parameters
ARGS = {
    'input': input_tensor,
    'relation_in_proto_basis': relation_in_proto_basis,
    'type': 'cosine',
    'einsum_str': 'nh, ph -> np'
}
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 Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
entropy Ran
ran; our contract draft was wrong, not the code
erg0dic/gnn-sg/src/model_nbf_general.py
code served (permissive licence) · get_code("8941c24e039224c5")
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 Tensor, ndim 1, dtype family float, shape (4,) 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 a small probability tensor (batch_size=2, num_classes=4)
probas = torch.rand(2, 4)
# Normalize to ensure valid probabilities
probas = probas / probas.sum(dim=1, keepdim=True)

ARGS = {
    "probas": probas,
    "axis": 0,
    "eps": 1e-08
}
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 Tensor, ndim 1, dtype family float, shape (4,) — shape (4,) 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
get_acc Ran
ran; our contract draft was wrong, not the code
erg0dic/gnn-sg/src/utils.py
code served (permissive licence) · get_code("47018080816b2451")
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 Tensor, ndim 0, dtype family float, 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
from torch import Tensor

torch.manual_seed(0)

# Create small logits tensor: batch_size=2, num_classes=4
logits = torch.randn(2, 4)

# Create target labels tensor: batch_size=2, with class indices in range [0, 3]
target_labels = torch.LongTensor([0, 3])

ARGS = {
    "logits": logits,
    "target_labels": target_labels,
}
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 Tensor, ndim 0, dtype family float, 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
get_negative_relations Ran
ran; our contract draft was wrong, not the code
erg0dic/gnn-sg/src/model_nbf_fb.py
code served (permissive licence) · get_code("cd8dbbb1d4fa1f4b")
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 Tensor, ndim 3, dtype family float, shape (2, 3, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# relations: tensor of shape (num_relations, feature_dim)
# Should be indexed by relation indices
relations = torch.randn(5, 4)  # 5 relations, 4-dim features

# target_inds: tensor of shape (batch_size,) containing relation indices
# These are the target relations we want to exclude from negative samples
target_inds = torch.tensor([1, 3])  # batch_size = 2

# num_negative_samples: int, number of negative samples per batch item
num_negative_samples = 3

ARGS = {
    "relations": relations,
    "target_inds": target_inds,
    "num_negative_samples": num_negative_samples,
}
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 Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) 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
kl_div Ran
ran; our contract draft was wrong, not the code
erg0dic/gnn-sg/src/model_nbf_fb.py
code served (permissive licence) · get_code("bd75778ce5bcfcd6")
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 Tensor, ndim 1, dtype family float, shape (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 torch

torch.manual_seed(0)

# The function expects two tensors p and q that support:
# - addition with a scalar (eps)
# - torch.log()
# - element-wise division
# - multiplication
# - .sum(axis=-1)

# Create small probability-like tensors
# Shape: (batch=2, dim=4) to keep it tiny
p = torch.tensor([[0.1, 0.2, 0.3, 0.4],
                   [0.25, 0.25, 0.25, 0.25]], dtype=torch.float32)

q = torch.tensor([[0.15, 0.15, 0.3, 0.4],
                   [0.2, 0.3, 0.25, 0.25]], dtype=torch.float32)

ARGS = {
    'p': p,
    'q': q,
    'eps': 1e-12
}
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 Tensor, ndim 1, dtype family float, shape (2,) — shape (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
stable_norm_denominator Ran
ran; our contract draft was wrong, not the code
erg0dic/gnn-sg/src/model_nbf_general.py
code served (permissive licence) · get_code("00538f78c1005cc9")
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 Tensor, ndim 2, dtype family float, shape (2, 1) 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 a small batch of vectors
# Shape: (batch_size=2, vector_dim=4)
vector_batch = torch.randn(2, 4)

# Define arguments dictionary
ARGS = {
    "vector_batch": vector_batch,
    "vec_dim": -1
}
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 Tensor, ndim 2, dtype family float, shape (2, 1) — shape (2, 1) 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
xent Ran
ran; our contract draft was wrong, not the code
erg0dic/gnn-sg/src/model_nbf_fb.py
code served (permissive licence) · get_code("c55be2270957af67")
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 Tensor, ndim 1, dtype family float, shape (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 torch

torch.manual_seed(0)

# p: probability distribution (not logged)
# q: log probability distribution (already logged)
# Both should be tensors with shape (batch, features) where operations sum over axis=-1

p = torch.softmax(torch.randn(2, 4), dim=-1)
q = torch.log_softmax(torch.randn(2, 4), dim=-1)

ARGS = {
    "p": p,
    "q": q,
    "eps": 1e-12
}
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 Tensor, ndim 1, dtype family float, shape (2,) — shape (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
compose Not yet run
unverified (harvested, no recorded run)
erg0dic/gnn-sg/src/comp_dataset_generator.py
code served (permissive licence) · get_code("ae574bc97431f499")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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.

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

Developing models that can learn to reason is a notoriously challenging problem. We focus on reasoning in relational domains, where the use of Graph Neural Networks (GNNs) seems like a natural choice. However, previous work has shown that regular GNNs lack the ability to systematically generalize from training examples on test graphs requiring longer inference chains, which fundamentally limits their reasoning abilities. A common solution relies on neuro-symbolic methods that systematically reason by learning rules, but their scalability is often limited and they tend to make unrealistically strong assumptions, e.g.\ that the answer can always be inferred from a single relational path. We propose the Epistemic GNN (EpiGNN), a novel parameter-efficient and scalable GNN architecture with an epistemic inductive bias for systematic reasoning. Node embeddings in EpiGNNs are treated as epistemic states, and message passing is implemented accordingly. We show that EpiGNNs achieve state-of-the-art results on link prediction tasks that require systematic reasoning. Furthermore, for inductive knowledge graph completion, EpiGNNs rival the performance of state-of-the-art specialized approaches. Finally, we introduce two new benchmarks that go beyond standard relational reasoning by requiring the aggregation of information from multiple paths. Here, existing neuro-symbolic approaches fail, yet EpiGNNs learn to reason accurately. Code and datasets are available at https://github.com/erg0dic/gnn-sg.

For agents

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

get_harvested_code_for_paper("2407.17396")
get_code_for_paper("2407.17396")
have("2407.17396")

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

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

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

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

Connect an agent — have() is free.