SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.17709 · 2025

CEGA: A Cost-Effective Approach for Graph-Based Model Extraction and Acquisition

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 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; 2 honoured the contract we drafted, 3 violated it and 0 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-24; 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/2506.17709.json · badge: /api/ran/2506.17709.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/cega canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
calculate_entropy Ran
ran; our contract draft was wrong, not the code
labrai/cega/attacks/attack_0_cega.py
code served (permissive licence) · get_code("90eef8ab7e8c113f")
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 1, dtype family float, shape (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 as th

th.manual_seed(0)

# Create a small probability distribution tensor
# Shape: (batch_size=2, num_classes=4)
# Values should sum to 1 along the last dimension for valid probabilities
probs = th.tensor([
    [0.4, 0.3, 0.2, 0.1],
    [0.25, 0.25, 0.25, 0.25]
], dtype=th.float32)

ARGS = {
    "probs": probs
}
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 1, dtype family float, shape (2,) — shape (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
calculate_entropy Ran
ran, honoured the contract we drafted
labrai/cega/attacks/attack_0_age.py
code served (permissive licence) · get_code("f77dc13db482d1e3")
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 1, dtype family float, shape (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 numpy as np

# The function calculate_entropy takes a probability matrix and computes entropy
# It expects:
# - probs: a 2D numpy array where each row contains probabilities that sum to ~1
#   The function applies log and sum operations along axis=1

# Create a small batch of probability distributions
# Shape: (2, 4) - batch size 2, 4 probability values per sample
probs = np.array([
    [0.25, 0.25, 0.25, 0.25],  # uniform distribution
    [0.7, 0.1, 0.1, 0.1]        # skewed distribution
], dtype=np.float32)

ARGS = {
    "probs": probs
}
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 1, dtype family float, shape (2,) — shape (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
evaluate Ran
ran; our contract draft was wrong, not the code
labrai/cega/attacks/attack_0.py
code served (permissive licence) · get_code("dfc1002c59a8eebb")
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 as th
import torch.nn as nn

th.manual_seed(0)

# Define a minimal model that takes graph and features as input
class MinimalGNNModel(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, g, features):
        # The function calls model(g, features) and expects logits output
        # logits are indexed by mask and have max taken on dim=1
        return self.linear(features)

# Create model
model = MinimalGNNModel(input_dim=4, output_dim=3)

# Create a minimal graph object (DGL graph mock)
class SimpleGraph:
    pass

g = SimpleGraph()

# Create features tensor: shape (2, 4) - 2 nodes, 4 features
features = th.randn(2, 4)

# Create labels tensor: shape (2,) with class indices
labels = th.tensor([0, 2], dtype=th.long)

# Create mask tensor: boolean mask for selecting subset of data
mask = th.tensor([True, True], dtype=th.bool)

ARGS = {
    "model": model,
    "g": g,
    "features": features,
    "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
get_current_neighbors_1 Ran
ran, violated the contract we drafted
labrai/cega/attacks/utils.py
code served (permissive licence) · get_code("9f6153c1bb3c0e9e")
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 1, dtype family int, shape (5,) 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

# cur_nodes: should be an array-like or list of node indices
# adj_matrix: should be a 2D numpy array representing adjacency

# Create a small adjacency matrix (5x5 for a graph with 5 nodes)
adj_matrix = np.array([
    [0, 1, 0, 1, 0],
    [1, 0, 1, 0, 1],
    [0, 1, 0, 1, 0],
    [1, 0, 1, 0, 1],
    [0, 1, 0, 1, 0]
])

# cur_nodes: list of current node indices to query neighbors for
cur_nodes = [0, 2]

ARGS = {
    "cur_nodes": cur_nodes,
    "adj_matrix": adj_matrix
}
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 1, dtype family int, shape (5,) — shape (5,) 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
get_current_neighbors_dense Ran
ran, violated the contract we drafted
labrai/cega/attacks/utils.py
code served (permissive licence) · get_code("97275894290edc01")
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 1, dtype family int, shape (5,) 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 takes:
# - cur_nodes: a collection of node indices (used with list() and shape[0])
# - adj_matrix2: a 2D array supporting indexing and sum operations

# Create a small adjacency matrix (5x5 for a small graph)
adj_matrix2 = np.array([
    [1, 1, 0, 0, 0],
    [1, 0, 1, 0, 0],
    [0, 1, 1, 1, 0],
    [0, 0, 1, 0, 1],
    [0, 0, 0, 1, 1]
], dtype=np.int32)

# Create cur_nodes as a list of node indices
cur_nodes = [0, 2, 4]

ARGS = {
    "cur_nodes": cur_nodes,
    "adj_matrix2": adj_matrix2
}
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 1, dtype family int, shape (5,) — shape (5,) 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
get_receptive_fields_dense Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
labrai/cega/attacks/utils.py
code served (permissive licence) · get_code("fbbff48d19cf596b")
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
import torch

torch.manual_seed(0)

# Analyzing the function:
# - cur_neighbors: used in addition operation with adj_matrix2[selected_node]
# - selected_node: used as index into adj_matrix2
# - weighted_score: has .dot() method, so numpy array
# - adj_matrix2: indexed with selected_node, supports != 0 operation

# Create small numpy arrays for the parameters
cur_neighbors = np.array([1, 0, 1, 0], dtype=np.int32)

selected_node = 1

weighted_score = np.array([0.5, 0.3, 0.2, 0.1], dtype=np.float32)

# adj_matrix2 should be a 2D array where we can index by selected_node
# Shape: (num_nodes, num_features) - using 3 nodes, 4 features
adj_matrix2 = np.array([
    [1, 0, 1, 0],
    [0, 1, 1, 1],
    [1, 1, 0, 0]
], dtype=np.int32)

ARGS = {
    "cur_neighbors": cur_neighbors,
    "selected_node": selected_node,
    "weighted_score": weighted_score,
    "adj_matrix2": adj_matrix2
}
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 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
multiclassentropy_numpy Ran
ran, violated the contract we drafted
labrai/cega/attacks/attack_0_age.py
code served (permissive licence) · get_code("de9ce459bee4a58a")
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 1, dtype family float, shape (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 numpy as np
import torch

torch.manual_seed(0)

# Analyze the function:
# - tens: numpy array that gets clipped, log'd, multiplied, summed over axis=1, and mean'd
#   Should be probability-like values (0-1 range)
#   Shape should work with axis=1 operations, so needs at least 2 dimensions
# - dim: parameter that exists but is not used in the function body

# Create a small valid input
# tens should be a numpy array with shape (batch_size, num_classes)
# Values should be in (0, 1) range for entropy calculation
batch_size = 2
num_classes = 4

tens = np.array([
    [0.1, 0.2, 0.3, 0.4],
    [0.25, 0.25, 0.25, 0.25]
], dtype=np.float32)

ARGS = {
    "tens": tens,
    "dim": 1
}
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 ndarray, ndim 1, dtype family float, shape (2,) — shape (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
update_sub_train_mask Ran
ran, honoured the contract we drafted
labrai/cega/attacks/attack_0_cega.py
code served (permissive licence) · get_code("900a1869ab6d8118")
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 torch as th
import random

th.manual_seed(0)

# Create small boolean tensors for the masks
# sub_train_mask: full mask with some True values
sub_train_mask = th.tensor([True, False, True, False, True, True, False, False])

# sub_train_mask_new: a subset of the True indices from sub_train_mask
sub_train_mask_new = th.tensor([True, False, True, False, False, False, False, False])

# num_each: number of indices to select from missing indices
num_each = 2

ARGS = {
    "num_each": num_each,
    "sub_train_mask": sub_train_mask,
    "sub_train_mask_new": sub_train_mask_new,
}
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 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
init_mask Not yet run
unverified (harvested, no recorded run)
labrai/cega/attacks/attack_0_cega.py
code served (permissive licence) · get_code("7cf258d7395e83cf")
How it ran

no invocation recorded.

rank_entropy Not yet run
unverified (harvested, no recorded run)
labrai/cega/attacks/attack_0_age.py
code served (permissive licence) · get_code("13f6d8c8d846105b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 7 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
get_current_neighbors_1 1 other paper
1 later
2605.12827 (2026-05)
GraphIP-Bench: How Hard Is It to Steal a Graph Neural Network, and Can We Stop It?
get_current_neighbors_dense 1 other paper
1 later
2605.12827 (2026-05)
GraphIP-Bench: How Hard Is It to Steal a Graph Neural Network, and Can We Stop It?
get_receptive_fields_dense 1 other paper
1 later
2605.12827 (2026-05)
GraphIP-Bench: How Hard Is It to Steal a Graph Neural Network, and Can We Stop It?

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

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 demonstrated remarkable utility across diverse applications, and their growing complexity has made Machine Learning as a Service (MLaaS) a viable platform for scalable deployment. However, this accessibility also exposes GNN to serious security threats, most notably model extraction attacks (MEAs), in which adversaries strategically query a deployed model to construct a high-fidelity replica. In this work, we evaluate the vulnerability of GNNs to MEAs and explore their potential for cost-effective model acquisition in non-adversarial research settings. Importantly, adaptive node querying strategies can also serve a critical role in research, particularly when labeling data is expensive or time-consuming. By selectively sampling informative nodes, researchers can train high-performing GNNs with minimal supervision, which is particularly valuable in domains such as biomedicine, where annotations often require expert input. To address this, we propose a node querying strategy tailored to a highly practical yet underexplored scenario, where bulk queries are prohibited, and only a limited set of initial nodes is available. Our approach iteratively refines the node selection mechanism over multiple learning cycles, leveraging historical feedback to improve extraction efficiency. Extensive experiments on benchmark graph datasets demonstrate our superiority over comparable baselines on accuracy, fidelity, and F1 score under strict query-size constraints. These results highlight both the susceptibility of deployed GNNs to extraction attacks and the promise of ethical, efficient GNN acquisition methods to support low-resource research environments.

For agents

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

get_harvested_code_for_paper("2506.17709")
get_code_for_paper("2506.17709")
have("2506.17709")

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

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

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

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

Connect an agent — have() is free.