SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.01232 · ICLR · 2024

Polynormer: Polynomial-Expressive Graph Transformer in Linear Time

Zhiru Zhang, Chenhui Deng, Zichao Yue

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 (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 3 failures of our instrument; 3 no recorded run), measured 2026-11-21; 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/2403.01232.json · badge: /api/ran/2403.01232.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
cornell-zhang/Polynormer canonical (classifier label)
classifier basis: census
3 ran · 3 no recorded run
cornell-zhang/polynormer community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
GlobalAttn Ran
ran on a synthesized input · constructed an object; no result was computed
cornell-zhang/polynormer/model.py
code served (permissive licence) · get_code("ea1ddecdfaa27927")
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 an instance of its own class, GlobalAttn: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

ARGS = {
    'hidden_channels': 4,
    'heads': 3,
    'num_layers': 2,
    'beta': 0.5,
    'dropout': 0.1,
    'qk_shared': True,
}
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 GlobalAttn — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GlobalAttn 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
Polynormer Ran
ran on a synthesized input · constructed an object; no result was computed
cornell-zhang/polynormer/model.py
code served (permissive licence) · get_code("62ffb90034b7235d")
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 an instance of its own class, Polynormer: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

ARGS = {
    "in_channels": 5,
    "hidden_channels": 4,
    "out_channels": 3,
    "local_layers": 2,
    "global_layers": 2,
    "in_dropout": 0.15,
    "dropout": 0.5,
    "global_dropout": 0.5,
    "heads": 2,
    "beta": -1,
    "pre_ln": False,
}
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 Polynormer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Polynormer 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
eval_acc Ran
ran; our contract draft was wrong, not the code
cornell-zhang/Polynormer/data_utils.py
code served (permissive licence) · get_code("319c36c17da75fed")
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 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 numpy as np

torch.manual_seed(0)

# The function expects:
# - y_true: a tensor that can be detached, moved to CPU, and converted to numpy
#           with shape (batch_size, num_tasks)
# - y_pred: a tensor that can be detached, moved to CPU, converted to numpy
#           and has argmax applied on dim=-1

# Create y_true: shape (2, 3) - 2 samples, 3 tasks
y_true = torch.tensor([
    [0, 1, 2],
    [1, 0, 1]
], dtype=torch.long)

# Create y_pred: shape (2, 3, 4) - 2 samples, 3 tasks, 4 classes
# argmax(dim=-1) will reduce to shape (2, 3, 1)
y_pred = torch.randn(2, 3, 4)

ARGS = {
    'y_true': y_true,
    'y_pred': y_pred
}
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 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
load_fixed_splits Ran
ran; our contract draft was wrong, not the code
cornell-zhang/Polynormer/data_utils.py
code served (permissive licence) · get_code("5b7702a29f6dafaf")
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 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
import tempfile
import os

torch.manual_seed(0)

# Create a temporary directory for data_dir
data_dir = tempfile.mkdtemp()

# Create mock split files for the 'amazon-computer' case
os.makedirs(data_dir, exist_ok=True)
np.savez(
    f'{data_dir}/amazon-computer_split.npz',
    train=np.array([0, 1]),
    valid=np.array([2]),
    test=np.array([3])
)

# Create mock split files for the 'pokec' case
pokec_dir = os.path.join(data_dir, 'pokec')
os.makedirs(pokec_dir, exist_ok=True)
pokec_splits = np.array([
    {
        'train': np.array([0, 1]),
        'valid': np.array([2]),
        'test': np.array([3])
    }
], dtype=object)
np.save(f'{pokec_dir}/pokec-splits.npy', pokec_splits, allow_pickle=True)

# For testing, we'll use the amazon-computer case since it doesn't require
# downloading datasets and just needs files
dataset = None  # not used in the function body

ARGS = {
    'data_dir': data_dir,
    'dataset': dataset,
    'name': 'amazon-computer'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 list, ndim 1, dtype family float — 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
load_model Ran
ran; our contract draft was wrong, not the code
cornell-zhang/Polynormer/logger.py
code served (permissive licence) · get_code("635fdf41b8d70789")
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 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 torch
import torch.nn as nn
import tempfile
import os

torch.manual_seed(0)

# Create a minimal model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal optimizer
model = SimpleModel()
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)

