SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.08450 · ICML · 2024

Subgraphormer: Unifying Subgraph GNNs and Graph Transformers via Graph Products

Haggai Maron, Beatrice Bevilacqua, Guy Bar-Shalom

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 0 have no contract verdict; 8 failures of our instrument; 3 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/2402.08450.json · badge: /api/ran/2402.08450.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
barsguy/subgraphormer canonical (classifier label)
classifier basis: census
10 ran · 3 no recorded run
FunctionStatusWhere it lives
exclude_indices_efficient Ran
ran; our contract draft was wrong, not the code
barsguy/subgraphormer/utils/preprocess.py
code served (permissive licence) · get_code("0cff4ef795da61b0")
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 int, shape (7,) 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 tensor of sampled indices
# Let's say we're sampling 3 indices from a range of 0 to 10
sampled_indices = torch.tensor([1, 5, 8])

# The range limit N
N = 10

ARGS = {
    "sampled_indices": sampled_indices,
    "N": N,
}
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 int, shape (7,) — shape (7,) 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_loss_func Ran
ran; our contract draft was wrong, not the code
barsguy/subgraphormer/utils/training.py
code served (permissive licence) · get_code("d0664f0de7749db7")
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 torch.nn as nn

torch.manual_seed(0)

# Create a minimal config class with the required structure
class MinimalConfig:
    def __init__(self):
        self.data = DataConfig()

class DataConfig:
    def __init__(self, name='ogbg-molesol'):
        self.name = name

# Create config instances for different test cases
cfg = MinimalConfig()
cfg.data.name = 'ogbg-molesol'

ARGS = {
    'cfg': cfg
}
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, 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
get_optim_func Ran
ran; our contract draft was wrong, not the code
barsguy/subgraphormer/utils/training.py
code served (permissive licence) · get_code("642abf566264fd3f")
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 ASAM. 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 collections import defaultdict

torch.manual_seed(0)

# Create a minimal model with named parameters including some with 'weight' in the name
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.weight_layer = nn.Linear(4, 3)
        self.bias_layer = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.weight_layer(x)
        x = self.bias_layer(x)
        return x

# Create model instance
model = MinimalModel()

# Create a minimal config object with required attributes
class Config:
    def __init__(self):
        self.data = DataConfig()
        self.training = TrainingConfig()

class DataConfig:
    def __init__(self):
        self.name = 'ogbg-molhiv'

class TrainingConfig:
    def __init__(self):
        self.lr = 0.01
        self.wd = 1e-5

cfg = Config()

ARGS = {
    'cfg': cfg,
    'model': model
}
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 ASAM — a ASAM output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ASAM 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
get_sched_func Ran
ran; our contract draft was wrong, not the code
barsguy/subgraphormer/utils/training.py
code served (permissive licence) · get_code("800b168632a34d74")
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 WarmupCosineAnnealingLR. 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.optim import Adam

torch.manual_seed(0)

# Create a minimal model
model = nn.Linear(4, 3)

# Create an optimizer
optimizer = Adam(model.parameters(), lr=0.001)

# Create a minimal config class with the required attributes
class Config:
    def __init__(self):
        self.data = type('obj', (object,), {'name': 'Peptides-func'})()
        self.training = type('obj', (object,), {
            'epochs': 100,
            'lr': 0.001,
            'patience': 10
        })()

cfg = Config()

ARGS = {
    'cfg': cfg,
    'optim': optimizer,
    'warmup_epochs': 10
}
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 WarmupCosineAnnealingLR — a WarmupCosineAnnealingLR output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a WarmupCosineAnnealingLR 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
initialize_best_metrics Ran
ran; our contract draft was wrong, not the code
barsguy/subgraphormer/utils/my_logging.py
code served (permissive licence) · get_code("d06e25f9691220a7")
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
import torch.nn as nn

# Set random seed for reproducibility
torch.manual_seed(0)

# The function initialize_best_metrics only takes one parameter: goal
# It validates that goal is either 'minimize' or 'maximize'
# Then returns a dict with val_loss, test_loss, and epoch keys

ARGS = {
    'goal': 'minimize'
}
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 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
load_config Ran
ran; our contract draft was wrong, not the code
barsguy/subgraphormer/utils/arguments.py
code served (permissive licence) · get_code("bb2d04f8c8fcd377")
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 EasyDict. 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
import yaml
from easydict import EasyDict as edict

# Create a temporary YAML file for testing
temp_dir = tempfile.mkdtemp()
config_path = os.path.join(temp_dir, "test_config.yaml")

# Write a sample config to the temporary file
sample_config = {
    "model": "test_model",
    "batch_size": 32,
    "learning_rate": 0.001,
    "layers": [64, 128, 256],
    "debug": True
}

with open(config_path, 'w') as f:
    yaml.dump(sample_config, f)

