SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.30166 · 2026

SAHG: Sector-Anisotropic Hyperbolic Graph Model for Social Bot Detection

Yang Liu, Ziyi Zhang, Ran Ran, Yingguang Yang, Yaoming Li, Bin Chong, Hanning Lu, Jinwei Su, Zhaoqian Yao, Taoran Liang, Kefu Xu

arXiv · PDF

Code that ran

5 of 5 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, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 0 no recorded run), measured 2026-11-23; 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/2605.30166.json · badge: /api/ran/2605.30166.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
lhnjames/SAHG community
Papers with Code archive
5 ran · 0 no recorded run
FunctionStatusWhere it lives
LocalWarpNet Ran
ran on a synthesized input
lhnjames/SAHG/algorithm/sahg_model.py
code served (permissive licence) · get_code("e56f89b6100bab6e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
import torch.nn.functional as F

class LocalWarpNet(nn.Module):
    """
    
    
    """

    def __init__(self, d_proj: int, hidden: int=64):
        super().__init__()
        self.net = nn.Sequential(nn.Linear(d_proj, hidden), nn.GELU(), nn.Linear(hidden, 1))
        nn.init.normal_(self.net[-1].weight, std=0.05)
        nn.init.constant_(self.net[-1].bias, 0.0)

    def forward(self, u: torch.Tensor) -> torch.Tensor:
        """
        return: (N,) γ > 0
        """
        return F.softplus(self.net(u)).squeeze(-1) + 0.1


INIT_ARGS = {
    'd_proj': 4,
    'hidden': 16,
}

ARGS = {
    'u': torch.randn(2, 4),
}

if __name__ == '__main__':
    model = LocalWarpNet(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
    assert output.shape == (2,), f"Expected shape (2,), got {output.shape}"
    assert torch.all(output > 0.1), "Output should be > 0.1 due to softplus + 0.1"
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SAHEncoder Ran
ran on a synthesized input
lhnjames/SAHG/algorithm/sahg_model.py
code served (permissive licence) · get_code("7e774664e0edf4f0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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 torch
import torch.nn as nn

def safe_normalize(x, eps=1e-10):
    norm = x.norm(dim=-1, keepdim=True).clamp(min=eps)
    return x / norm

class SAHEncoder(nn.Module):
    """
    
    """

    def __init__(self, d_in: int=768, d_proj: int=128, d_hidden: int=256, dropout: float=0.2):
        super().__init__()
        self.proj = nn.Sequential(nn.Linear(d_in, d_hidden), nn.LayerNorm(d_hidden), nn.GELU(), nn.Dropout(dropout), nn.Linear(d_hidden, d_proj))
        with torch.no_grad():
            nn.init.orthogonal_(self.proj[0].weight)
            nn.init.orthogonal_(self.proj[-1].weight)

    def forward(self, x: torch.Tensor):
        """
        x: (N, d_in) tweet BERT
        return:
        """
        z = self.proj(x)
        r = z.norm(dim=-1)
        u = safe_normalize(z)
        return (r, u, z)


INIT_ARGS = {
    "d_in": 4,
    "d_proj": 3,
    "d_hidden": 8,
    "dropout": 0.1,
}

ARGS = {
    "x": torch.randn(2, 4),
}

if __name__ == "__main__":
    model = SAHEncoder(**INIT_ARGS)
    model.eval()
    with torch.no_grad():
        r, u, z = model(**ARGS)
    print(f"r shape: {r.shape}, u shape: {u.shape}, z shape: {z.shape}")
    print(f"r: {r}")
    print(f"u: {u}")
    print(f"z: {z}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SAHGSingleDetector Ran
ran on a synthesized input
lhnjames/SAHG/algorithm/sahg_model.py
code served (permissive licence) · get_code("63efe0e71846ba48")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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 numpy as np

# INIT_ARGS for SAHGSingleDetector.__init__
INIT_ARGS = {
    'in_dim': 8,
    'd_proj': 6,
    'd_hidden': 12,
    'K': 3,
    'dropout': 0.1
}

# ARGS for SAHGSingleDetector.forward
# forward signature: forward(self, x: torch.Tensor, edge_index: torch.Tensor, return_geo: bool=False)
# x must have shape (N, in_dim) where in_dim=8
# edge_index must have shape (2, E) for E edges

num_nodes = 5
num_edges = 7

x = torch.randn(num_nodes, INIT_ARGS['in_dim'])

# Create a simple edge_index for a small graph
# Format: (2, num_edges) where each column is [source, target]
edge_index = torch.tensor([
    [0, 1, 1, 2, 2, 3, 4],
    [1, 0, 2, 1, 3, 4, 3]
], dtype=torch.long)

ARGS = {
    'x': x,
    'edge_index': edge_index,
    'return_geo': False
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch, torch_geometric — 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SectorPrototypes Ran
ran on a synthesized input
lhnjames/SAHG/algorithm/sahg_model.py
code served (permissive licence) · get_code("a8f4d1292c38bd22")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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 torch
import torch.nn as nn
import torch.nn.functional as F
import math

# INIT_ARGS for SectorPrototypes.__init__(K, d_proj, tau_init)
INIT_ARGS = {
    'K': 5,           # number of prototypes
    'd_proj': 8,      # projection dimension
    'tau_init': 5.0   # initial temperature
}

# ARGS for SectorPrototypes.forward(u, gamma)
# u: embeddings with shape (batch, d_proj)
# gamma: weights with shape (batch,)
ARGS = {
    'u': torch.randn(3, 8),      # batch=3, d_proj=8 (must match INIT_ARGS['d_proj'])
    'gamma': torch.rand(3)       # batch=3
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
safe_normalize Ran
ran; our contract draft was wrong, not the code
lhnjames/SAHG/algorithm/sahg_model.py
code served (permissive licence) · get_code("7ec26eb9172aec4e")
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 (2, 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)

# The function safe_normalize takes:
# - x: a tensor that has a .norm() method and supports division
# - eps: a float for numerical stability (has default value)

# x is used as:
# - x.norm(dim=-1, keepdim=True) - compute norm along last dimension
# - x / norm - element-wise division

# Create a small tensor: batch_size=2, feature_dim=4
x = torch.randn(2, 4)

ARGS = {
    "x": x,
    "eps": 1e-10,
}
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 (2, 4) — shape (2, 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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 5 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-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

LLM-driven social bots can generate fluent, human-like text, reducing the discriminative advantage of content-based detection alone. However, coordinated campaigns still leave relational patterns-interactions, behavioral similarity, shared neighborhoods, community positions, and coordinated activity-that graph-based methods can exploit. Existing graph detectors face two challenges when exploiting such evidence. First, Euclidean GNNs distort hierarchical and scale-free social graphs; while hyperbolic geometry addresses this volume-growth mismatch, fixedcurvature models still assign uniform geometric resolution to structural directions with different densities and separation needs. Second, relational evidence is not always reliable: sophisticated bots forge heterophilic connections with genuine users, causing neighborhood aggregation to mix bot and human signals and dilute accountlevel evidence. We propose SAHG (Sector-Anisotropic Hyperbolic Graph), addressing both challenges. SAHG learns a direction-dependent curvature field γ(u) that adapts geometric resolution across structural directions, and uses sector prototypes to convert angular concentration and alignment into classifier-readable features. To prevent contaminated aggregation from overwhelming account-level evidence, SAHG encodes per-account features and graph-neighborhood representations in two independent SAH channels, fusing them only at the classifier. Experiments on Fox8-23, BotSim-24, and MGTAB show that SAHG achieves the highest accuracy and F1 on all three benchmarks, outperforming feature-based, graph-based, LLM-based, and isotropic hyperbolic baselines. Ablation and geometric analyses confirm the effectiveness of the anisotropic geometry and dual-channel design.

For agents

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

get_harvested_code_for_paper("2605.30166")
get_code_for_paper("2605.30166")
have("2605.30166")

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

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

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

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

Connect an agent — have() is free.