SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.16693 · 2025

ATOM: A Framework of Detecting Query-Based Model Extraction Attacks for Graph Neural Networks

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 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; 2 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/2503.16693.json · badge: /api/ran/2503.16693.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
LabRAI/ATOM canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
custom_reward_function Ran
ran, honoured the contract we drafted
LabRAI/ATOM/evaluation/ppo_eval.py
code served (permissive licence) · get_code("c3a5f1f81ad49e4f")
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 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)

# The function takes two scalar arguments: predicted and label
# Both are compared with integer values (0 and 1), so they should be integers or tensors that can be compared

predicted = 1
label = 0

ARGS = {
    "predicted": predicted,
    "label": label
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
test_model Ran
ran; our contract draft was wrong, not the code
LabRAI/ATOM/evaluation/ppo_eval.py
code served (permissive licence) · get_code("ac42a65528c80bfd")
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 torch
import torch.nn as nn
from torch.nn.utils.rnn import pad_sequence
import numpy as np

torch.manual_seed(0)

# Define minimal agent model
class MinimalAgent(nn.Module):
    def __init__(self, state_dim, action_dim):
        super().__init__()
        self.fc = nn.Linear(state_dim, action_dim)
    
    def select_action(self, states):
        logits = self.fc(states)
        probs = torch.softmax(logits, dim=-1)
        actions = torch.argmax(probs, dim=-1)
        action_probs = probs.max(dim=-1)[0]
        return actions, action_probs, None, None
    
    def eval(self):
        super().eval()
        return self

# Define minimal GRU model
class MinimalGRU(nn.Module):
    def __init__(self, input_size, hidden_size):
        super().__init__()
        self.gru = nn.GRU(input_size, hidden_size, batch_first=True)
    
    def process_sequence(self, inputs):
        output, _ = self.gru(inputs)
        return output
    
    def eval(self):
        super().eval()
        return self

# Define minimal MLP transform
class MinimalMLP(nn.Module):
    def __init__(self, input_size, output_size):
        super().__init__()
        self.fc = nn.Linear(input_size, output_size)
    
    def forward(self, x):
        batch_size = x.size(0)
        max_seq = x.size(1)
        action_dim = x.size(2)
        x_reshaped = x.view(-1, action_dim)
        out = self.fc(x_reshaped)
        return out.view(batch_size, max_seq, -1)
    
    def eval(self):
        super().eval()
        return self

# Set up parameters
device = 'cpu'
hidden_size = 4
state_dim = 4
action_dim = 2
embedding_dim = 3
vocab_size = 5

# Create models
agent = MinimalAgent(state_dim, action_dim)
gru = MinimalGRU(embedding_dim, hidden_size)
mlp_transform = MinimalMLP(action_dim, hidden_size)
target_model = None  # Not used in function

# Create embeddings
all_embeddings = torch.randn(vocab_size, embedding_dim, device=device)

# Create test data loader
# Each batch contains sequences and labels
batch_size = 2
seq_len = 3
test_data = [
    ([1, 2, 3], 1),
    ([2, 3, 4], 0)
]

test_loader = []
for seqs, labels in test_data:
    batch_seqs = [seqs]
    batch_labels = [labels]
    test_loader.append((batch_seqs, torch.tensor(batch_labels, dtype=torch.long, device=device)))

# Dummy data dict
data = {}

ARGS = {
    'agent': agent,
    'gru': gru,
    'mlp_transform': mlp_transform,
    'test_loader': test_loader,
    'target_model': target_model,
    'data': data,
    'all_embeddings': all_embeddings,
    'hidden_size': hidden_size,
    'device': device
}
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 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
validate_model Ran
ran; our contract draft was wrong, not the code
LabRAI/ATOM/evaluation/ppo_eval.py
code served (permissive licence) · get_code("947112a2f75a6fdb")
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 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 torch
import torch.nn as nn
from torch.nn.utils.rnn import pad_sequence

torch.manual_seed(0)

# Define minimal models that satisfy the function's usage

class MinimalAgent(nn.Module):
    def __init__(self, hidden_size, action_dim):
        super().__init__()
        self.hidden_size = hidden_size
        self.action_dim = action_dim
        self.linear = nn.Linear(hidden_size, action_dim)
    
    def eval(self):
        super().eval()
        return self
    
    def select_action(self, state):
        # state shape: (batch_size, hidden_size)
        logits = self.linear(state)
        actions = torch.argmax(logits, dim=1)
        return actions, None, None, None

class MinimalGRU(nn.Module):
    def __init__(self, hidden_size):
        super().__init__()
        self.hidden_size = hidden_size
        self.gru = nn.GRU(input_size=4, hidden_size=hidden_size, batch_first=True)
    
    def eval(self):
        super().eval()
        return self
    
    def process_sequence(self, inputs):
        # inputs shape: (batch_size, seq_len, input_dim)
        output, hidden = self.gru(inputs)
        return output

class MinimalMLPTransform(nn.Module):
    def __init__(self, action_dim, hidden_size):
        super().__init__()
        self.linear = nn.Linear(action_dim, hidden_size)
    
    def eval(self):
        super().eval()
        return self
    
    def forward(self, x):
        # x shape: (batch_size, seq_len, action_dim)
        batch_size, seq_len, action_dim = x.shape
        x_flat = x.view(-1, action_dim)
        out = self.linear(x_flat)
        return out.view(batch_size, seq_len, -1)

class MinimalTargetModel(nn.Module):
    def eval(self):
        super().eval()
        return self

# Set up parameters
device = 'cpu'
hidden_size = 4
action_dim = 2
embedding_dim = 4
vocab_size = 10

# Create models
agent = MinimalAgent(hidden_size, action_dim)
gru = MinimalGRU(hidden_size)
mlp_transform = MinimalMLPTransform(action_dim, hidden_size)
target_model = MinimalTargetModel()

# Create embeddings
all_embeddings = torch.randn(vocab_size, embedding_dim, device=device)

# Create validation loader
# Each batch contains (sequences, labels)
# Sequences are lists of token indices
batch_seqs_1 = [1, 2, 3]
batch_seqs_2 = [4, 5]
batch_labels_1 = torch.tensor([1, 0], dtype=torch.long)

val_loader = [
    ([batch_seqs_1, batch_seqs_2], batch_labels_1),
]

# Dummy data parameter
data = None

ARGS = {
    'agent': agent,
    'gru': gru,
    'mlp_transform': mlp_transform,
    'val_loader': val_loader,
    'target_model': target_model,
    'data': data,
    'all_embeddings': all_embeddings,
    'hidden_size': hidden_size,
    'action_dim': action_dim,
    'device': device,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
sklearn, torch — 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

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 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.

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) have gained traction in Graph-based Machine Learning as a Service (GMLaaS) platforms, yet they remain vulnerable to graph-based model extraction attacks (MEAs), where adversaries reconstruct surrogate models by querying the victim model. Existing defense mechanisms, such as watermarking and fingerprinting, suffer from poor real-time performance, susceptibility to evasion, or reliance on post-attack verification, making them inadequate for handling the dynamic characteristics of graph-based MEA variants. To address these limitations, we propose ATOM, a novel real-time MEA detection framework tailored for GNNs. ATOM integrates sequential modeling and reinforcement learning to dynamically detect evolving attack patterns, while leveraging $k$-core embedding to capture the structural properties, enhancing detection precision. Furthermore, we provide theoretical analysis to characterize query behaviors and optimize detection strategies. Extensive experiments on multiple real-world datasets demonstrate that ATOM outperforms existing approaches in detection performance, maintaining stable across different time steps, thereby offering a more effective defense mechanism for GMLaaS environments.

For agents

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

get_harvested_code_for_paper("2503.16693")
get_code_for_paper("2503.16693")
have("2503.16693")

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

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

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

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

Connect an agent — have() is free.