ARGS = {
    "path": config_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
easydict, yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EasyDict — a EasyDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a EasyDict 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
override_config_with_args Ran
ran; our contract draft was wrong, not the code
barsguy/subgraphormer/utils/arguments.py
code served (permissive licence) · get_code("3bb8ae1624199e4e")
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 NestedConfig. 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 argparse
import sys
from io import StringIO

class NestedConfig:
    def __init__(self, **kwargs):
        for key, value in kwargs.items():
            setattr(self, key, value)

# Create a mock config object with all required nested attributes
cfg = NestedConfig(
    general=NestedConfig(seed=42, device=0),
    data=NestedConfig(
        name="test_dataset",
        bs=32,
        num_workers=4,
        preprocess=NestedConfig(max_dis=10),
        sampling=NestedConfig(keep_subgraph_prob=0.8, average_res_over=5)
    ),
    model=NestedConfig(
        residual=True,
        aggs=["mean", "sum"],
        sum_pooling=False,
        model_name="test_model",
        num_layer=3,
        dim_embed=64,
        final_dim=32,
        dropout=0.1,
        attention_type="dot",
        H=8,
        PE=NestedConfig(num_eigen_vectors=8, laplacian_type="normalized"),
        atom_encoder=NestedConfig(in_dim=9, linear=True),
        edge_encoder=NestedConfig(in_dim=4, linear=False, use_edge_attr=True),
        layer_encoder=NestedConfig(linear=True)
    ),
    training=NestedConfig(lr=0.001, wd=0.0001, epochs=100, patience=20),
    wandb=NestedConfig(project_name="test_project")
)

# Mock sys.argv to provide empty arguments (will use defaults from cfg)
sys.argv = ["test_script.py"]

ARGS = {
    "cfg": cfg,
    "return_nested": True
}
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 NestedConfig — a NestedConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NestedConfig 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
sample_indices Ran
ran, honoured the contract we drafted
barsguy/subgraphormer/utils/preprocess.py
code served (permissive licence) · get_code("6580312c3a449688")
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 int, shape (5,) 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
import numpy as np

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

ARGS = {
    'n': 10,
    'k': 5
}
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 Tensor, ndim 1, dtype family int, shape (5,) — shape (5,) 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
str2bool Ran
ran, violated the contract we drafted
barsguy/subgraphormer/utils/arguments.py
code served (permissive licence) · get_code("7c508037b40522af")
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) and returned bool, 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 argparse

def str2bool(v):
    if isinstance(v, bool):
        return v
    if v.lower() in ('yes', 'true', 't', 'y', '1'):
        return True
    elif v.lower() in ('no', 'false', 'f', 'n', '0'):
        return False
    else:
        raise argparse.ArgumentTypeError('Boolean value expected.')

# Test cases for str2bool
ARGS = {
    'v': 'true'  # string input that should convert to boolean
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 bool, 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
update_best_metrics Ran
ran; our contract draft was wrong, not the code
barsguy/subgraphormer/utils/my_logging.py
code served (permissive licence) · get_code("92a281b2818ac230")
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

torch.manual_seed(0)

# Construct arguments for update_best_metrics
best_metrics = {
    'val_loss': float('inf'),
    'test_loss': float('inf'),
    'epoch': 0
}

val_metric = 0.5
test_metric = 0.6
epoch = 1
goal = 'minimize'

ARGS = {
    'best_metrics': best_metrics,
    'val_metric': val_metric,
    'test_metric': test_metric,
    'epoch': epoch,
    'goal': goal
}
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 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
get_zinc12k_dataloader Not yet run
unverified (harvested, no recorded run)
barsguy/subgraphormer/utils/data.py
code served (permissive licence) · get_code("e151850124831c8f")
How it ran

no invocation recorded.

get_zincfull_dataloader Not yet run
unverified (harvested, no recorded run)
barsguy/subgraphormer/utils/data.py
code served (permissive licence) · get_code("e0d56ad529d1d5bd")
How it ran

no invocation recorded.

subgraph_construction Not yet run
unverified (harvested, no recorded run)
barsguy/subgraphormer/utils/preprocess.py
code served (permissive licence) · get_code("fbdb0d1a2936ebf7")
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, 4 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 4 later) and 9 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
str2bool 175 other papers
104 dated earlier, 8 the same month, 62 later, 1 same year, order not determinable · 2 only as an assembly brick
1406.6247 (2014-06)
Recurrent Models of Visual Attention
1603.09382 (2016-03)
Deep Networks with Stochastic Depth
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
and 172 more not named here
initialize_best_metrics 1 other paper
1 later
2406.09291 (2024-06)
A Flexible, Equivariant Framework for Subgraph GNNs via Graph Products and Graph Coarsening
load_config 1 other paper
1 later
2406.09291 (2024-06)
A Flexible, Equivariant Framework for Subgraph GNNs via Graph Products and Graph Coarsening
update_best_metrics 1 other paper
1 later
2406.09291 (2024-06)
A Flexible, Equivariant Framework for Subgraph GNNs via Graph Products and Graph Coarsening

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

In the realm of Graph Neural Networks (GNNs), two exciting research directions have recently emerged: Subgraph GNNs and Graph Transformers. In this paper, we propose an architecture that integrates both approaches, dubbed Subgraphormer, which combines the enhanced expressive power, message-passing mechanisms, and aggregation schemes from Subgraph GNNs with attention and positional encodings, arguably the most important components in Graph Transformers. Our method is based on an intriguing new connection we reveal between Subgraph GNNs and product graphs, suggesting that Subgraph GNNs can be formulated as Message Passing Neural Networks (MPNNs) operating on a product of the graph with itself. We use this formulation to design our architecture: first, we devise an attention mechanism based on the connectivity of the product graph. Following this, we propose a novel and efficient positional encoding scheme for Subgraph GNNs, which we derive as a positional encoding for the product graph. Our experimental results demonstrate significant performance improvements over both Subgraph GNNs and Graph Transformers on a wide range of datasets.

For agents

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

get_harvested_code_for_paper("2402.08450")
get_code_for_paper("2402.08450")
have("2402.08450")

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

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

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

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

Connect an agent — have() is free.