SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.13308 · AAAI · 2025

A Label-Free Heterophily-Guided Approach for Unsupervised Graph Fraud Detection

Shirui Pan, Yizhen Zheng, Xin Zheng, Yixin Liu, Fuyi Li, Alan Wee, Chung Liew, Junjun Pan

arXiv · PDF · Open in the Atlas

Code that ran

7 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; 0 honoured the contract we drafted, 1 violated it and 6 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2502.13308.json · badge: /api/ran/2502.13308.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
campanulabells/huge-gad canonical (classifier label)
classifier basis not recorded on the link
7 ran · 3 no recorded run
FunctionStatusWhere it lives
compute_S Ran
ran on a synthesized input
campanulabells/huge-gad/modules/ranking.py
code served (permissive licence) · get_code("643374e8f7fa522b")
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 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 torch

torch.manual_seed(0)

# hetero_score is used with:
# - .unsqueeze(0) - adds a dimension at position 0
# - .expand(hetero_score.shape[0], -1) - expands to (N, N) shape
# - .T - transpose
# - comparison operation (> 0)
# - .to(torch.float32)
# - .detach()
# So it needs to be a 1D tensor of scores

hetero_score = torch.randn(4)

ARGS = {
    "hetero_score": hetero_score
}
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 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
compute_sim Ran
ran on a synthesized input
campanulabells/huge-gad/modules/loss.py
code served (permissive licence) · get_code("5daea2629cef25a2")
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 (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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal graph object that satisfies the function's requirements
class MinimalGraph:
    def __init__(self, num_nodes, edges, device='cpu'):
        self.num_nodes_val = num_nodes
        self.device_val = device
        self._edges = edges
        # Compute in_degrees from edges
        edge_v, edge_u = edges
        self._in_degrees = torch.zeros(num_nodes)
        for u_idx in edge_u:
            self._in_degrees[u_idx] += 1
    
    def num_nodes(self):
        return self.num_nodes_val
    
    def edges(self):
        return self._edges
    
    def in_degrees(self):
        return self._in_degrees
    
    @property
    def device(self):
        return self.device_val

# Create a small feature tensor (num_nodes=5, feature_dim=4)
num_nodes = 5
feature_dim = 4
feature = torch.randn(num_nodes, feature_dim)

# Create edges: edge_v (destinations) and edge_u (sources)
# Create a simple graph with a few edges
edge_v = torch.tensor([0, 1, 2, 3, 1, 2])  # destination nodes
edge_u = torch.tensor([1, 0, 1, 2, 3, 4])  # source nodes

graph = MinimalGraph(num_nodes=num_nodes, edges=(edge_v, edge_u), device='cpu')

batch_size = 2
compute_neg = False
batch_size_neg = -1
ignore_diagnoal = False

ARGS = {
    'feature': feature,
    'graph': graph,
    'batch_size': batch_size,
    'compute_neg': compute_neg,
    'batch_size_neg': batch_size_neg,
    'ignore_diagnoal': ignore_diagnoal,
}
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 (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
halo Ran
ran on a synthesized input
campanulabells/huge-gad/modules/utils.py
code served (permissive licence) · get_code("f60a75781fb0f08e")
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
import torch.nn as nn

torch.manual_seed(0)

# The function halo takes two tensors x_u and x_v and computes a distance metric
# It uses .pow(), .sum(), .sqrt() on tensors
# x_u and x_v should have shape (batch_size, feature_dim)

x_u = torch.randn(2, 4)  # batch_size=2, feature_dim=4
x_v = torch.randn(2, 4)  # batch_size=2, feature_dim=4
eps = 1e-06

ARGS = {
    "x_u": x_u,
    "x_v": x_v,
    "eps": eps
}
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
neighbor_KLD_batch Ran
ran on a synthesized input
campanulabells/huge-gad/modules/loss.py
code served (permissive licence) · get_code("3a69846bbda3da77")
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
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal block object that mimics DGL block interface
class MinimalBlock:
    def __init__(self, num_src_nodes, num_dst_nodes, edges_src, edges_dst):
        self.num_src = num_src_nodes
        self.num_dst = num_dst_nodes
        self._edges_src = edges_src
        self._edges_dst = edges_dst
        self._in_degrees = torch.zeros(num_src_nodes, dtype=torch.long)
        for dst_node in edges_dst:
            self._in_degrees[dst_node] += 1
    
    def edges(self):
        return self._edges_src, self._edges_dst
    
    def in_degrees(self):
        return self._in_degrees
    
    def num_dst_nodes(self):
        return self.num_dst

# Create tensors for input and target
num_nodes = 5
feature_dim = 4
input_tensor = torch.randn(num_nodes, feature_dim)
target_tensor = torch.randn(num_nodes, feature_dim)

# Create a block with edges
# edges_src and edges_dst define connections between nodes
edges_src = torch.tensor([0, 1, 2, 1, 3])
edges_dst = torch.tensor([1, 2, 3, 0, 4])
block = MinimalBlock(num_nodes, num_nodes, edges_src, edges_dst)

ARGS = {
    'input': input_tensor,
    'target': target_tensor,
    'block': block
}
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
prc_auc_score Ran
ran on a synthesized input
campanulabells/huge-gad/modules/utils.py
code served (permissive licence) · get_code("65e775517ef33e12")
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
from sklearn.metrics import auc, precision_recall_curve

torch.manual_seed(0)

# gt: ground truth labels (binary classification)
# Should be array-like of binary labels
gt = np.array([0, 1, 1, 0, 1, 0, 1, 1])

# pred: predicted scores/probabilities
# Should be array-like of continuous values (typically probabilities)
pred = np.array([0.1, 0.9, 0.8, 0.2, 0.7, 0.3, 0.95, 0.85])

ARGS = {
    'gt': gt,
    'pred': pred
}
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
rank_loss Ran
ran on a synthesized input
campanulabells/huge-gad/modules/ranking.py
code served (permissive licence) · get_code("233b82f4f3888b45")
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
import torch.nn as nn

torch.manual_seed(0)

# The function rank_loss takes:
# - pred: a tensor of logits (used in compute_s which does unsqueeze, expand, and arithmetic)
# - GT: a tensor of ground truth values (used in element-wise arithmetic with s)
# - param_sigmoid: a scalar parameter (used in arithmetic operations)

# Create small tensors for testing
pred = torch.randn(4, dtype=torch.float32)  # batch_size=4, will be used in compute_s
GT = torch.randint(0, 2, (4, 4), dtype=torch.float32)  # ground truth matrix, same shape as s
param_sigmoid = torch.tensor(0.5, dtype=torch.float32)  # scalar parameter

ARGS = {
    'pred': pred,
    'GT': GT,
    'param_sigmoid': param_sigmoid
}
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
str2bool Ran
ran, violated the contract we drafted
campanulabells/huge-gad/modules/utils.py
code served (permissive licence) · get_code("7c508037b40522af")
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 bool, 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 argparse

def str2bool(v):
    if isinstance(v, bool):
        return v
    if v.lower() in ('yes', 'true', 't', 'y', '1'):
        return True
    elif v.lower() in ('no', 'false', 'f', 'n', '0'):
        return False
    else:
        raise argparse.ArgumentTypeError('Boolean value expected.')

# Test cases for str2bool
ARGS = {
    'v': 'true'  # string input that should convert to boolean
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, 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
compute_s Not yet run
unverified (harvested, no recorded run)
campanulabells/huge-gad/modules/ranking.py
code served (permissive licence) · get_code("ccfccd16dec907c5")
How it ran

no invocation recorded.

neighbor_KLD Not yet run
unverified (harvested, no recorded run)
campanulabells/huge-gad/modules/loss.py
code served (permissive licence) · get_code("69ed13a02967fac8")
How it ran

no invocation recorded.

node_heterophily Not yet run
unverified (harvested, no recorded run)
campanulabells/huge-gad/modules/node_heterophily.py
code served (permissive licence) · get_code("9bf0fb65362dd5ce")
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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 9 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
str2bool 175 other papers
152 dated earlier, 21 later, 2 same year, order not determinable · 2 only as an assembly brick
1406.6247 (2014-06)
Recurrent Models of Visual Attention
1603.09382 (2016-03)
Deep Networks with Stochastic Depth
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
and 172 more not named here

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

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 fraud detection (GFD) has rapidly advanced in protecting online services by identifying malicious fraudsters. Recent supervised GFD research highlights that heterophilic connections between fraudsters and users can greatly impact detection performance, since fraudsters tend to camouflage themselves by building more connections to benign users. Despite the promising performance of supervised GFD methods, the reliance on labels limits their applications to unsupervised scenarios; Additionally, accurately capturing complex and diverse heterophily patterns without labels poses a further challenge. To fill the gap, we propose a Heterophily-guided Unsupervised Graph fraud dEtection approach (HUGE) for unsupervised GFD, which contains two essential components: a heterophily estimation module and an alignmentbased fraud detection module. In the heterophily estimation module, we design a novel label-free heterophily metric called HALO, which captures the critical graph properties for GFD, enabling its outstanding ability to estimate heterophily from node attributes. In the alignment-based fraud detection module, we develop a joint MLP-GNN architecture with ranking loss and asymmetric alignment loss. The ranking loss aligns the predicted fraud score with the relative order of HALO, providing an extra robustness guarantee by comparing heterophily among non-adjacent nodes. Moreover, the asymmetric alignment loss effectively utilizes structural information while alleviating the feature-smooth effects of GNNs. Extensive experiments on 6 datasets demonstrate that HUGE significantly outperforms competitors, showcasing its effectiveness and robustness.

For agents

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

get_harvested_code_for_paper("2502.13308")
get_code_for_paper("2502.13308")
have("2502.13308")

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

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

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

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

Connect an agent — have() is free.