SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.09521 · NeurIPS · 2022

A Practical, Progressively-Expressive GNN

Lingxiao Zhao, Leman Akoglu, Neil Shah, Louis Härtel

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 1 failure of our instrument; 0 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/2210.09521.json · badge: /api/ran/2210.09521.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
LingxiaoShawn/KCSetGNN canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
combine_subgraphs Ran
ran; our contract draft was wrong, not the code
LingxiaoShawn/KCSetGNN/core/transform.py
code served (permissive licence) · get_code("6466f9f70510811c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family int, shape (2, 6) 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)

# Define graph structure
# Let's say we have a graph with 5 nodes and 8 edges
num_nodes = 5
num_edges = 8
num_selected = 3  # number of subgraphs

# edge_index: [2, num_edges] - standard graph edge representation
edge_index = torch.tensor([
    [0, 1, 1, 2, 2, 3, 3, 4],  # source nodes
    [1, 0, 2, 1, 3, 2, 4, 3]   # target nodes
], dtype=torch.long)

# subgraphs_nodes: [2, num_subgraph_nodes] 
# First row: which subgraph each node belongs to
# Second row: the actual node ID in the original graph
subgraphs_nodes = torch.tensor([
    [0, 0, 0, 1, 1, 1, 2, 2, 2],  # subgraph indices
    [0, 1, 2, 1, 2, 3, 2, 3, 4]   # node IDs
], dtype=torch.long)

# subgraphs_edges: [2, num_subgraph_edges]
# First row: which subgraph each edge belongs to
# Second row: the edge index in the original edge_index
subgraphs_edges = torch.tensor([
    [0, 0, 1, 1, 2, 2],  # subgraph indices
    [0, 2, 2, 4, 4, 6]   # edge indices
], dtype=torch.long)

ARGS = {
    'edge_index': edge_index,
    'subgraphs_nodes': subgraphs_nodes,
    'subgraphs_edges': subgraphs_edges,
    'num_selected': num_selected,
    'num_nodes': num_nodes
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 int, shape (2, 6) — shape (2, 6) 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
to_sparse Ran
ran, honoured the contract we drafted
LingxiaoShawn/KCSetGNN/core/transform.py
code served (permissive licence) · get_code("8039d4f24f678f0b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, ndim 3, dtype family int; 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

torch.manual_seed(0)

# node_mask: a boolean or binary tensor indicating which nodes are selected
# edge_mask: a boolean or binary tensor indicating which edges are selected
# The function calls .nonzero().T on both, so they should be tensors

# Create a small node mask (e.g., for 5 nodes across 2 subgraphs or similar structure)
node_mask = torch.tensor([
    [1, 0, 1, 0, 1],
    [0, 1, 1, 0, 0]
], dtype=torch.bool)

# Create a small edge mask (e.g., for 6 edges across 2 subgraphs or similar structure)
edge_mask = torch.tensor([
    [1, 0, 0, 1, 0, 1],
    [0, 1, 1, 0, 0, 0]
], dtype=torch.bool)

ARGS = {
    'node_mask': node_mask,
    'edge_mask': edge_mask
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 3, dtype family int — 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
train Ran
ran, honoured the contract we drafted
LingxiaoShawn/KCSetGNN/train/zinc.py
code served (permissive licence) · get_code("c0fb1d8b5fa83a91")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned float, ndim 0, dtype family float, shape () 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
import torch.nn as nn
from torch.utils.data import DataLoader

torch.manual_seed(0)

# Stand-in class for graph data
class GraphData:
    def __init__(self, x, y, num_graphs):
        self.x = x
        self.y = y
        self.num_graphs = num_graphs
    
    def to(self, device):
        new_data = GraphData(self.x.to(device), self.y.to(device), self.num_graphs)
        return new_data

# Create a simple model that takes GraphData and returns predictions
class SimpleGraphModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 1)
    
    def forward(self, data):
        # Handle both single data and list of data
        if isinstance(data, list):
            x = data[0].x
        else:
            x = data.x
        # Simple aggregation: mean over nodes
        x_agg = x.mean(dim=0, keepdim=True)
        return self.linear(x_agg)

# Create train loader with graph data
batch1 = GraphData(
    x=torch.randn(5, 4),  # 5 nodes, 4 features
    y=torch.randn(1),      # 1 target value
    num_graphs=2
)

batch2 = GraphData(
    x=torch.randn(3, 4),  # 3 nodes, 4 features
    y=torch.randn(1),      # 1 target value
    num_graphs=3
)

train_loader = [batch1, batch2]

model = SimpleGraphModel()

optimizer = torch.optim.Adam(model.parameters(), lr=0.001)

device = torch.device('cpu')

scaler = torch.cuda.amp.GradScaler(enabled=False)

ARGS = {
    'train_loader': train_loader,
    'model': model,
    'optimizer': optimizer,
    'device': device,
    'scaler': scaler
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 1 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
combine_subgraphs 3 other papers
3 later
2309.16014 (2023-09)
Graph-level Representation Learning with Joint-Embedding Predictive Architectures
2312.04234 (2023-12)
Graph Convolutions Enrich the Self-Attention in Transformers!
2410.06746 (2024-10)
Cluster-wise Graph Transformer with Dual-granularity Kernelized Attention
to_sparse 3 other papers
3 later
2309.16014 (2023-09)
Graph-level Representation Learning with Joint-Embedding Predictive Architectures
2312.04234 (2023-12)
Graph Convolutions Enrich the Self-Attention in Transformers!
2410.06746 (2024-10)
Cluster-wise Graph Transformer with Dual-granularity Kernelized Attention

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

Message passing neural networks (MPNNs) have become a dominant flavor of graph neural networks (GNNs) in recent years. Yet, MPNNs come with notable limitations; namely, they are at most as powerful as the 1-dimensional Weisfeiler-Leman (1-WL) test in distinguishing graphs in a graph isomorphism testing framework. To this end, researchers have drawn inspiration from the k-WL hierarchy to develop more expressive GNNs. However, current k-WLequivalent GNNs are not practical for even small values of k, as k-WL becomes combinatorially more complex as k grows. At the same time, several works have found great empirical success in graph learning tasks without highly expressive models, implying that chasing expressiveness with a "coarse-grained ruler" of expressivity like k-WL is often unneeded in practical tasks. To truly understand the expressiveness-complexity tradeoff, one desires a more "fine-grained ruler," which can more gradually increase expressiveness. Our work puts forth such a proposal: Namely, we first propose the (k, c)(≤)-SETWL hierarchy with greatly reduced complexity from k-WL, achieved by moving from k-tuples of nodes to sets with ≤k nodes defined over ≤c connected components in the induced original graph. We show favorable theoretical results for this model in relation to k-WL, and concretize it via (k, c)(≤)-SETGNN, which is as expressive as (k, c)(≤)-SETWL. Our model is practical and progressively-expressive, increasing in power with k and c. We demonstrate effectiveness on several benchmark datasets, achieving several state-of-the-art results with runtime and memory usage applicable to practical graphs. We open source our implementation at https://github.com/LingxiaoShawn/KCSetGNN. 36th Conference on Neural Information Processing Systems (NeurIPS 2022).

For agents

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

get_harvested_code_for_paper("2210.09521")
get_code_for_paper("2210.09521")
have("2210.09521")

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

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

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

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

Connect an agent — have() is free.