SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.06396 · NeurIPS · 2023

Adversarial Robustness in Graph Neural Networks: A Hamiltonian Approach

Yang Song, Kai Zhao, Qiyu Kang, Sijie Wang, Wee Tay

arXiv · PDF · Open in the Atlas

Code that ran

13 of 15 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, 0 violated it and 0 have no contract verdict; 12 failures of our instrument; 2 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/2310.06396.json · badge: /api/ran/2310.06396.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
LFhase/GIA-HAO canonical (classifier label)
classifier basis: census
10 ran · 1 no recorded run
zknus/NeurIPS-2023-HANG-Robustness canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
tk-rusch/GraphCON canonical (classifier label)
classifier basis: census
0 ran · 1 no recorded run
FunctionStatusWhere it lives
GCNAdjNorm Ran
ran; our contract draft was wrong, not the code
LFhase/GIA-HAO/models/model_pyg.py
pointer only (licence: MIT); the stored copy get_code serves, from Leirunlin/Text-level-Graph-Attack, is pointer only (licence: NONE) · get_code("031697fa4856f0d8")
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 Leirunlin/Text-level-Graph-Attack, 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.

edge_sim_analysis Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LFhase/GIA-HAO/attacks/attack.py
pointer only (licence: MIT); the stored copy get_code serves, from Leirunlin/Text-level-Graph-Attack, is pointer only (licence: NONE) · get_code("ee46ccc0db279d01")
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 Leirunlin/Text-level-Graph-Attack, 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.

edge_sim_estimate Ran
ran; our contract draft was wrong, not the code
LFhase/GIA-HAO/attacks/attack.py
pointer only (licence: MIT); the stored copy get_code serves, from Leirunlin/Text-level-Graph-Attack, is pointer only (licence: NONE) · get_code("15b4190a079900a4")
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 Leirunlin/Text-level-Graph-Attack, 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.

eval_acc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LFhase/GIA-HAO/attacks/metric.py
code served (permissive licence) · get_code("399418345f3feb4b")
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 pred tensor: N x num_classes (logits)
# N=2 samples, 4 classes
pred = torch.randn(2, 4)

# Create labels tensor: N x 1 (class indices)
labels = torch.randint(0, 4, (2,))

# Create mask tensor: N x 1 (bool mask)
mask = torch.tensor([True, False])

ARGS = {
    "pred": pred,
    "labels": labels,
    "mask": mask,
}
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
eval_f1multilabel Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LFhase/GIA-HAO/attacks/metric.py
code served (permissive licence) · get_code("cfa29e2de3f6b394")
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 float, 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 small tensors for multi-label classification
# pred: logits in form N * 1 (batch size 2, 1 output)
pred = torch.rand(2, 1, dtype=torch.float32)

# labels: binary labels in form N * 1 (batch size 2, 1 output)
labels = torch.randint(0, 2, (2, 1), dtype=torch.long)

# mask: optional boolean mask in form N * 1 (batch size 2, 1 output)
mask = torch.tensor([[True], [False]], dtype=torch.bool)

ARGS = {
    "pred": pred,
    "labels": labels,
    "mask": mask,
}
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 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
eval_rocauc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LFhase/GIA-HAO/attacks/metric.py
code served (permissive licence) · get_code("4eae1658e4eeb3f7")
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 float, 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 sample pred tensor: N * num_labels
# N=2 samples, 3 labels
pred = torch.randn(2, 3, dtype=torch.float32)

# Create sample labels tensor: N * num_labels
# N=2 samples, 3 labels, values should be 0 or 1
labels = torch.tensor([[1, 0, 1], [0, 1, 1]], dtype=torch.long)

# Create sample mask tensor: N * 1 or just N
# Ensure we have at least some True values to allow evaluation
mask = torch.tensor([True, True], dtype=torch.bool)

ARGS = {
    "pred": pred,
    "labels": labels,
    "mask": mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, 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
feat_normalize Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LFhase/GIA-HAO/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from Leirunlin/Text-level-Graph-Attack, is pointer only (licence: NONE) · get_code("5a4d75b2856d14b5")
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 Leirunlin/Text-level-Graph-Attack, 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.

flag Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LFhase/GIA-HAO/attacks/flag.py
code served (permissive licence) · get_code("902804a2a79afef2")
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
import torch.optim as optim

torch.manual_seed(0)

# Build a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

# Define forward function that takes input and returns output
def forward_fn(x):
    return model(x)

# Create optimizer
optimizer = optim.SGD(model.parameters(), lr=0.01)

# Create criterion
criterion = nn.CrossEntropyLoss()

# Create clean input tensor (batch_size=2, input_dim=4)
clean = torch.randn(2, 4)

# Create target labels (batch_size=2, num_classes=3)
y = torch.tensor([0, 2])

# Create device
device = 'cpu'

# Create args configuration
class Args:
    def __init__(self):
        self.step_size = 0.1
        self.m = 3

args = Args()

# Construct model_forward tuple
model_forward = (model, forward_fn)

# Define ARGS dictionary
ARGS = {
    'model_forward': model_forward,
    'clean': clean,
    'y': y,
    'args': args,
    'optimizer': optimizer,
    'device': device,
    'criterion': criterion
}
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
flag_biased Ran
ran; our contract draft was wrong, not the code
LFhase/GIA-HAO/attacks/flag.py
code served (permissive licence) · get_code("070e6138d16be226")
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)

# Define a minimal model
class MinimalModel(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

# Build the model
input_dim = 4
output_dim = 3
model = MinimalModel(input_dim, output_dim)

# Define a forward function that takes perturbed input
def forward_fn(perturb):
    return model(perturb)

# Create optimizer
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)

# Define criterion
criterion = nn.CrossEntropyLoss(reduction='mean')

