SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2004.13825 · 2020

Scalable Attack on Graph Data by Injecting Vicious Nodes

arXiv · PDF · Open in the Atlas

Code that ran

3 of 6 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 1 has no contract verdict; 1 failure of our instrument; 3 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/2004.13825.json · badge: /api/ran/2004.13825.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
wangjh-github/AFGSM canonical (classifier label)
classifier basis: census
3 ran · 3 no recorded run
FunctionStatusWhere it lives
eval_class Ran
ran on a synthesized input
wangjh-github/AFGSM/GCN.py
code served (permissive licence) · get_code("bd327ee362674be9")
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, ndim 1, 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
import tensorflow as tf
from unittest.mock import Mock, MagicMock

# Create a mock GCN model with the necessary attributes and methods
class MockGCN:
    def __init__(self):
        self.session = Mock()
        self.node_ids = Mock()
        self.predictions = Mock()
        
        # Mock the eval method to return prediction logits
        # When eval is called, return mock tensor with argmax capability
        mock_output = np.random.randn(2, 3)  # 2 samples, 3 classes
        self.predictions.eval = Mock(return_value=mock_output)

# Set up numpy random seed for reproducibility
np.random.seed(0)

# Create small test data
num_nodes = 10
num_classes = 3

# Create indices to evaluate (selecting 2 nodes from 10)
ids_to_eval = np.array([0, 5], dtype=np.int32)

# Create labels for all nodes
z_obs = np.random.randint(0, num_classes, size=num_nodes)

# Create mock GCN instance
gcn_model = MockGCN()

# Define the arguments dictionary
ARGS = {
    'ids_to_eval': ids_to_eval,
    'self': gcn_model,
    'z_obs': z_obs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
largest_connected_components Ran
ran, honoured the contract we drafted
wangjh-github/AFGSM/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
preprocess_graph Ran
ran; our contract draft was wrong, not the code
wangjh-github/AFGSM/utils.py
code served (permissive licence) · get_code("1d93a3510e01307b")
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 for testing
# Using a 4x4 matrix (small enough for testing)
# Create a simple graph structure
row = np.array([0, 1, 2, 3, 0, 1])
col = np.array([1, 2, 3, 0, 2, 3])
data = np.array([1.0, 1.0, 1.0, 1.0, 1.0, 1.0])
adj_matrix = sp.csr_matrix((data, (row, col)), shape=(4, 4))

ARGS = {
    'adj': adj_matrix
}
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
dense_dropout Not yet run
unverified (harvested, no recorded run)
wangjh-github/AFGSM/GCN.py
code served (permissive licence) · get_code("fba01510f0247090")
How it ran

no invocation recorded.

load_npz Not yet run
unverified (harvested, no recorded run)
wangjh-github/AFGSM/utils.py
code served (permissive licence) · get_code("927f1359253b2330")
How it ran

no invocation recorded.

sparse_dropout Not yet run
unverified (harvested, no recorded run)
wangjh-github/AFGSM/GCN.py
code served (permissive licence) · get_code("374efabcab5ab5b1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 4 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
largest_connected_components 6 other papers
4 dated earlier, 2 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
preprocess_graph 3 other papers
2 dated earlier, 1 later
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
2005.11079 (2020-05)
Graph Random Neural Networks for Semi-Supervised Learning on Graphs

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

Recent studies have shown that graph convolution networks (GCNs) are vulnerable to carefully designed attacks, which aim to cause misclassification of a specific node on the graph with unnoticeable perturbations. However, a vast majority of existing works cannot handle large-scale graphs because of their high time complexity. Additionally, existing works mainly focus on manipulating existing nodes on the graph, while in practice, attackers usually do not have the privilege to modify information of existing nodes. In this paper, we develop a more scalable framework named Approximate Fast Gradient Sign Method (AFGSM) which considers a more practical attack scenario where adversaries can only inject new vicious nodes to the graph while having no control over the original graph. Methodologically, we provide an approximation strategy to linearize the model we attack and then derive an approximate closed-from solution with a lower time cost. To have a fair comparison with existing attack methods that manipulate the original graph, we adapt them to the new attack scenario by injecting vicious nodes. Empirical experimental results show that our proposed attack method can significantly reduce the classification accuracy of GCNs and is much faster than existing methods without jeopardizing the attack performance.

For agents

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

get_harvested_code_for_paper("2004.13825")
get_code_for_paper("2004.13825")
have("2004.13825")

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

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

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

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

Connect an agent — have() is free.