SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.13798 · ICLR · 2025

Learning Graph Quantized Tokenizers

Kaveh Hassani, Limei Wang, Zhigang Hua, Hao Wu, Weilin Cong, Bo Long, Dongqi Fu, Si Zhang, Baichuan Yuan, Ning Yao

arXiv · PDF · Open in the Atlas

Code that ran

11 of 13 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; 10 failures of our instrument; 2 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/2410.13798.json · badge: /api/ran/2410.13798.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
limei0307/GQT canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
limei0307/gqt canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; our contract draft was wrong, not the code
limei0307/GQT/gmae2_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from LiuXiaoxuanPKU/GACT-ICML, is pointer only (licence: NONE) · get_code("adf3b9c6c22af5ce")
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 LiuXiaoxuanPKU/GACT-ICML, 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.

auc_pair_loss Ran
ran; our contract draft was wrong, not the code
limei0307/GQT/gmae2_models/loss_func.py
code served (permissive licence) · get_code("87767eda0a0d0829")
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 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.functional as F

torch.manual_seed(0)

# The function auc_pair_loss takes three tensor arguments: x, y, z
# It normalizes them, computes similarities and dissimilarities, then returns a loss
# All three tensors should have the same shape for broadcasting to work

batch_size = 2
embedding_dim = 4

x = torch.randn(batch_size, embedding_dim)
y = torch.randn(batch_size, embedding_dim)
z = torch.randn(batch_size, embedding_dim)

ARGS = {
    "x": x,
    "y": y,
    "z": z,
}
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 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
fit_logistic_regression Ran
ran; our contract draft was wrong, not the code
limei0307/gqt/tokenizer/tokenizer.py
code served (permissive licence) · get_code("2073c491a6c31e7b")
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 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)

# Create small feature matrix X (num_samples=6, num_features=4)
X = torch.randn(6, 4, dtype=torch.float32)

# Create small label vector y (num_samples=6, with 3 classes: 0, 1, 2)
y = torch.tensor([0, 1, 2, 0, 1, 2], dtype=torch.long)

# Create train masks for 2 splits (6 samples, 2 splits)
train_masks = torch.tensor([
    [True, True],
    [True, False],
    [True, True],
    [False, True],
    [False, True],
    [False, False]
], dtype=torch.bool)

# Create validation masks for 2 splits (6 samples, 2 splits)
val_masks = torch.tensor([
    [False, False],
    [False, True],
    [False, False],
    [True, False],
    [True, False],
    [True, True]
], dtype=torch.bool)

# Create test mask (6 samples)
test_mask = torch.tensor([False, False, False, True, True, True], dtype=torch.bool)

ARGS = {
    "X": X,
    "y": y,
    "train_masks": train_masks,
    "val_masks": val_masks,
    "test_mask": test_mask
}
Setup block drafted by
a language model, Claude Haiku 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 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
get_current_lr Ran
ran, honoured the contract we drafted
limei0307/GQT/gmae2_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from ZiyanLiu16/MUGEN, is pointer only (licence: NONE) · get_code("c9c9174dc014b586")
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 ZiyanLiu16/MUGEN, 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.

get_tokenizer_loader Ran
ran; our contract draft was wrong, not the code
limei0307/GQT/loader.py
code served (permissive licence) · get_code("cf1c82d327548c19")
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 numpy as np
from torch_geometric.data import Data
from torch_geometric.loader import RandomNodeLoader

torch.manual_seed(0)

# Create minimal graph data
num_nodes = 8
num_edges = 10
num_features = 4
num_classes = 3

x = torch.randn(num_nodes, num_features)
edge_index = torch.randint(0, num_nodes, (2, num_edges))
y = torch.randint(0, num_classes, (num_nodes,))
sign_feat = torch.randn(num_nodes, 2)

data = Data(
    x=x,
    edge_index=edge_index,
    y=y,
    sign_feat=sign_feat
)

config = {
    'tokenizer_input': 'sign',
    'n_parts': 2
}

ARGS = {
    'config': config,
    'data': data
}
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 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
get_tokenizer_loader_sign Ran
ran; our contract draft was wrong, not the code
limei0307/GQT/loader.py
code served (permissive licence) · get_code("6f6854c82f6b6dce")
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
from torch.utils.data import DataLoader, Dataset

torch.manual_seed(0)

class DummyDataset(Dataset):
    def __init__(self, num_samples=8, feat_dim=4):
        self.num_samples = num_samples
        self.feat_dim = feat_dim
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        return torch.randn(self.feat_dim), torch.randint(0, 2, (1,))

class DataContainer:
    def __init__(self):
        self.sign_feat = DummyDataset(num_samples=8, feat_dim=4)

config = {
    'batch_size': 2
}

data = DataContainer()

ARGS = {
    'config': config,
    'data': data
}
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
index2mask Ran
ran; our contract draft was wrong, not the code
limei0307/GQT/data.py
code served (permissive licence) · get_code("942da4a4a8ad2c9d")
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 1, dtype family float, shape (5,) 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)

# idx: tensor of indices to set to True in the mask
idx = torch.tensor([0, 2], dtype=torch.long)

# size: the size of the output mask
size = 5

ARGS = {
    "idx": idx,
    "size": size,
}
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 Tensor, ndim 1, dtype family float, shape (5,) — shape (5,) 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_tokens Ran
ran; our contract draft was wrong, not the code
limei0307/gqt/tokenizer/tokenizer.py
code served (permissive licence) · get_code("12e79787da214324")
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 tuple. 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 tempfile
import os

torch.manual_seed(0)

# Create temporary directory for test files
temp_dir = tempfile.mkdtemp()
save_path = os.path.join(temp_dir, "test_model")

