SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2002.04784 · 2020

Graph Universal Adversarial Attacks: A Few Bad Actors Ruin Graph Learning Models

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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 3 have no contract verdict; 3 failures of our instrument; 1 no recorded run), measured 2026-11-21; 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/2002.04784.json · badge: /api/ran/2002.04784.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
chisam0217/Graph-Universal-Attack canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
add_perturb Ran
ran on a synthesized input
chisam0217/Graph-Universal-Attack/GUA/eval_baseline.py
code served (permissive licence) · get_code("dcd84f5838668f17")
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 ndarray, ndim 2, dtype family float, shape (4, 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 numpy as np

# Create a small adjacency matrix (4x4)
input_adj = np.array([
    [0, 1, 0, 1],
    [1, 0, 1, 0],
    [0, 1, 0, 1],
    [1, 0, 1, 0]
], dtype=float)

# Index to perturb (single row/column)
idx = 1

# Perturbation values for the selected row/column
perturb = np.array([0, 0, 1, 1], dtype=float)

ARGS = {
    'input_adj': input_adj,
    'idx': idx,
    'perturb': perturb
}
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 ndarray, 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
alias_draw Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
chisam0217/Graph-Universal-Attack/node2vec/graph.py
code served (permissive licence) · get_code("5d8936cd49426f76")
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 int64, 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 numpy as np

# Set random seed for reproducibility
np.random.seed(42)

# J should be a list/array of indices to return as fallback
J = np.array([0, 2, 1, 3])

# q should be a probability array with length equal to len(J)
q = np.array([0.3, 0.7, 0.4, 0.6])

ARGS = {
    "J": J,
    "q": q
}
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 int64, 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
count_words Ran
ran on a synthesized input
chisam0217/Graph-Universal-Attack/deepwalk/evaluate_deepwalk.py
code served (permissive licence) · get_code("b30d29f66472e711")
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 Counter. 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
from collections import Counter

torch.manual_seed(0)

# The function count_words takes 'walks' as a parameter
# It iterates over walks (outer loop: for words in walks)
# For each words, it calls c.update(words)
# This means walks is an iterable of iterables
# Each inner iterable should contain word-like objects (strings work well)

# Construct a list of walks, where each walk is a list of words
walks = [
    ['hello', 'world', 'hello'],
    ['foo', 'bar', 'baz'],
    ['hello', 'foo']
]

ARGS = {
    'walks': walks
}
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 Counter — a Counter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Counter 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
encode_onehot Ran
ran; our contract draft was wrong, not the code
chisam0217/Graph-Universal-Attack/GUA/utils.py
code served (permissive licence) · get_code("3ab88254add4c192")
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 ndarray, ndim 2, dtype family int, shape (6, 3) 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 numpy as np

# The function encode_onehot takes labels as input
# labels should be an array-like of class labels (integers, strings, etc.)
# The function creates a one-hot encoding mapping for unique classes

# Create sample labels with multiple distinct classes
labels = np.array([0, 1, 2, 1, 0, 2], dtype=int)

ARGS = {
    "labels": labels
}
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 ndarray, ndim 2, dtype family int, shape (6, 3) — shape (6, 3) 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
largest_connected_components Ran
ran, honoured the contract we drafted
chisam0217/Graph-Universal-Attack/GUA/utils.py
code served (permissive licence) · get_code("11c8a4ad13f75fe4")
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 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 numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import connected_components

# Create a simple sparse graph as adjacency matrix
# We'll create a graph with multiple connected components
# Component 1: nodes 0-2 (size 3)
# Component 2: nodes 3-4 (size 2)
# Component 3: node 5 (size 1)

row = np.array([0, 0, 1, 1, 2, 2, 3, 3, 4, 4])
col = np.array([1, 2, 0, 2, 0, 1, 4, 4, 3, 3])
data = np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1])

adj = csr_matrix((data, (row, col)), shape=(6, 6))

ARGS = {
    "adj": adj,
    "n_components": 1
}
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 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
load_npz Ran
ran on a synthesized input
chisam0217/Graph-Universal-Attack/GUA/utils.py
code served (permissive licence) · get_code("4d18cf730d25baa5")
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 numpy as np
import scipy.sparse as sp
import tempfile
import os

# Create a temporary npz file with the required structure
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, 'test_graph')

# Create sparse adjacency matrix (5x5)
adj_data = np.array([1, 2, 3, 4], dtype=np.float32)
adj_indices = np.array([1, 2, 3, 4], dtype=np.int32)
adj_indptr = np.array([0, 1, 2, 3, 4, 4], dtype=np.int32)
adj_shape = (5, 5)