# Create a temporary directory and checkpoint file
temp_dir = tempfile.mkdtemp()
models_dir = os.path.join(temp_dir, 'models', 'dataset1')
os.makedirs(models_dir, exist_ok=True)

# Save a checkpoint
checkpoint = {
    'model_state_dict': model.state_dict(),
    'optimizer_state_dict': optimizer.state_dict(),
}
checkpoint_path = os.path.join(models_dir, 'method1_0_0.5.pt')
torch.save(checkpoint, checkpoint_path)

# Create args object with necessary attributes
class Args:
    def __init__(self):
        self.dataset = 'dataset1'
        self.method = 'method1'
        self.beta = 0.5

args = Args()

# Create fresh model and optimizer for loading
model_fresh = SimpleModel()
optimizer_fresh = torch.optim.SGD(model_fresh.parameters(), lr=0.01)

# Override the models directory to point to our temp directory
import sys
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'args': args,
    'model': model_fresh,
    'optimizer': optimizer_fresh,
    'run': 0,
}
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 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
eval_f1 Not yet run
unverified (harvested, no recorded run)
cornell-zhang/Polynormer/data_utils.py
code served (permissive licence) · get_code("39f7b3a8e45be81b")
How it ran

no invocation recorded.

load_hetero_dataset Not yet run
unverified (harvested, no recorded run)
cornell-zhang/Polynormer/dataset.py
code served (permissive licence) · get_code("2ca80bf081304f24")
How it ran

no invocation recorded.

load_wikics_dataset Not yet run
unverified (harvested, no recorded run)
cornell-zhang/Polynormer/dataset.py
code served (permissive licence) · get_code("a411b546b0451f0e")
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, 5 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 5 later) and 3 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
eval_acc 1 other paper
1 later
2406.08993 (2024-06)
Classic GNNs are Strong Baselines: Reassessing GNNs for Node Classification
eval_f1 1 other paper
1 later
2406.08993 (2024-06)
Classic GNNs are Strong Baselines: Reassessing GNNs for Node Classification
load_fixed_splits 1 other paper
1 later
2406.08993 (2024-06)
Classic GNNs are Strong Baselines: Reassessing GNNs for Node Classification
load_hetero_dataset 1 other paper
1 later
2406.08993 (2024-06)
Classic GNNs are Strong Baselines: Reassessing GNNs for Node Classification
load_wikics_dataset 1 other paper
1 later
2406.08993 (2024-06)
Classic GNNs are Strong Baselines: Reassessing GNNs for Node Classification

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

Repositories linked to this paper

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

Abstract

Graph transformers (GTs) have emerged as a promising architecture that is theoretically more expressive than message-passing graph neural networks (GNNs). However, typical GT models have at least quadratic complexity and thus cannot scale to large graphs. While there are several linear GTs recently proposed, they still lag behind GNN counterparts on several popular graph datasets, which poses a critical concern on their practical expressivity. To balance the trade-off between expressivity and scalability of GTs, we propose Polynormer, a polynomialexpressive GT model with linear complexity. Polynormer is built upon a novel base model that learns a high-degree polynomial on input features. To enable the base model permutation equivariant, we integrate it with graph topology and node features separately, resulting in local and global equivariant attention models. Consequently, Polynormer adopts a linear local-to-global attention scheme to learn high-degree equivariant polynomials whose coefficients are controlled by attention scores. Polynormer has been evaluated on 13 homophilic and heterophilic datasets, including large graphs with millions of nodes. Our extensive experiment results show that Polynormer outperforms state-of-the-art GNN and GT baselines on most datasets, even without the use of nonlinear activation functions. Source code of Polynormer is freely available at: github.com/cornell-zhang/Polynormer.

For agents

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

get_harvested_code_for_paper("2403.01232")
get_code_for_paper("2403.01232")
have("2403.01232")

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

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

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

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

Connect an agent — have() is free.