SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.20878 · 2024

SelfGNN: Self-Supervised Graph Neural Networks for Sequential Recommendation

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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 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/2405.20878.json · badge: /api/ran/2405.20878.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
hkuds/selfgnn canonical (classifier label)
classifier basis: census
3 ran · 3 no recorded run
FunctionStatusWhere it lives
negSamp Ran
ran; our contract draft was wrong, not the code
hkuds/selfgnn/DataHandler.py
code served (permissive licence) · get_code("2c59f5c5303f1dcf")
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

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

# Define arguments for negSamp function
temLabel = np.array([0, 1, 0, 1, 0, 1, 0, 0])  # Binary labels, some 0s for negative sampling
sampSize = 3  # Number of negative samples to draw
nodeNum = 8  # Total number of nodes to sample from
trnPos = {1, 3}  # Set of positive training items to exclude
item_with_pop = None  # Not used in the function body

ARGS = {
    "temLabel": temLabel,
    "sampSize": sampSize,
    "nodeNum": nodeNum,
    "trnPos": trnPos,
    "item_with_pop": item_with_pop
}
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 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
negSamp_fre Ran
ran; our contract draft was wrong, not the code
hkuds/selfgnn/DataHandler.py
code served (permissive licence) · get_code("26a6bca2431c33ee")
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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - temLabel: indexed with rdmItm, compared with 0, so needs to be indexable (list/array)
# - sampSize: integer, used in range/loop control
# - neg_frequency: indexed with -i (negative indexing), so needs to be a sequence
# - pos_los: compared with rdmItm, should be a single value (int or similar)

# Create temLabel: a list/array where we can index it and find 0 values
# We need enough non-zero entries and some zero entries for the algorithm to work
temLabel = [0, 1, 0, 1, 0, 1, 1, 0, 1, 1]

# Create sampSize: how many negative samples we want
sampSize = 3

# Create neg_frequency: a list of item indices in some frequency order
# The function accesses neg_frequency[-i] starting from i=0, so it goes backwards
# We need enough distinct items that are not pos_los and have temLabel==0
neg_frequency = [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]

# Create pos_los: the positive item index we want to exclude
pos_los = 5

ARGS = {
    "temLabel": temLabel,
    "sampSize": sampSize,
    "neg_frequency": neg_frequency,
    "pos_los": pos_los,
}
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 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
transpose Ran
ran; our contract draft was wrong, not the code
hkuds/selfgnn/DataHandler.py
code served (permissive licence) · get_code("1720c87bb3c19836")
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 scipy.sparse as sp
import numpy as np

# Create a small sparse matrix to transpose
# Using a 4x3 matrix (distinct dimensions)
data = np.array([1, 2, 3, 4, 5])
row = np.array([0, 1, 2, 3, 1])
col = np.array([0, 1, 2, 0, 2])
sparse_mat = sp.csr_matrix((data, (row, col)), shape=(4, 3))

ARGS = {
    "mat": sparse_mat
}
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
SpentTime Not yet run
unverified (harvested, no recorded run)
hkuds/selfgnn/Utils/TimeLogger.py
code served (permissive licence) · get_code("43a9c38f5238b37e")
How it ran

no invocation recorded.

SpentTooLong Not yet run
unverified (harvested, no recorded run)
hkuds/selfgnn/Utils/TimeLogger.py
code served (permissive licence) · get_code("b120bac4f27370e0")
How it ran

no invocation recorded.

getParam Not yet run
unverified (harvested, no recorded run)
hkuds/selfgnn/Utils/NNLayers.py
code served (permissive licence) · get_code("aa92af09147be134")
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, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 2 the same month, 0 later) and 2 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
getParam 2 other papers
1 dated earlier, 1 the same month
2309.01103 (2023-09)
Multi-Relational Contrastive Learning for Recommendation
2405.11582 (2024-05)
SLAB: Efficient Transformers with Simplified Linear Attention and Progressive Re-parameterized Batch Normalization
SpentTime 1 other paper
1 dated earlier
2309.01103 (2023-09)
Multi-Relational Contrastive Learning for Recommendation
SpentTooLong 1 other paper
1 dated earlier
2309.01103 (2023-09)
Multi-Relational Contrastive Learning for Recommendation
transpose 1 other paper
1 the same month
2405.11582 (2024-05)
SLAB: Efficient Transformers with Simplified Linear Attention and Progressive Re-parameterized Batch Normalization

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

Sequential recommendation effectively addresses information overload by modeling users' temporal and sequential interaction patterns. To overcome the limitations of supervision signals, recent approaches have adopted self-supervised learning techniques in recommender systems. However, there are still two critical challenges that remain unsolved. Firstly, existing sequential models primarily focus on long-term modeling of individual interaction sequences, overlooking the valuable short-term collaborative relationships among the behaviors of different users. Secondly, real-world data often contain noise, particularly in users' short-term behaviors, which can arise from temporary intents or misclicks. Such noise negatively impacts the accuracy of both graph and sequence models, further complicating the modeling process. To address these challenges, we propose a novel framework called Self-Supervised Graph Neural Network (SelfGNN) for sequential recommendation. The SelfGNN framework encodes short-term graphs based on time intervals and utilizes Graph Neural Networks (GNNs) to learn short-term collaborative relationships. It captures long-term user and item representations at multiple granularity levels through interval fusion and dynamic behavior modeling. Importantly, our personalized self-augmented learning structure enhances model robustness by mitigating noise in short-term graphs based on long-term user interests and personal stability. Extensive experiments conducted on four real-world datasets demonstrate that SelfGNN outperforms various state-of-the-art baselines. Our model implementation codes are available at https://github.com/HKUDS/SelfGNN.

For agents

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

get_harvested_code_for_paper("2405.20878")
get_code_for_paper("2405.20878")
have("2405.20878")

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

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

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

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

Connect an agent — have() is free.