SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.12143 · ICLR · 2024

Graph Neural Networks for Learning Equivariant Representations of Neural Networks

Cees Snoek, Efstratios Gavves, Boris Knyazev, Miltiadis Kofinas, Yan Zhang, David Zhang, Gertjan Burghouts, Yunlu Chen

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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; 5 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2403.12143.json · badge: /api/ran/2403.12143.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
mkofinas/neural-graphs canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
FunctionStatusWhere it lives
count_parameters Ran
ran, honoured the contract we drafted
mkofinas/neural-graphs/experiments/utils.py
code served (permissive licence) · get_code("f6b944f50d3f15ae")
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 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
import torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
Setup block drafted by
a language model, Claude Haiku 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 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
get_mgrid Ran
ran, honoured the contract we drafted
mkofinas/neural-graphs/experiments/data_nfn.py
code served (permissive licence) · get_code("a411cafe9e1009b8")
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 (16, 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)

ARGS = {
    "sidelen": 4,
    "dim": 2
}
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 (16, 2) — shape (16, 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
graph_to_wb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mkofinas/neural-graphs/nn/dense_gnn.py
code served (permissive licence) · get_code("c71fdc64870c14e9")
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 small weight tensors with distinct shapes
# weights[0] has shape (batch=2, features=6) where 6 = 2*3 (output_dim=2, input_dim=3)
# weights[1] has shape (batch=2, features=4) where 4 = 4*1 (output_dim=4, input_dim=1)
weights = [
    torch.randn(2, 2, 3),  # batch=2, output=2, input=3, size=6
    torch.randn(2, 4, 1),  # batch=2, output=4, input=1, size=4
]

# Create small bias tensors with distinct shapes
# biases[0] has shape (batch=2, features=5)
# biases[1] has shape (batch=2, features=3)
biases = [
    torch.randn(2, 5),     # batch=2, size=5
    torch.randn(2, 3),     # batch=2, size=3
]

# edge_features should have total feature dim = sum of all weight sizes = 6 + 4 = 10
edge_features = torch.randn(2, 10)

# node_features should have total feature dim = sum of all bias sizes = 5 + 3 = 8
node_features = torch.randn(2, 8)

# Normalization parameters
weights_mean = [torch.tensor(0.5), torch.tensor(-0.3)]
weights_std = [torch.tensor(0.8), torch.tensor(1.2)]
biases_mean = [torch.tensor(0.1), torch.tensor(-0.2)]
biases_std = [torch.tensor(0.6), torch.tensor(0.9)]

ARGS = {
    "edge_features": edge_features,
    "node_features": node_features,
    "weights": weights,
    "biases": biases,
    "normalize": True,
    "weights_mean": weights_mean,
    "weights_std": weights_std,
    "biases_mean": biases_mean,
    "biases_std": biases_std,
}
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
graphs_to_batch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mkofinas/neural-graphs/nn/dense_relational_transformer.py
code served (permissive licence) · get_code("ad0e9580dae385c1")
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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - edge_features: indexed as [:, row_offset:row_offset + num_in, col_offset:col_offset + num_out]
#   so it's 3D: (batch, rows, cols)
# - node_features: indexed as [:, row_offset:row_offset + num_out]
#   so it's 2D: (batch, rows)
# - weights: list of items, each has .shape with 4 elements (num_in, num_out accessible)
#   weights[0].shape[1] is used, so shape is (?, num_in, num_out, ?)
# - biases: list of items, each has .shape with 3 elements
#   biases[0].shape is (?, num_out, ?) based on unpacking
# - normalize, weights_mean, weights_std, biases_mean, biases_std: optional parameters

# Build tiny tensors for weights and biases
# weights[0].shape[1] will be the first col_offset
# Let's say weights[0] has shape (2, 3, 4, 1) - batch=2, num_in=3, num_out=4, extra=1
# weights[1] has shape (2, 4, 5, 1) - num_in=4 (from prev num_out), num_out=5, extra=1

weights = [
    torch.randn(2, 3, 4, 1),  # shape: (batch, num_in=3, num_out=4, extra)
    torch.randn(2, 4, 5, 1),  # shape: (batch, num_in=4, num_out=5, extra)
]

biases = [
    torch.randn(2, 4, 1),  # shape: (batch, num_out=4, extra)
    torch.randn(2, 5, 1),  # shape: (batch, num_out=5, extra)
]

# edge_features needs to accommodate slicing up to col_offset + num_out
# Initial col_offset = weights[0].shape[1] = 3
# After first weight: col_offset = 3 + 4 = 7
# After second weight: col_offset = 7 + 5 = 12
# Row offsets go from 0 to 3, then 3 to 7
# So edge_features needs at least 12 columns and 7 rows
edge_features = torch.randn(2, 7, 12)  # (batch=2, rows=7, cols=12)

# node_features: row_offset starts at weights[0].shape[1] = 3
# Goes from 3 to 7, then 7 to 12
# So needs at least 12 rows
node_features = torch.randn(2, 12)  # (batch=2, rows=12)

# Normalization parameters
weights_mean = [torch.tensor(0.1), torch.tensor(0.2)]
weights_std = [torch.tensor(1.0), torch.tensor(1.1)]
biases_mean = [torch.tensor(0.05), torch.tensor(0.08)]
biases_std = [torch.tensor(0.9), torch.tensor(1.0)]

ARGS = {
    'edge_features': edge_features,
    'node_features': node_features,
    'weights': weights,
    'biases': biases,
    'normalize': True,
    'weights_mean': weights_mean,
    'weights_std': weights_std,
    'biases_mean': biases_mean,
    'biases_std': biases_std,
}
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 — 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
make_coordinates Ran
ran; our contract draft was wrong, not the code
mkofinas/neural-graphs/experiments/utils.py
code served (permissive licence) · get_code("428fbdfc9efa2e55")
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, 12, 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
import numpy as np

torch.manual_seed(0)

ARGS = {
    'shape': (4, 3),
    'bs': 2,
    'coord_range': (-1, 1)
}
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 3, dtype family float, shape (2, 12, 2) — shape (2, 12, 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
state_dict_to_tensors Ran
ran; our contract draft was wrong, not the code
mkofinas/neural-graphs/experiments/data_nfn.py
code served (permissive licence) · get_code("d127d7b6cd98eaf2")
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
import torch.nn as nn

torch.manual_seed(0)

# Create a state_dict with weight and bias pairs
# The function expects keys in order: [0.weight, 0.bias, 1.weight, 1.bias, ...]
state_dict = {
    '0.weight': torch.randn(4, 3),
    '0.bias': torch.randn(4),
    '1.weight': torch.randn(5, 4),
    '1.bias': torch.randn(5),
}

ARGS = {
    'state_dict': state_dict,
}
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
to_pyg_batch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mkofinas/neural-graphs/nn/dynamic_gnn.py
code served (permissive licence) · get_code("89de1d8986f7d696")
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 DataBatch. 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_geometric

torch.manual_seed(0)

# Batch size: 2, number of nodes per graph: 4, node feature dim: 3
batch_size = 2
num_nodes = 4
node_feature_dim = 3
num_edges_per_graph = 5
edge_feature_dim = 2

# node_features: shape (batch_size, num_nodes, node_feature_dim)
node_features = torch.randn(batch_size, num_nodes, node_feature_dim)

# edge_features: shape (batch_size, num_nodes, num_nodes, edge_feature_dim)
# This allows indexing with edge_index[i][0] and edge_index[i][1]
edge_features = torch.randn(batch_size, num_nodes, num_nodes, edge_feature_dim)

# edge_index: list of edge indices for each graph in batch
# Each element is a tensor of shape (2, num_edges_in_graph)
edge_index = [
    torch.tensor([[0, 1, 2, 1, 3], [1, 2, 3, 0, 2]], dtype=torch.long),
    torch.tensor([[0, 1, 2, 1, 3], [2, 3, 0, 1, 1]], dtype=torch.long)
]

# node_mask: shape (batch_size, num_nodes), boolean mask indicating valid nodes
# True means the node is valid/included
node_mask = torch.tensor([
    [True, True, True, False],
    [True, True, False, True]
], dtype=torch.bool)

ARGS = {
    "node_features": node_features,
    "edge_features": edge_features,
    "edge_index": edge_index,
    "node_mask": node_mask
}
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 DataBatch — a DataBatch 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

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 2 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
count_parameters 180 other papers
119 dated earlier, 2 the same month, 53 later, 6 same year, order not determinable · 8 only as an assembly brick
1705.08415 (2017-05)
Supervised Community Detection with Line Graph Neural Networks
1707.01926 (2017-07)
Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting
1808.09367 (2018-08)
Deriving Machine Attention from Human Rationales
and 177 more not named here
state_dict_to_tensors 1 other paper
1 later
2409.11697 (2024-09)
Monomial Matrix Group Equivariant Neural Functional Networks

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

Neural networks that process the parameters of other neural networks find applications in domains as diverse as classifying implicit neural representations, generating neural network weights, and predicting generalization errors. However, existing approaches either overlook the inherent permutation symmetry in the neural network or rely on intricate weight-sharing patterns to achieve equivariance, while ignoring the impact of the network architecture itself. In this work, we propose to represent neural networks as computational graphs of parameters, which allows us to harness powerful graph neural networks and transformers that preserve permutation symmetry. Consequently, our approach enables a single model to learn from neural graphs with diverse architectures. We showcase the effectiveness of our method on a wide range of tasks, including classification and editing of implicit neural representations, predicting generalization performance, and learning to optimize, while consistently outperforming state-of-the-art methods. The source code is open-sourced at https://github.com/mkofinas/neural-graphs.

For agents

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

get_harvested_code_for_paper("2403.12143")
get_code_for_paper("2403.12143")
have("2403.12143")

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

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

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

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

Connect an agent — have() is free.