# Create and save dummy tensors
encoder_out = torch.randn(2, 4)
quantized = torch.randn(2, 3)
indices = torch.randint(0, 10, (2,))

torch.save(encoder_out, f"{save_path}_encoder_emb.pt")
torch.save(quantized, f"{save_path}_token_emb.pt")
torch.save(indices, f"{save_path}_id.pt")

# Define config dict with save_path
config = {
    'save_path': save_path
}

ARGS = {
    'config': config
}
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 tuple — a tuple output has no array shape of its own; none is 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
rocauc Ran
ran; our contract draft was wrong, not the code
limei0307/GQT/gmae2_utils.py
code served (permissive licence) · get_code("4041b7a277523a7e")
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 torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create y_pred: logits tensor for binary classification
# Shape: (2, 2) - 2 samples, 2 classes for softmax
y_pred = torch.randn(2, 2, requires_grad=False)

# Create y_true: binary labels
# Shape: (2,) - 2 samples with binary labels
y_true = torch.tensor([0, 1], dtype=torch.long)

ARGS = {
    "y_pred": y_pred,
    "y_true": y_true,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 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
sce_loss Ran
ran; our contract draft was wrong, not the code
limei0307/GQT/gmae2_models/loss_func.py
pointer only (licence: MIT); the stored copy get_code serves, from ZiyanLiu16/MUGEN, is pointer only (licence: NONE) · get_code("6f9bb5eb98ec4887")
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 ZiyanLiu16/MUGEN, 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.

trunc_normal_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
limei0307/GQT/gmae2_models/loss_func.py
code served (permissive licence) · get_code("915b71e73a54fc97")
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 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 math

torch.manual_seed(0)

# Create a small tensor to be modified by trunc_normal_
tensor = torch.empty(2, 4)

# Define parameters for truncated normal initialization
mean = 0.0
std = 1.0
a = -2.0
b = 2.0

ARGS = {
    'tensor': tensor,
    'mean': mean,
    'std': std,
    'a': a,
    'b': b
}
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 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
get_llm_embedding Not yet run
unverified (harvested, no recorded run)
limei0307/GQT/data.py
code served (permissive licence) · get_code("cbe8b34a9538b1ae")
How it ran

no invocation recorded.

setup_module Not yet run
unverified (harvested, no recorded run)
limei0307/GQT/gmae2_models/edcoder.py
code served (permissive licence) · get_code("35589fecfce05259")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 1 the same month, 4 later) and 7 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
trunc_normal_ 160 other papers
123 dated earlier, 3 the same month, 32 later, 2 same year, order not determinable · 36 only as an assembly brick
1911.10194 (2019-11)
Panoptic-DeepLab: A Simple, Strong, and Fast Baseline for Bottom-Up Panoptic Segmentation
2005.10242 (2020-05)
Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
2007.12911 (2020-07)
Tighter risk certificates for neural networks
and 157 more not named here
accuracy 6 other papers
5 dated earlier, 1 later
2206.11357 (2022-06)
GACT: Activation Compressed Training for Generic Network Architectures
2304.04779 (2023-04)
GraphMAE2: A Decoding-Enhanced Masked Self-Supervised Graph Learner
2310.10362 (2023-10)
Self-Pro: A Self-Prompt and Tuning Framework for Graph Neural Networks
and 3 more not named here
sce_loss 6 other papers
5 dated earlier, 1 later
2304.04779 (2023-04)
GraphMAE2: A Decoding-Enhanced Masked Self-Supervised Graph Learner
2309.04589 (2023-09)
Motif-aware Attribute Masking for Molecular Graph Pre-training
2310.00800 (2023-10)
GRAPHPATCHER: Mitigating Degree Bias for Graph Neural Networks via Test-time Augmentation
and 3 more not named here
get_current_lr 4 other papers
3 dated earlier, 1 later
2304.04779 (2023-04)
GraphMAE2: A Decoding-Enhanced Masked Self-Supervised Graph Learner
2402.07225 (2024-02)
Rethinking Graph Masked Autoencoders through Alignment and Uniformity
2402.13630 (2024-02)
UniGraph: Learning a Unified Cross-Domain Foundation Model for Text-Attributed Graphs
and 1 more not named here
auc_pair_loss 1 other paper
1 dated earlier
2304.04779 (2023-04)
GraphMAE2: A Decoding-Enhanced Masked Self-Supervised Graph Learner
setup_module 1 other paper
1 dated earlier
2304.04779 (2023-04)
GraphMAE2: A Decoding-Enhanced Masked Self-Supervised Graph Learner

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

Transformers serve as the backbone architectures of Foundational Models, where domain-specific tokenizers allow them to adapt to various domains. Graph Transformers (GTs) have recently emerged as leading models in geometric deep learning, outperforming Graph Neural Networks (GNNs) in various graph learning tasks. However, the development of tokenizers for graphs has lagged behind other modalities. To address this, we introduce GQT (Graph Quantized Tokenizer), which decouples tokenizer training from Transformer training by leveraging multi-task graph self-supervised learning, yielding robust and generalizable graph tokens. Furthermore, the GQT utilizes Residual Vector Quantization (RVQ) to learn hierarchical discrete tokens, resulting in significantly reduced memory requirements and improved generalization capabilities. By combining the GQT with token modulation, a Transformer encoder achieves state-of-the-art performance on 20 out of 22 benchmarks, including large-scale homophilic and heterophilic datasets.

For agents

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

get_harvested_code_for_paper("2410.13798")
get_code_for_paper("2410.13798")
have("2410.13798")

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

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

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

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

Connect an agent — have() is free.