SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.10960 · ICLR · 2025

Relational Graph Transformer

Matthias Fey, Jure Leskovec, Federico López, Vijay Prakash Dwivedi, Charilaos Kanatsoulis, Sri Jaladi, Yangyi Shen, Rishi Puri

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/2505.10960.json · badge: /api/ran/2505.10960.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
snap-stanford/relgt canonical (classifier label)
classifier basis not recorded on the link
2 ran · 1 no recorded run
snap-stanford/relbench alias (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
HeteroGAT Ran
ran on a synthesized input · constructed an object; no result was computed
snap-stanford/relbench/relbench/modeling/nn.py
code served (permissive licence) · get_code("32e8bc2d6697a27e")
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 an instance of its own class, HeteroGAT: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
from torch_geometric.nn import GATv2Conv, HeteroConv, LayerNorm, PositionalEncoding, SAGEConv

torch.manual_seed(0)

# Define node types and edge types for a heterogeneous graph
node_types = ['paper', 'author']
edge_types = [('paper', 'written_by', 'author'), ('author', 'writes', 'paper')]

# Number of channels and attention heads
channels = 4
heads = 2
num_layers = 2
dropout = 0.1

ARGS = {
    'node_types': node_types,
    'edge_types': edge_types,
    'channels': channels,
    'heads': heads,
    'num_layers': num_layers,
    'dropout': dropout,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type HeteroGAT — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a HeteroGAT 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
build_adjacency_hetero Ran
ran on a synthesized input
snap-stanford/relgt/utils.py
code served (permissive licence) · get_code("4588a832de4420aa")
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 torch
from torch_geometric.data import HeteroData

torch.manual_seed(0)

# Create a HeteroData object with two node types and one edge type
hetero_data = HeteroData()

# Add nodes of type 'author' (3 nodes)
hetero_data['author'].num_nodes = 3

# Add nodes of type 'paper' (2 nodes)
hetero_data['paper'].num_nodes = 2

# Add edge_index for ('author', 'writes', 'paper') edge type
edge_index = torch.tensor([[0, 1, 2], [0, 1, 0]], dtype=torch.long)
hetero_data['author', 'writes', 'paper'].edge_index = edge_index

ARGS = {
    'hetero_data': hetero_data,
    'undirected': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — 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
gather_1_and_2_hop_with_seed_time Ran
ran on a synthesized input
snap-stanford/relgt/utils.py
code served (permissive licence) · get_code("44214cea128be3da")
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 2, 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 random
from torch_geometric.data import HeteroData
from collections import defaultdict

torch.manual_seed(0)
random.seed(0)

# Create a minimal HeteroData object with two node types
data = HeteroData()

# Add node features and time attributes for node type 'user'
data['user'].x = torch.randn(10, 4)
data['user'].time = torch.tensor([100.0, 200.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 900.0, 1000.0])

# Add node features and time attributes for node type 'item'
data['item'].x = torch.randn(8, 4)
data['item'].time = torch.tensor([150.0, 250.0, 350.0, 450.0, 550.0, 650.0, 750.0, 850.0])

# Create adjacency dictionary
# adjacency[node_type][node_idx] = set of (neighbor_type, neighbor_idx) tuples
adjacency = defaultdict(lambda: defaultdict(set))

# Add 1-hop neighbors for node 0 of type 'user'
adjacency['user'][0].add(('item', 0))
adjacency['user'][0].add(('item', 1))
adjacency['user'][0].add(('item', 2))
adjacency['user'][0].add(('user', 1))

# Add 1-hop neighbors for node 1 of type 'user'
adjacency['user'][1].add(('item', 3))
adjacency['user'][1].add(('item', 4))

# Add 2-hop neighbors (neighbors of neighbors)
adjacency['item'][0].add(('user', 2))
adjacency['item'][0].add(('user', 3))
adjacency['item'][0].add(('item', 5))

adjacency['item'][1].add(('user', 4))
adjacency['item'][1].add(('user', 5))

adjacency['item'][2].add(('user', 6))

adjacency['item'][3].add(('user', 7))
adjacency['item'][3].add(('item', 6))

adjacency['item'][4].add(('user', 8))

adjacency['user'][1].add(('item', 7))

# Convert defaultdict to regular dict for the function
adjacency_dict = {
    'user': dict(adjacency['user']),
    'item': dict(adjacency['item'])
}

ARGS = {
    'adjacency': adjacency_dict,
    'data': data,
    'node_type': 'user',
    'node_idx': 0,
    'seed_time': 500.0,
    'max_1hop_threshold': 5000,
    'max_2hop_threshold': 1000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, 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
local_nodes_hetero Not yet run
unverified (harvested, no recorded run)
snap-stanford/relgt/utils.py
code served (permissive licence) · get_code("c1b4b7bfce495312")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 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 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.

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

Repositories linked to this paper

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

Abstract

Relational Deep Learning (RDL) is a promising approach for building state-ofthe-art predictive models on multi-table relational data by representing it as a heterogeneous temporal graph. However, commonly used Graph Neural Network models suffer from fundamental limitations in capturing complex structural patterns and long-range dependencies that are inherent in relational data. While Graph Transformers have emerged as powerful alternatives to GNNs on general graphs, applying them to relational entity graphs presents unique challenges: (i) Traditional positional encodings fail to generalize to massive, heterogeneous graphs; (ii) existing architectures cannot model the temporal dynamics and schema constraints of relational data; (iii) existing tokenization schemes lose critical structural information. Here we introduce the Relational Graph Transformer (RELGT), the first graph transformer architecture designed specifically for relational tables. RELGT employs a novel multi-element tokenization strategy that decomposes each node into five components (features, type, hop distance, time, and local structure), enabling efficient encoding of heterogeneity, temporality, and topology without expensive precomputation. Our architecture combines local attention over sampled subgraphs with global attention to learnable centroids, incorporating both local and databasewide representations. Across 21 tasks from the RelBench benchmark, RELGT consistently matches or outperforms GNN baselines by up to 18%, establishing Graph Transformers as a powerful architecture for Relational Deep Learning 1 .

For agents

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

get_harvested_code_for_paper("2505.10960")
get_code_for_paper("2505.10960")
have("2505.10960")

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

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

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

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

Connect an agent — have() is free.