SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.11050 · ICLR · 2023

Edgeformers: Graph-Empowered Transformers for Representation Learning on Textual-Edge Networks

Jiawei Han, Yu Zhang, Yu Meng, Bowen Jin

arXiv · PDF · Open in the Atlas

Code that ran

3 of 7 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 1 has no contract verdict; 1 failure of our instrument; 4 no recorded run), measured 2026-11-22; 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/2302.11050.json · badge: /api/ran/2302.11050.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
petergriffinjin/edgeformers canonical (classifier label)
classifier basis not recorded on the link
3 ran · 4 no recorded run
FunctionStatusWhere it lives
acc Ran
ran, honoured the contract we drafted
petergriffinjin/edgeformers/Edgeformer-E/src/utils.py
code served (permissive licence) · get_code("5f6cca96082d0328")
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 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)

# The function acc takes two parameters:
# - y_true: a tensor of true labels (1D)
# - y_hat: a tensor of logits/predictions (2D, with class dimension at dim=-1)
# The function uses:
#   - torch.argmax(y_hat, dim=-1) to get predicted class indices
#   - y_true.shape[0] to get batch size
#   - torch.sum() to count matches
#   - .data.float() to convert to float

# Create small tensors with batch size 2
batch_size = 2
num_classes = 4

# y_true: shape (2,) with class indices
y_true = torch.tensor([0, 2], dtype=torch.long)

# y_hat: shape (2, 4) with logits for 4 classes
# Make predictions such that argmax gives [0, 2] to test the function
y_hat = torch.tensor([
    [2.0, 1.0, 0.5, 0.1],  # argmax = 0
    [0.1, 0.2, 3.0, 1.5]   # argmax = 2
], dtype=torch.float32)

ARGS = {
    "y_true": y_true,
    "y_hat": y_hat
}
Setup block drafted by
a language model, Claude Haiku 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
dcg_score Ran
ran; our contract draft was wrong, not the code
petergriffinjin/edgeformers/Edgeformer-E/src/utils.py
code served (permissive licence) · get_code("43e79e8e0904d5d8")
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 float64, 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 numpy as np

# Construct valid arguments for dcg_score function
# The function expects:
# - y_true: array of true relevance labels (binary or graded)
# - y_score: array of predicted scores
# - k: number of top results to consider (default 10)

# Create small sample data
np.random.seed(0)

# y_true: binary relevance labels (0 or 1), shape (15,)
y_true = np.array([1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0])

# y_score: predicted scores, shape (15,)
y_score = np.array([0.9, 0.2, 0.8, 0.7, 0.3, 0.85, 0.1, 0.15, 0.75, 0.95, 0.05, 0.88, 0.12, 0.92, 0.08])

# k: number of top results to evaluate
k = 10

ARGS = {
    "y_true": y_true,
    "y_score": y_score,
    "k": k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — 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, 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 on a synthesized input
petergriffinjin/edgeformers/Edgeformer-E/src/utils.py
code served (permissive licence) · get_code("7ec86b9f6a7b0eb7")
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 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', 'T'):
        return True
    elif v.lower() in ('no', 'false', 'f', 'n', '0', 'F'):
        return False
    else:
        raise argparse.ArgumentTypeError('Boolean value expected.')

ARGS = {
    'v': 'true'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
load_dataset_bert Not yet run
unverified (harvested, no recorded run)
petergriffinjin/edgeformers/Edgeformer-E/src/data_bert.py
code served (permissive licence) · get_code("c659916e0331e814")
How it ran

no invocation recorded.

load_dataset_text Not yet run
unverified (harvested, no recorded run)
petergriffinjin/edgeformers/Edgeformer-N/src/data_heter.py
code served (permissive licence) · get_code("e548f2e57ef42dde")
How it ran

no invocation recorded.

read_process_data_bert Not yet run
unverified (harvested, no recorded run)
petergriffinjin/edgeformers/Edgeformer-E/src/data_bert.py
code served (permissive licence) · get_code("cf0a9fc158e69e83")
How it ran

no invocation recorded.

read_process_data_text Not yet run
unverified (harvested, no recorded run)
petergriffinjin/edgeformers/Edgeformer-N/src/data_heter.py
code served (permissive licence) · get_code("5f218a01268edab4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 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
dcg_score 5 other papers
3 dated earlier, 2 later
2105.02605 (2021-05)
GraphFormers: GNN-nested Transformers for Representation Learning on Textual Graph
2109.05446 (2021-09)
Efficient-FedRec: Efficient Federated Learning Framework for Privacy-Preserving News Recommendation
2205.10282 (2022-05)
Heterformer: Transformer-based Deep Node Representation Learning on Heterogeneous Text-Rich Networks
and 2 more not named here
acc 2 other papers
2 dated earlier
2105.02605 (2021-05)
GraphFormers: GNN-nested Transformers for Representation Learning on Textual Graph
2205.10282 (2022-05)
Heterformer: Transformer-based Deep Node Representation Learning on Heterogeneous Text-Rich Networks

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

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Edges in many real-world social/information networks are associated with rich text information (e.g., user-user communications or user-product reviews). However, mainstream network representation learning models focus on propagating and aggregating node attributes, lacking specific designs to utilize text semantics on edges. While there exist edge-aware graph neural networks, they directly initialize edge attributes as a feature vector, which cannot fully capture the contextualized text semantics of edges. In this paper, we propose Edgeformers 1 , a framework built upon graph-enhanced Transformers, to perform edge and node representation learning by modeling texts on edges in a contextualized way. Specifically, in edge representation learning, we inject network information into each Transformer layer when encoding edge texts; in node representation learning, we aggregate edge representations through an attention mechanism within each node's ego-graph. On five public datasets from three different domains, Edgeformers consistently outperform state-of-the-art baselines in edge classification and link prediction, demonstrating the efficacy in learning edge and node representations, respectively.

For agents

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

get_harvested_code_for_paper("2302.11050")
get_code_for_paper("2302.11050")
have("2302.11050")

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

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

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

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

Connect an agent — have() is free.