SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.02687 · NeurIPS · 2023

Architecture Matters: Uncovering Implicit Mechanisms in Graph Contrastive Learning

Yisen Wang, Yifei Wang, Xiaojun Guo, Zeming Wei

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 0 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/2311.02687.json · badge: /api/ran/2311.02687.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
PKU-ML/ArchitectureMattersGCL canonical (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
pku-ml/architecturemattersgcl canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
logistic_classify Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
PKU-ML/ArchitectureMattersGCL/GCL/GraphCL/evaluate_embedding.py
code served (permissive licence) · get_code("6aebfbe1fa239bbc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import numpy as np
from sklearn.model_selection import GridSearchCV, KFold, StratifiedKFold

torch.manual_seed(0)
np.random.seed(0)

# Create sample data
# x: embeddings/features (num_samples, feature_dim)
# y: labels (num_samples,)
num_samples = 50
feature_dim = 8
num_classes = 3

x = np.random.randn(num_samples, feature_dim).astype(np.float32)
y = np.random.randint(0, num_classes, size=num_samples)

ARGS = {
    'x': x,
    'y': y
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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
loss_cl Ran
ran; our contract draft was wrong, not the code
PKU-ML/ArchitectureMattersGCL/GCL/AutoGCL/unsupervised/us_main.py
code served (permissive licence) · get_code("6f62b84037b7ba3a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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

torch.manual_seed(0)

batch_size = 2
embedding_dim = 4

x1 = torch.randn(batch_size, embedding_dim)
x2 = torch.randn(batch_size, embedding_dim)

ARGS = {
    'x1': x1,
    'x2': x2,
    'tau': 0.5,
    'loss_type': 'info'
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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
nce_loss Ran
ran; our contract draft was wrong, not the code
pku-ml/architecturemattersgcl/GCL/GraphCL/cortex_DIM/functions/dim_losses.py
code served (permissive licence) · get_code("ed26e617595e3129")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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.functional as F

torch.manual_seed(0)

# Based on the function body:
# N, local_units, n_locs = l.size()
# l_p = l.permute(0, 2, 1)  # becomes (N, n_locs, local_units)
# u_p = torch.matmul(l_p, g.unsqueeze(dim=2))  # g needs to be (N, local_units) -> (N, local_units, 1)
# So g should be (N, local_units)

N = 2
local_units = 4
n_locs = 3

# l: Local feature map with shape (N, local_units, n_locs)
l = torch.randn(N, local_units, n_locs)

# g: Global features with shape (N, local_units)
g = torch.randn(N, local_units)

ARGS = {
    'l': l,
    'g': g
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
randomforest_classify Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
PKU-ML/ArchitectureMattersGCL/GCL/GraphCL/evaluate_embedding.py
code served (permissive licence) · get_code("2e93ec32d2ba667c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 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 numpy as np

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

# Create a small classification dataset
n_samples = 50
n_features = 8
n_classes = 3

# Generate random features
x = np.random.randn(n_samples, n_features)

# Generate random class labels
y = np.random.randint(0, n_classes, size=n_samples)

# search parameter: boolean to control whether to use GridSearchCV
search = False

ARGS = {
    'x': x,
    'y': y,
    'search': search
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, sklearn — 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
svc_classify Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
PKU-ML/ArchitectureMattersGCL/GCL/GraphCL/evaluate_embedding.py
code served (permissive licence) · get_code("ed8e4cd7bf523e6f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 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 numpy as np
from sklearn.datasets import make_classification

# Create a small classification dataset
# We need at least 10 samples per class for StratifiedKFold with 10 splits to work
# Let's create a dataset with 100 samples, 5 features, and 2 classes
np.random.seed(42)
x, y = make_classification(
    n_samples=100,
    n_features=5,
    n_informative=3,
    n_redundant=1,
    n_classes=2,
    n_clusters_per_class=1,
    random_state=42
)

# search parameter: boolean indicating whether to use GridSearchCV
search = True

ARGS = {
    'x': x,
    'y': y,
    'search': search
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, sklearn — 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
train_cl Ran
ran, honoured the contract we drafted
PKU-ML/ArchitectureMattersGCL/GCL/AutoGCL/unsupervised/us_main.py
code served (permissive licence) · get_code("066824ed5553a7e7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 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 torch.nn as nn
from torch.optim import Adam

torch.manual_seed(0)

# Stand-in class for graph data
class GraphData:
    def __init__(self, x, edge_index, batch, num_graphs):
        self.x = x
        self.edge_index = edge_index
        self.batch = batch
        self.num_graphs = num_graphs
    
    def to(self, device):
        return self

# View generator that returns sample and view
class ViewGenerator:
    def __init__(self):
        self.param = nn.Parameter(torch.randn(1))
    
    def __call__(self, data, flag):
        # Returns sample and view (both are graph data objects)
        return data, data
    
    def parameters(self):
        return [self.param]

# Simple model that takes graph data and returns embeddings
class GraphModel(nn.Module):
    def __init__(self, in_dim=5, out_dim=8):
        super().__init__()
        self.linear = nn.Linear(in_dim, out_dim)
    
    def forward(self, data):
        # data is a GraphData object with x attribute
        # Return batch_size x out_dim tensor
        # Aggregate node features per graph
        x = data.x
        batch = data.batch
        num_graphs = data.num_graphs
        
        # Simple mean pooling per graph
        out = self.linear(x)
        graph_embeddings = []
        for i in range(num_graphs):
            mask = batch == i
            graph_emb = out[mask].mean(dim=0)
            graph_embeddings.append(graph_emb)
        
        return torch.stack(graph_embeddings)

# Create data loader with graph data
def create_data_loader():
    data_list = []
    for _ in range(3):  # 3 batches
        # 2 graphs per batch, 3 nodes in first graph, 2 nodes in second graph
        x = torch.randn(5, 5)  # 5 nodes total, 5 features
        edge_index = torch.tensor([[0, 1, 2, 3], [1, 2, 3, 4]], dtype=torch.long)
        batch = torch.tensor([0, 0, 0, 1, 1], dtype=torch.long)  # graph assignment
        num_graphs = 2
        data_list.append(GraphData(x, edge_index, batch, num_graphs))
    return data_list

view_gen1 = ViewGenerator()
view_gen2 = ViewGenerator()

view_optimizer = Adam(list(view_gen1.parameters()) + list(view_gen2.parameters()), lr=0.001)

model = GraphModel(in_dim=5, out_dim=8)
optimizer = Adam(model.parameters(), lr=0.001)

data_loader = create_data_loader()

device = torch.device('cpu')

ARGS = {
    'view_gen1': view_gen1,
    'view_gen2': view_gen2,
    'view_optimizer': view_optimizer,
    'model': model,
    'optimizer': optimizer,
    'data_loader': data_loader,
    'device': device
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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

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, 1 are also present in other papers whose code we hold (1 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.

FunctionAlso present inEarliest-datedOthers named
logistic_classify 1 other paper
1 dated earlier
2305.04501 (2023-05)
SEGA: Structural Entropy Guided Anchor View for Graph Contrastive Learning

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

With the prosperity of contrastive learning for visual representation learning (VCL), it is also adapted to the graph domain and yields promising performance. However, through a systematic study of various graph contrastive learning (GCL) methods, we observe that some common phenomena among existing GCL methods that are quite different from the original VCL methods, including 1) positive samples are not a must for GCL; 2) negative samples are not necessary for graph classification, neither for node classification when adopting specific normalization modules; 3) data augmentations have much less influence on GCL, as simple domain-agnostic augmentations (e.g., Gaussian noise) can also attain fairly good performance. By uncovering how the implicit inductive bias of GNNs works in contrastive learning, we theoretically provide insights into the above intriguing properties of GCL. Rather than directly porting existing VCL methods to GCL, we advocate for more attention toward the unique architecture of graph learning and consider its implicit influence when designing GCL methods. Code is available at https: //github.com/PKU-ML/ArchitectureMattersGCL.

For agents

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

get_harvested_code_for_paper("2311.02687")
get_code_for_paper("2311.02687")
have("2311.02687")

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

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

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

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

Connect an agent — have() is free.