SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.14202 · ICML · 2024

Comparing Graph Transformers via Positional Encodings

Yusu Wang, Gal Mishne, Mitchell Black, Zhengchao Wan, Amir Nayyeri

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 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, 2 violated it and 0 have no contract verdict; 2 failures of our instrument; 3 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/2402.14202.json · badge: /api/ran/2402.14202.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
blackmit/comparing_graph_transformers_via_positional_encodings canonical (classifier label)
classifier basis: census
5 ran · 3 no recorded run
FunctionStatusWhere it lives
get_final_pretrained_ckpt Ran
ran; our contract draft was wrong, not the code
blackmit/comparing_graph_transformers_via_positional_encodings/graphgps/finetuning.py
code served (permissive licence) · get_code("1bb331bf70a78136")
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 str. 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 os
import tempfile
import shutil

# Create a temporary directory with checkpoint files
temp_dir = tempfile.mkdtemp()

# Create some checkpoint files with epoch numbers
checkpoint_files = ['1.ckpt', '2.ckpt', '5.ckpt', '3.ckpt']
for ckpt_file in checkpoint_files:
    filepath = os.path.join(temp_dir, ckpt_file)
    with open(filepath, 'w') as f:
        f.write('dummy checkpoint data')

# Define arguments for the function
ARGS = {
    'ckpt_dir': temp_dir
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
graph_token_pooling Ran
ran; our contract draft was wrong, not the code
blackmit/comparing_graph_transformers_via_positional_encodings/graphgps/pooling/graph_token.py
code served (permissive licence) · get_code("55e0e3e0c19f368e")
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
import torch.nn as nn
from torch_geometric.utils import to_dense_batch

torch.manual_seed(0)

# Create a small tensor for node features
# Shape: (num_nodes, feature_dim)
x = torch.randn(6, 4)

# Create batch tensor indicating which graph each node belongs to
# We'll have 2 graphs: nodes 0-2 in graph 0, nodes 3-5 in graph 1
batch = torch.tensor([0, 0, 0, 1, 1, 1])

ARGS = {
    'x': x,
    'batch': batch,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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 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
is_seed Ran
ran, violated the contract we drafted
blackmit/comparing_graph_transformers_via_positional_encodings/graphgps/agg_runs.py
pointer only (licence: MIT); the stored copy get_code serves, from sunjss/over-aggregating, is pointer only (licence: NONE) · get_code("c98a702be0660ac9")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sunjss/over-aggregating, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

is_split Ran
ran, violated the contract we drafted
blackmit/comparing_graph_transformers_via_positional_encodings/graphgps/agg_runs.py
pointer only (licence: MIT); the stored copy get_code serves, from sunjss/over-aggregating, is pointer only (licence: NONE) · get_code("438635c08adfe2aa")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sunjss/over-aggregating, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

join_list Ran
ran, honoured the contract we drafted
blackmit/comparing_graph_transformers_via_positional_encodings/graphgps/agg_runs.py
pointer only (licence: MIT); the stored copy get_code serves, from sunjss/over-aggregating, is pointer only (licence: NONE) · get_code("40e98e1ecbf39f34")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sunjss/over-aggregating, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

apply_chunking_to_forward Not yet run
unverified (harvested, no recorded run)
blackmit/comparing_graph_transformers_via_positional_encodings/graphgps/layer/bigbird_layer.py
pointer only (licence: MIT); the stored copy get_code serves, from sunjss/over-aggregating, is pointer only (licence: NONE) · get_code("ae56bcfaae96da3c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sunjss/over-aggregating, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

init_model_from_pretrained Not yet run
unverified (harvested, no recorded run)
blackmit/comparing_graph_transformers_via_positional_encodings/graphgps/finetuning.py
code served (permissive licence) · get_code("3db4474abe13fdee")
How it ran

no invocation recorded.

load_pretrained_model_cfg Not yet run
unverified (harvested, no recorded run)
blackmit/comparing_graph_transformers_via_positional_encodings/graphgps/finetuning.py
code served (permissive licence) · get_code("d796cdea5889c847")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 7 the same month, 7 later) and 0 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
get_final_pretrained_ckpt 27 other papers
11 dated earlier, 2 the same month, 14 later
2302.04181 (2023-02)
Attending to Graph Transformers
2302.08647 (2023-02)
Multiresolution Graph Transformers and Wavelet Positional Encoding for Learning Hierarchical Structures
2305.08018 (2023-05)
DRew: Dynamically Rewired Message Passing with Delay
and 24 more not named here
apply_chunking_to_forward 21 other papers
10 dated earlier, 2 the same month, 9 later
2002.01685 (2020-02)
Parsing as Pretraining
2210.09545 (2022-10)
Fine-mixing: Mitigating Backdoors in Fine-tuned Language Models
2302.04181 (2023-02)
Attending to Graph Transformers
and 18 more not named here
is_seed 15 other papers
4 dated earlier, 2 the same month, 9 later
2302.04181 (2023-02)
Attending to Graph Transformers
2309.00367 (2023-09)
Where Did the Gap Go? Reassessing the Long-Range Graph Benchmark
2310.19285 (2023-10)
Facilitating Graph Neural Networks with Random Walk on Simplicial Complexes
and 12 more not named here
is_split 15 other papers
4 dated earlier, 2 the same month, 9 later
2302.04181 (2023-02)
Attending to Graph Transformers
2309.00367 (2023-09)
Where Did the Gap Go? Reassessing the Long-Range Graph Benchmark
2310.19285 (2023-10)
Facilitating Graph Neural Networks with Random Walk on Simplicial Complexes
and 12 more not named here
join_list 15 other papers
4 dated earlier, 2 the same month, 9 later
2302.04181 (2023-02)
Attending to Graph Transformers
2309.00367 (2023-09)
Where Did the Gap Go? Reassessing the Long-Range Graph Benchmark
2310.19285 (2023-10)
Facilitating Graph Neural Networks with Random Walk on Simplicial Complexes
and 12 more not named here
init_model_from_pretrained 10 other papers
3 dated earlier, 1 the same month, 6 later
2302.04181 (2023-02)
Attending to Graph Transformers
2309.00367 (2023-09)
Where Did the Gap Go? Reassessing the Long-Range Graph Benchmark
2312.04234 (2023-12)
Graph Convolutions Enrich the Self-Attention in Transformers!
and 7 more not named here
load_pretrained_model_cfg 9 other papers
3 dated earlier, 1 the same month, 5 later
2302.04181 (2023-02)
Attending to Graph Transformers
2309.00367 (2023-09)
Where Did the Gap Go? Reassessing the Long-Range Graph Benchmark
2312.04234 (2023-12)
Graph Convolutions Enrich the Self-Attention in Transformers!
and 6 more not named here
graph_token_pooling 1 other paper
1 dated earlier
2302.04181 (2023-02)
Attending to Graph Transformers

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

The distinguishing power of graph transformers is tied to the choice of positional encoding: features used to augment the base transformer with information about the graph. There are two primary types of positional encoding: absolute positional encodings (APEs) and relative positional encodings (RPEs). APEs assign features to each node and are given as input to the transformer. RPEs instead assign a feature to each pair of nodes, e.g., shortest-path distance, and are used to augment the attention block. A priori, it is unclear which method is better for maximizing the power of the resulting graph transformer. In this paper, we aim to understand the relationship between these different types of positional encodings. Interestingly, we show that graph transformers using APEs and RPEs are equivalent in their ability to distinguish non-isomorphic graphs. In particular, we demonstrate how to interchange APEs and RPEs while maintaining their distinguishing power in terms of graph transformers. However, in the case of graphs with node features, we show that RPEs may have an advantage over APEs. Based on our theoretical results, we provide a study of different APEs and RPEs-including the shortest-path and resistance distance and the recently introduced stable and expressive positional encoding (SPE)and compare their distinguishing power in terms of transformers. We believe our work will help navigate the vast number of positional encoding choices and provide guidance on the future design of positional encodings for graph transformers.

For agents

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

get_harvested_code_for_paper("2402.14202")
get_code_for_paper("2402.14202")
have("2402.14202")

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

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

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

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

Connect an agent — have() is free.