# Create args object with required attributes
class Args:
    def __init__(self):
        self.step_size = 0.1
        self.amp = 0.5
        self.m = 3

args = Args()

# Create test data
batch_size = 2
perturb_shape = (batch_size, input_dim)
device = 'cpu'

# Create target labels
y = torch.LongTensor([0, 1])

# Define training_idx (only first sample is labeled)
training_idx = [0]

# Package model_forward as tuple
model_forward = (model, forward_fn)

ARGS = {
    'model_forward': model_forward,
    'perturb_shape': perturb_shape,
    'y': y,
    'args': args,
    'optimizer': optimizer,
    'device': device,
    'criterion': criterion,
    'training_idx': training_idx
}
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
target_select Ran
ran; our contract draft was wrong, not the code
LFhase/GIA-HAO/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from Leirunlin/Text-level-Graph-Attack, is pointer only (licence: NONE) · get_code("231f26eaddf19604")
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 Leirunlin/Text-level-Graph-Attack, 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.

test Ran
ran; our contract draft was wrong, not the code
zknus/NeurIPS-2023-HANG-Robustness/gnn_misg.py
pointer only (licence: NONE) · get_code("768b8716889709e2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zknus/NeurIPS-2023-HANG-Robustness 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.

test_model Ran
ran, honoured the contract we drafted
zknus/NeurIPS-2023-HANG-Robustness/run_metattack_rate.py
pointer only (licence: NONE) · get_code("12cfc91579987423")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zknus/NeurIPS-2023-HANG-Robustness 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.

train Ran
ran; our contract draft was wrong, not the code
zknus/NeurIPS-2023-HANG-Robustness/gnn_misg.py
pointer only (licence: NONE) · get_code("15cbb9f3adf7eca7")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zknus/NeurIPS-2023-HANG-Robustness 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.

get_data Not yet run
unverified (harvested, no recorded run)
tk-rusch/GraphCON/src/heterophilic_graphs/data_handling.py
pointer only (licence: NONE) · get_code("d7cd363f647d52bb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, tk-rusch/GraphCON 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. No invocation recorded.

load_cora Not yet run
unverified (harvested, no recorded run)
LFhase/GIA-HAO/load_graph.py
pointer only (licence: MIT); the stored copy get_code serves, from chris-hzc/RUNG, is pointer only (licence: NONE) · get_code("4e4cc9cc5f692636")
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 chris-hzc/RUNG, 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. No invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 12 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 8 later) and 3 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
GCNAdjNorm 2 other papers
2 later
2405.10757 (2024-05)
Rethinking Graph Backdoor Attacks: A Distribution-Preserving Perspective
2405.16405 (2024-05)
Intruding with Words: Towards Understanding Graph Injection Attacks at the Text Level
feat_normalize 2 other papers
1 dated earlier, 1 later
2111.04314 (2021-11)
Graph Robustness Benchmark: Benchmarking the Adversarial Robustness of Graph Machine Learning
2405.16405 (2024-05)
Intruding with Words: Towards Understanding Graph Injection Attacks at the Text Level
edge_sim_analysis 1 other paper
1 later
2405.16405 (2024-05)
Intruding with Words: Towards Understanding Graph Injection Attacks at the Text Level
edge_sim_estimate 1 other paper
1 later
2405.16405 (2024-05)
Intruding with Words: Towards Understanding Graph Injection Attacks at the Text Level
eval_acc 1 other paper
1 dated earlier
2111.04314 (2021-11)
Graph Robustness Benchmark: Benchmarking the Adversarial Robustness of Graph Machine Learning
eval_f1multilabel 1 other paper
1 dated earlier
2111.04314 (2021-11)
Graph Robustness Benchmark: Benchmarking the Adversarial Robustness of Graph Machine Learning
eval_rocauc 1 other paper
1 dated earlier
2111.04314 (2021-11)
Graph Robustness Benchmark: Benchmarking the Adversarial Robustness of Graph Machine Learning
flag_biased 1 other paper
1 dated earlier
2010.09891 (2020-10)
Robust Optimization as Data Augmentation for Large-scale Graphs
load_cora 1 other paper
1 later
2311.14934 (2023-11)
Robust Graph Neural Networks via Unbiased Aggregation
target_select 1 other paper
1 later
2405.16405 (2024-05)
Intruding with Words: Towards Understanding Graph Injection Attacks at the Text Level
test 1 other paper
1 later
2405.16405 (2024-05)
Intruding with Words: Towards Understanding Graph Injection Attacks at the Text Level
train 1 other paper
1 later
2405.16405 (2024-05)
Intruding with Words: Towards Understanding Graph Injection Attacks at the Text Level

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

Graph neural networks (GNNs) are vulnerable to adversarial perturbations, including those that affect both node features and graph topology. This paper investigates GNNs derived from diverse neural flows, concentrating on their connection to various stability notions such as BIBO stability, Lyapunov stability, structural stability, and conservative stability. We argue that Lyapunov stability, despite its common use, does not necessarily ensure adversarial robustness. Inspired by physics principles, we advocate for the use of conservative Hamiltonian neural flows to construct GNNs that are robust to adversarial attacks. The adversarial robustness of different neural flow GNNs is empirically compared on several benchmark datasets under a variety of adversarial attacks. Extensive numerical experiments demonstrate that GNNs leveraging conservative Hamiltonian flows with Lyapunov stability substantially improve robustness against adversarial perturbations. The implementation code of experiments is available at https://github.com/zknus/NeurIPS-2023-HANG-Robustness.

For agents

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

get_harvested_code_for_paper("2310.06396")
get_code_for_paper("2310.06396")
have("2310.06396")

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

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

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

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

Connect an agent — have() is free.