# Create sparse attribute matrix (5x4)
attr_data = np.array([0.1, 0.2, 0.3, 0.4, 0.5], dtype=np.float32)
attr_indices = np.array([0, 1, 2, 3, 1], dtype=np.int32)
attr_indptr = np.array([0, 1, 2, 3, 4, 5], dtype=np.int32)
attr_shape = (5, 4)

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

# Save to npz file
np.savez(
    temp_file,
    adj_data=adj_data,
    adj_indices=adj_indices,
    adj_indptr=adj_indptr,
    adj_shape=adj_shape,
    attr_data=attr_data,
    attr_indices=attr_indices,
    attr_indptr=attr_indptr,
    attr_shape=attr_shape,
    labels=labels
)

ARGS = {
    'file_name': temp_file
}
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 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
sparse2graph Ran
ran; our contract draft was wrong, not the code
chisam0217/Graph-Universal-Attack/deepwalk/evaluate_deepwalk.py
code served (permissive licence) · get_code("15e201038d5175ee")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import scipy.sparse as sp
import numpy as np

# Create a small sparse matrix in COO format
# The function calls .tocoo() on the input, so we need a sparse matrix
rows = np.array([0, 1, 2, 0, 1])
cols = np.array([1, 2, 0, 2, 1])
data = np.array([1, 2, 3, 4, 5])
sparse_matrix = sp.coo_matrix((data, (rows, cols)), shape=(3, 3))

# Convert to a format that has .tocoo() method (e.g., CSR or CSC)
x = sparse_matrix.tocsr()

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, six — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
alias_setup Not yet run
unverified (harvested, no recorded run)
chisam0217/Graph-Universal-Attack/node2vec/graph.py
code served (permissive licence) · get_code("b097b719cf49daca")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 2 the same month, 4 later) and 2 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
encode_onehot 12 other papers
3 dated earlier, 9 later
1609.02907 (2016-09)
Semi-Supervised Classification with Graph Convolutional Networks
1710.10903 (2017-10)
Graph Attention Networks
1803.03735 (2018-03)
Attention-based Graph Neural Network for Semi-supervised Learning
and 9 more not named here
largest_connected_components 6 other papers
3 dated earlier, 3 later
1803.00816 (2018-03)
NetGAN: Generating Graphs via Random Walks
1805.07984 (2018-05)
Adversarial Attacks on Neural Networks for Graph Data
1902.08412 (2019-02)
Adversarial Attacks on Graph Neural Networks via Meta Learning
and 3 more not named here
alias_setup 5 other papers
3 dated earlier, 1 the same month, 1 later
1607.00653 (2016-07)
node2vec: Scalable Feature Learning for Networks
1911.02613 (2019-11)
Hyper-SAGNN: a self-attention based graph neural network for hypergraphs
1911.08415 (2019-11)
GMAN: A Graph Multi-Attention Network for Traffic Prediction
and 2 more not named here
alias_draw 4 other papers
2 dated earlier, 1 the same month, 1 later
1607.00653 (2016-07)
node2vec: Scalable Feature Learning for Networks
1911.08415 (2019-11)
GMAN: A Graph Multi-Attention Network for Traffic Prediction
2002.05257 (2020-02)
Shortest path distance approximation using deep learning techniques
and 1 more not named here
load_npz 1 other paper
1 dated earlier
1902.08412 (2019-02)
Adversarial Attacks on Graph Neural Networks via Meta Learning
sparse2graph 1 other paper
1 dated earlier
1403.6652 (2014-03)
DeepWalk: Online Learning of Social Representations

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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Deep neural networks, while generalize well, are known to be sensitive to small adversarial perturbations. This phenomenon poses severe security threat and calls for in-depth investigation of the robustness of deep learning models. With the emergence of neural networks for graph structured data, similar investigations are urged to understand their robustness. It has been found that adversarially perturbing the graph structure and/or node features may result in a significant degradation of the model performance. In this work, we show from a different angle that such fragility similarly occurs if the graph contains a few bad-actor nodes, which compromise a trained graph neural network through flipping the connections to any targeted victim. Worse, the bad actors found for one graph model severely compromise other models as well. We call the bad actors ``anchor nodes'' and propose an algorithm, named GUA, to identify them. Thorough empirical investigations suggest an interesting finding that the anchor nodes often belong to the same class; and they also corroborate the intuitive trade-off between the number of anchor nodes and the attack success rate. For the dataset Cora which contains 2708 nodes, as few as six anchor nodes will result in an attack success rate higher than 80\% for GCN and other three models.

For agents

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

get_harvested_code_for_paper("2002.04784")
get_code_for_paper("2002.04784")
have("2002.04784")

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

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

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

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

Connect an agent — have() is free.