SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.09104 · ICML · 2023

On Strengthening and Defending Graph Reconstruction Attack with Markov Chain Approximation

Bo Han, Quanming Yao, Jiangchao Yao, Xuan Li, Zhanke Zhou, Chenyu Zhou

arXiv · PDF · Open in the Atlas

Code that ran

23 of 23 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 2 violated it and 11 have no contract verdict; 8 failures of our instrument; 0 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/2306.09104.json · badge: /api/ran/2306.09104.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
tmlr-group/MC-GRA canonical (classifier label)
classifier basis: census
11 ran · 0 no recorded run
tmlr-group/mc-gra reimplementation (classifier label)
classifier basis: classifier_2025
11 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
BaseAttack Ran
ran on a synthesized input · constructed an object; no result was computed
tmlr-group/mc-gra/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("27b61ad1437b1f9c")
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, BaseAttack: the run constructed the object and did not call it, so no result was computed. 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 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
import numpy as np
import scipy.sparse as sp

torch.manual_seed(0)

# Create a minimal surrogate model
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.nclass = 3
        self.nfeat = 4
        self.hidden_sizes = [8, 16]
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal model instance
surrogate_model = MinimalModel()

# Create ARGS dict
ARGS = {
    'model': surrogate_model,
    'nnodes': 10,
    'attack_structure': True,
    'attack_features': False,
    'device': 'cpu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BaseAttack — 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 BaseAttack 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
Info_entropy Ran
ran; our contract draft was wrong, not the code
tmlr-group/mc-gra/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("06c51c6cdd2e1c83")
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

torch.manual_seed(0)

# Create a small probability tensor
# Shape: (2, 4) - batch size 2, 4 probability values
prob = torch.rand(2, 4)
# Ensure it's a valid probability distribution (sums to 1 along last dim)
prob = prob / prob.sum(dim=1, keepdim=True)

ARGS = {
    "prob": prob
}
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
MutualInformation Ran
ran on a synthesized input · constructed an object; no result was computed
tmlr-group/mc-gra/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("8761bdf3ac0917f1")
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, MutualInformation: the run constructed the object and did not call it, so no result was computed. 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 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 numpy as np
import torch
import torch.nn as nn

torch.manual_seed(0)

# Create small test tensors with shape B, C, H, W
# B=2 (batch), C=4 (channels), H=3 (height), W=5 (width)
input1 = torch.randn(2, 4, 3, 5)
input2 = torch.randn(2, 4, 3, 5)

# Normalize inputs to be in valid range for the marginal PDF computation
input1 = torch.clamp(input1, 0, 1)
input2 = torch.clamp(input2, 0, 1)

ARGS = {
    "sigma": 0.4,
    "num_bins": 256,
    "normalize": True,
}
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 MutualInformation — 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 MutualInformation 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
PGDAttack Ran
ran on a synthesized input · constructed an object; no result was computed
tmlr-group/mc-gra/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("20859a342af81901")
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, PGDAttack: the run constructed the object and did not call it, so no result was computed. 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 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
import scipy.sparse as sp
import numpy as np
import math

torch.manual_seed(0)

# Create a minimal surrogate model with required attributes
class SurrogateModel(nn.Module):
    def __init__(self):
        super(SurrogateModel, self).__init__()
        self.nclass = 3
        self.nfeat = 4
        self.hidden_sizes = [8, 16]
        self.fc1 = nn.Linear(4, 8)
        self.fc2 = nn.Linear(8, 3)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

# Create a small sparse adjacency matrix (5 nodes)
nnodes = 5
adj_dense = torch.eye(nnodes, dtype=torch.float32)
adj_dense[0, 1] = 1
adj_dense[1, 0] = 1
adj_dense[1, 2] = 1
adj_dense[2, 1] = 1
adj_csr = sp.csr_matrix(adj_dense.numpy())

# Create node features
features = torch.randn(nnodes, 4, dtype=torch.float32)

# Create labels
labels = torch.tensor([0, 1, 2, 0, 1], dtype=torch.long)

# Create index of attacked node
target_node = 0
attacked_node_idx = torch.tensor([target_node], dtype=torch.long)

# Initialize model
model = SurrogateModel()

ARGS = {
    'model': model,
    'nnodes': nnodes,
    'attack_structure': True,
    'attack_features': False,
    'device': 'cpu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, scipy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PGDAttack — 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 PGDAttack 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
accuracy Ran
ran, honoured the contract we drafted
tmlr-group/MC-GRA/MC-GRA/models/gat.py
pointer only (licence: MIT); the stored copy get_code serves, from TianxiangZhao/GraphSmote, is pointer only (licence: NONE) · get_code("18557871f0c93b3f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from TianxiangZhao/GraphSmote, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

accuracy Ran
ran; our contract draft was wrong, not the code
tmlr-group/mc-gra/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("2a10125e4bf22807")
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
import numpy as np

torch.manual_seed(0)

# Create a small batch of model outputs (logits)
# Shape: (batch_size=2, num_classes=4)
output = torch.randn(2, 4)

# Create labels for the batch
# Shape: (batch_size=2,) with class indices
labels = torch.LongTensor([1, 3])

ARGS = {
    "output": output,
    "labels": labels,
}
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 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
calc_mrr Ran
ran on a synthesized input
tmlr-group/MC-GRA/MC-GRA/gaussian_parameterized.py
code served (permissive licence) · get_code("ac45b872d56028b3")
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 float64, ndim 0, 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 numpy as np

# The function calc_mrr expects:
# - real_edge: a numpy array with binary values (0 or 1)
# - pred_edge: a numpy array with prediction scores

# Create small test arrays
np.random.seed(0)

# real_edge: binary array indicating true edges (1) and non-edges (0)
real_edge = np.array([1, 0, 1, 0, 1, 0, 0, 1])

# pred_edge: prediction scores corresponding to each edge
# Higher scores indicate higher confidence in edge existence
pred_edge = np.array([0.9, 0.2, 0.8, 0.3, 0.7, 0.1, 0.15, 0.95])

ARGS = {
    "real_edge": real_edge,
    "pred_edge": pred_edge,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
calc_mrr_all Ran
ran on a synthesized input
tmlr-group/MC-GRA/MC-GRA/gaussian_parameterized.py
code served (permissive licence) · get_code("d147e77a227e1ec8")
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 float64, ndim 0, 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 numpy as np

# Analyze the function:
# - real_edge: used with == 1 comparison, so it's a numpy array of binary values
# - pred_edge: used with np.extract, > comparison, .astype(int), .sum(), .size
#   So it's a numpy array of numeric values
# 
# The function extracts values from pred_edge where real_edge == 1,
# then calculates MRR (Mean Reciprocal Rank)

# Create small numpy arrays
# real_edge: binary array indicating true edges
real_edge = np.array([1, 0, 1, 0, 1, 0])

# pred_edge: prediction scores/confidence values
# Should be numeric array with same size as real_edge
pred_edge = np.array([0.9, 0.3, 0.8, 0.2, 0.7, 0.1])

ARGS = {
    "real_edge": real_edge,
    "pred_edge": pred_edge,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
distmat Ran
ran on a synthesized input
tmlr-group/MC-GRA/MC-GRA/hsic.py
code served (permissive licence) · get_code("f5d7ba6e6fc594f1")
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, 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)

# Create a small 2D tensor for computing distance matrix
# Shape: (batch_size=2, feature_dim=4)
X = torch.randn(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, 2) — shape (2, 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
dot_product_decode Ran
ran on a synthesized input
tmlr-group/MC-GRA/MC-GRA/defense/use_model.py
code served (permissive licence) · get_code("6ca867ba81c38181")
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, 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 Z to be a 2D tensor (matrix)
# It performs matrix multiplication Z @ Z.T, then applies relu and subtracts identity
# Z should be a square or rectangular matrix
Z = torch.randn(2, 4)

ARGS = {
    "Z": Z
}
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, 2) — shape (2, 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
dot_product_decode Ran
ran on a synthesized input
tmlr-group/MC-GRA/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("a49a86f5e036e7fe")
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, 2) 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.functional as F

torch.manual_seed(0)

# The function expects Z to be a tensor
# It normalizes Z, computes a matrix product, and applies relu with identity subtraction
# Z needs to be 2D for matmul(Z, Z.t()) to work
# Shape: (batch_size, embedding_dim)

Z = torch.randn(2, 4)

ARGS = {
    "Z": Z
}
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, 2) — shape (2, 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
is_sparse_tensor Ran
ran, violated the contract we drafted
tmlr-group/mc-gra/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("52dc6af09a603269")
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 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 torch

torch.manual_seed(0)

# Create a sparse COO tensor
indices = torch.tensor([[0, 1, 2], [0, 1, 2]])
values = torch.tensor([1.0, 2.0, 3.0])
sparse_tensor = torch.sparse_coo_tensor(indices, values, (3, 3))

ARGS = {
    "tensor": sparse_tensor
}
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 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
kernelmat Ran
ran on a synthesized input
tmlr-group/MC-GRA/MC-GRA/hsic.py
code served (permissive licence) · get_code("e3c0f8ba33d86df6")
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, 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)

# Create small sample tensors for X
# X should be a 2D tensor of shape (batch_size, feature_dim)
X = torch.randn(2, 4, dtype=torch.float32)

ARGS = {
    'X': X,
    'sigma': None  # Using None to trigger sigma_estimation in kernelmat
}
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 2, dtype family float, shape (2, 2) — shape (2, 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
metric Ran
ran on a synthesized input
tmlr-group/MC-GRA/MC-GRA/gaussian_parameterized.py
code served (permissive licence) · get_code("ffdd100106716576")
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
import numpy as np
from torchmetrics import AUROC

torch.manual_seed(0)

# Create small adjacency matrices (5x5)
# These should be float tensors with values in [0, 1] for AUROC
ori_adj = torch.rand(5, 5)
inference_adj = torch.rand(5, 5)

# idx is used to index into the adjacency matrix: ori_adj[idx, :][:, idx]
# This means idx should be a valid index or list of indices
idx = [0, 1, 2]

# index_delete is used with np.delete on reshaped 1D arrays
# For a 3x3 submatrix reshaped to 9 elements, valid indices are 0-8
index_delete = [0, 4, 8]

ARGS = {
    'ori_adj': ori_adj,
    'inference_adj': inference_adj,
    'idx': idx,
    'index_delete': index_delete,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, torchmetrics — 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
normalization Ran
ran, violated the contract we drafted
this paper's copy was not recorded; identical code first harvested from thuml/dare
pointer only; the stored copy get_code serves, from thuml/dare, is pointer only (licence: NONE) · get_code("86c7147edb17dd5d")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

normalize_adj Ran
ran; our contract draft was wrong, not the code
tmlr-group/mc-gra/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("6002a1395bc2b25d")
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 csr_matrix. 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 numpy as np
import scipy.sparse as sp

# Create a small sparse adjacency matrix
# Using a 4x4 matrix for simplicity
rows = [0, 0, 1, 2, 2, 3]
cols = [1, 3, 2, 0, 3, 1]
data = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
mx = sp.csr_matrix((data, (rows, cols)), shape=(4, 4))

ARGS = {
    "mx": mx
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type csr_matrix — a csr_matrix output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a csr_matrix 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
normalize_adj_tensor Ran
ran; our contract draft was wrong, not the code
tmlr-group/mc-gra/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("efa838a9d8cb2b22")
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 (4, 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
import scipy.sparse as sp
import numpy as np

torch.manual_seed(0)

# Create a small dense adjacency matrix (4x4)
adj_dense = torch.tensor([
    [0.0, 1.0, 0.0, 1.0],
    [1.0, 0.0, 1.0, 0.0],
    [0.0, 1.0, 0.0, 1.0],
    [1.0, 0.0, 1.0, 0.0]
], dtype=torch.float32)

# Create a sparse adjacency matrix for sparse=True case
sparse_coo_mx = sp.csr_matrix(adj_dense.numpy())
sparse_coo_mx = sparse_coo_mx.tocoo()
indices = torch.from_numpy(np.vstack((sparse_coo_mx.row, sparse_coo_mx.col)).astype(np.int64))
values = torch.from_numpy(sparse_coo_mx.data.astype(np.float32))
adj_sparse = torch.sparse.FloatTensor(indices, values, torch.Size(sparse_coo_mx.shape))

ARGS = {
    "adj": adj_dense,
    "sparse": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, 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 (4, 4) — shape (4, 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
parse_index_file Ran
ran, honoured the contract we drafted
tmlr-group/MC-GRA/MC-GRA/dataset.py
code served (permissive licence) · get_code("5c3fa9402a9405bc")
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 list, ndim 1, 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 tempfile
import os

# Create a temporary file with index data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("0\n")
temp_file.write("1\n")
temp_file.write("5\n")
temp_file.write("3\n")
temp_file.close()

ARGS = {
    "filename": temp_file.name
}
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 list, ndim 1, dtype family int — 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
sampling_MI Ran
ran on a synthesized input
tmlr-group/MC-GRA/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("822a38907beda1d8")
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

torch.manual_seed(0)

# Create a small probability tensor (batch_size=2, features=4)
prob = torch.rand(2, 4)

# tau is a float parameter controlling the temperature/baseline
tau = 0.5

# reduction is a string parameter for how to aggregate results
reduction = 'mean'

ARGS = {
    'prob': prob,
    'tau': tau,
    'reduction': reduction
}
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
sigma_estimation Ran
ran; our contract draft was wrong, not the code
tmlr-group/MC-GRA/MC-GRA/hsic.py
code served (permissive licence) · get_code("81e80990e0255bc4")
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 float32, 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
import numpy as np

torch.manual_seed(0)

# Create small tensors for X and Y
# X: shape (2, 4) - 2 samples, 4 dimensions
# Y: shape (3, 4) - 3 samples, 4 dimensions
X = torch.randn(2, 4)
Y = torch.randn(3, 4)

ARGS = {
    "X": X,
    "Y": Y
}
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 float32, 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
tensor2onehot Ran
ran; our contract draft was wrong, not the code
tmlr-group/mc-gra/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("edde8b8b03e59989")
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 (6, 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 label tensor with values from 0 to 3
# This will test the function's ability to create onehot encoding
labels = torch.LongTensor([0, 1, 2, 3, 1, 0])

ARGS = {
    "labels": 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 2, dtype family float, shape (6, 4) — shape (6, 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
to_scipy Ran
ran; our contract draft was wrong, not the code
tmlr-group/mc-gra/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("3aeda921e3028bde")
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 csr_matrix. 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 scipy.sparse as sp

torch.manual_seed(0)

# Create a sparse tensor in COO format
indices = torch.tensor([[0, 1, 1], [0, 1, 2]], dtype=torch.long)
values = torch.tensor([1.0, 2.0, 3.0], dtype=torch.float32)
sparse_tensor = torch.sparse_coo_tensor(indices, values, (2, 4))

ARGS = {
    "tensor": sparse_tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type csr_matrix — a csr_matrix output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a csr_matrix 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
to_tensor Ran
ran; our contract draft was wrong, not the code
tmlr-group/mc-gra/MC-GRA/topology_attack.py
code served (permissive licence) · get_code("98b9562f9f93cf6a")
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. 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 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 numpy as np
import scipy.sparse as sp
import torch

torch.manual_seed(0)

# Create a small sparse adjacency matrix (4x4)
adj_sparse = sp.csr_matrix(
    ([1, 1, 1, 1], ([0, 1, 2, 3], [1, 2, 3, 0])),
    shape=(4, 4),
    dtype=np.float32
)

# Create a small sparse feature matrix (4x3)
features_sparse = sp.csr_matrix(
    ([1, 1, 1, 1, 1, 1], ([0, 1, 2, 2, 3, 3], [0, 1, 0, 2, 1, 2])),
    shape=(4, 3),
    dtype=np.float32
)

# Create labels for 4 nodes
labels = np.array([0, 1, 0, 1], dtype=np.int64)

ARGS = {
    'adj': adj_sparse,
    'features': features_sparse,
    'labels': labels,
    'device': 'cpu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, 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

Also present in other papers' code

Of 23 samples lifted from this paper's linked repositories, 23 carry a function identity and 0 do not. Of the 23 distinct functions with an identity, 9 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 0 the same month, 5 later) and 14 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
parse_index_file 53 other papers
42 dated earlier, 11 later · 1 only as an assembly brick
1603.08861 (2016-03)
Revisiting Semi-Supervised Learning with Graph Embeddings
1611.07308 (2016-11)
Variational Graph Auto-Encoders
1710.10568 (2017-10)
Stochastic Training of Graph Convolutional Networks with Variance Reduction
and 50 more not named here
accuracy 14 other papers
11 dated earlier, 3 later
1902.07153 (2019-02)
Simplifying Graph Convolutional Networks
1905.09550 (2019-05)
Revisiting Graph Neural Networks: All We Have is Low-Pass Filters
2002.07128 (2020-02)
Disease State Prediction From Single-Cell Data Using Graph Attention Networks
and 11 more not named here
sigma_estimation 11 other papers
4 dated earlier, 7 later
1908.01580 (2019-08)
The HSIC Bottleneck: Deep Learning without Back-Propagation
2106.01939 (2021-06)
Causal Effect Inference for Structured Treatments
2106.02734 (2021-06)
Revisiting Hilbert-Schmidt Information Bottleneck for Adversarial Robustness
and 8 more not named here
normalization
brick of this paper's assembly: helper
4 other papers
1 dated earlier, 3 later
2207.13325 (2022-07)
SiRi: A Simple Selective Retraining Mechanism for Transformer-based Visual Grounding
2407.11633 (2024-07)
Scaling Diffusion Transformers to 16 Billion Parameters
2410.02604 (2024-10)
Long-Sequence Recommendation Models Need Decoupled Embeddings
and 1 more not named here
tensor2onehot
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later
2005.06149 (2020-05)
DeepRobust: A PyTorch Library for Adversarial Attacks and Defenses
aaai_29668 (2024 (year only))
Robust Node Classification on Graph Data with Graph and Label Noise
BaseAttack
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2106.02820 (2021-06)
GraphMI: Extracting Private Graph Data from Graph Neural Networks
is_sparse_tensor
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2106.02820 (2021-06)
GraphMI: Extracting Private Graph Data from Graph Neural Networks
to_scipy
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2106.02820 (2021-06)
GraphMI: Extracting Private Graph Data from Graph Neural Networks
to_tensor
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2110.14038 (2021-10)
Robustness of Graph Neural Networks at Scale

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

Although powerful graph neural networks (GNNs) have boosted numerous real-world applications, the potential privacy risk is still underexplored. To close this gap, we perform the first comprehensive study of graph reconstruction attack that aims to reconstruct the adjacency of nodes. We show that a range of factors in GNNs can lead to the surprising leakage of private links. Especially by taking GNNs as a Markov chain and attacking GNNs via a flexible chain approximation, we systematically explore the underneath principles of graph reconstruction attack, and propose two information theory-guided mechanisms: (1) the chain-based attack method with adaptive designs for extracting more private information; (2) the chain-based defense method that sharply reduces the attack fidelity with moderate accuracy loss. Such two objectives disclose a critical belief that to recover better in attack, you must extract more multi-aspect knowledge from the trained GNN; while to learn safer for defense, you must forget more link-sensitive information in training GNNs. Empirically, we achieve state-ofthe-art results on six datasets and three common GNNs. The code is publicly available at: https: //github.com/tmlr-group/MC-GRA.

For agents

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

get_harvested_code_for_paper("2306.09104")
get_code_for_paper("2306.09104")
have("2306.09104")

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

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

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

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

Connect an agent — have() is free.