SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.07457 · 2024

GLBench: A Comprehensive Benchmark for Graph with Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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; 6 failures of our instrument; 2 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/2407.07457.json · badge: /api/ran/2407.07457.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
nineabyss/glbench canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
FunctionStatusWhere it lives
classify_node Ran
ran; our contract draft was wrong, not the code
nineabyss/glbench/models/predictor/LLaGA/train/convert_GLBench.py
code served (permissive licence) · get_code("24cf0741f0a3cbd5")
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 torch
import numpy as np

torch.manual_seed(0)

# The function expects:
# - node_id: an integer index
# - train_mask: a tensor/array that supports indexing
# - val_mask: a tensor/array that supports indexing
# - test_mask: a tensor/array that supports indexing
# All masks should be boolean tensors that can be indexed with node_id

# Create boolean masks for a small graph with 5 nodes
num_nodes = 5
train_mask = torch.tensor([True, True, False, False, False])
val_mask = torch.tensor([False, False, True, False, False])
test_mask = torch.tensor([False, False, False, True, False])

# node_id should be a valid index into these masks
node_id = 0

ARGS = {
    'node_id': node_id,
    'train_mask': train_mask,
    'val_mask': val_mask,
    'test_mask': test_mask
}
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 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
gen_entities Ran
ran; our contract draft was wrong, not the code
nineabyss/glbench/models/enhancer/OneForAll/get_KG.py
code served (permissive licence) · get_code("97f4def1a6ad405d")
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. 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 os.path as osp
import json
import tempfile
from pathlib import Path

# Create temporary directory structure to mock the data files
tmpdir = tempfile.mkdtemp()
kg_dir = osp.join(tmpdir, 'KG')
os.makedirs(kg_dir, exist_ok=True)

# Setup for WN18RR
wn18rr_dir = osp.join(kg_dir, 'WN18RR')
os.makedirs(wn18rr_dir, exist_ok=True)
entity2text_path = osp.join(wn18rr_dir, 'entity2text.txt')
with open(entity2text_path, 'w') as f:
    f.write("entity_1\tentity one description\n")
    f.write("entity_2\tentity two description\n")
    f.write("entity_3\tentity three description\n")

# Setup for FB15K237
fb15k_dir = osp.join(kg_dir, 'FB15K237')
os.makedirs(fb15k_dir, exist_ok=True)
entity2wikidata_path = osp.join(fb15k_dir, 'entity2wikidata.json')
wikidata = {
    "entity_a": {
        "label": "Entity A",
        "alternatives": ["alt_a1", "alt_a2"],
        "description": "Description of entity A"
    },
    "entity_b": {
        "label": "Entity B",
        "alternatives": ["alt_b1"],
        "description": "Description of entity B"
    },
    "entity_c": {
        "label": "Entity C",
        "alternatives": [],
        "description": None
    }
}
with open(entity2wikidata_path, 'w') as f:
    json.dump(wikidata, f)

# Patch the hardcoded paths in the function
import sys
from unittest.mock import patch

original_join = osp.join

def patched_join(*args):
    if '/hpc2hdd/home/yli258/OneForAll/OneForAll/data/KG' in args[0]:
        return original_join(kg_dir, *args[1:])
    return original_join(*args)

# Apply patch
osp.join = patched_join

ARGS = {
    'name': 'WN18RR'
}
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 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
generate_edge_list Ran
ran; our contract draft was wrong, not the code
nineabyss/glbench/models/predictor/LLaGA/train/convert_GLBench.py
code served (permissive licence) · get_code("3b857d0df0fa822d")
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. 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)

class MockData:
    def __init__(self, edge_index, num_nodes):
        self.edge_index = edge_index
        self.num_nodes = num_nodes

# Create edge_index as a tuple of two tensors
# First tensor (row indices): [0, 1, 0, 2]
# Second tensor (col indices): [1, 2, 3, 1]
row_indices = torch.tensor([0, 1, 0, 2], dtype=torch.long)
col_indices = torch.tensor([1, 2, 3, 1], dtype=torch.long)
edge_index = (row_indices, col_indices)

# Create data object with edge_index and num_nodes
data = MockData(edge_index=edge_index, num_nodes=4)

ARGS = {
    "data": data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
get_fix_shape_subgraph_sequence_fast Ran
ran, honoured the contract we drafted
nineabyss/glbench/models/predictor/LLaGA/train/convert_GLBench.py
code served (permissive licence) · get_code("aa8b899a967c2478")
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 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 copy
import random

DEFAULT_GRAPH_PAD_ID = -500

def get_fix_shape_subgraph_sequence_fast(edge_list, node_idx, k_hop, sample_size, avoid_idx=None):
    assert k_hop > 0 and sample_size > 0
    neighbors = [[node_idx]]
    for t in range(k_hop):
        last_hop = neighbors[-1]
        current_hop = []
        for i in last_hop:
            if i == DEFAULT_GRAPH_PAD_ID:
                current_hop.extend([DEFAULT_GRAPH_PAD_ID] * sample_size)
                continue
            node_neighbor = copy.copy(edge_list[i])
            if t == 0 and avoid_idx is not None and (avoid_idx in node_neighbor):
                node_neighbor.remove(avoid_idx)
            if len(node_neighbor) > sample_size:
                sampled_neighbor = random.sample(node_neighbor, sample_size)
            else:
                sampled_neighbor = node_neighbor + [DEFAULT_GRAPH_PAD_ID] * (sample_size - len(node_neighbor))
            current_hop.extend(sampled_neighbor)
        neighbors.append(current_hop)
    node_sequence = [n for hop in neighbors for n in hop]
    return node_sequence

random.seed(42)

edge_list = {
    0: [1, 2, 3],
    1: [0, 2],
    2: [0, 1, 3, 4],
    3: [0, 2, 5],
    4: [2],
    5: [3]
}

ARGS = {
    "edge_list": edge_list,
    "node_idx": 0,
    "k_hop": 2,
    "sample_size": 2,
    "avoid_idx": None
}
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 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_text Ran
ran; our contract draft was wrong, not the code
nineabyss/glbench/models/enhancer/OneForAll/get_wiki.py
code served (permissive licence) · get_code("e0f45e1ebcb81816")
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. 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 json
import os
import tempfile
import functools

# Create a temporary directory with the required metadata.json file
temp_dir = tempfile.mkdtemp()

# Create sample metadata structure
metadata = {
    "nodes": [
        {
            "title": "Python Programming",
            "tokens": ["python", "is", "a", "programming", "language"]
        },
        {
            "title": "Machine Learning",
            "tokens": ["machine", "learning", "is", "about", "algorithms"]
        }
    ],
    "labels": {
        "label_0": "Computer Science",
        "label_1": "Technology",
        "label_2": "Education"
    }
}

# Write metadata.json to temp directory
metadata_path = os.path.join(temp_dir, 'metadata.json')
with open(metadata_path, 'w') as f:
    json.dump(metadata, f)

# Define ARGS with the temporary directory path
ARGS = {
    'path': 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 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
test Ran
ran; our contract draft was wrong, not the code
nineabyss/glbench/models/gnn/mlp.py
code served (permissive licence) · get_code("288cb7fe1150b5f3")
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 sklearn.metrics import f1_score

torch.manual_seed(0)

# Create a simple model that takes input and outputs class logits
class SimpleModel(nn.Module):
    def __init__(self, input_dim, num_classes):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

# Create a simple evaluator that computes accuracy
class SimpleEvaluator:
    def eval(self, input_dict):
        y_true = input_dict['y_true']
        y_pred = input_dict['y_pred']
        acc = (y_true == y_pred).float().mean().item()
        return {'acc': acc}

# Setup
num_samples = 2
input_dim = 4
num_classes = 3

model = SimpleModel(input_dim, num_classes)

# Create input features: shape (2, 4)
x = torch.randn(num_samples, input_dim)

# Create labels: shape (2,) with values in [0, 1, 2]
y_true = torch.tensor([0, 1])

# Create split indices
split_idx = {
    'train': torch.tensor([0]),
    'valid': torch.tensor([1]),
    'test': torch.tensor([0, 1])
}

evaluator = SimpleEvaluator()

ARGS = {
    'model': model,
    'x': x,
    'y_true': y_true,
    'split_idx': split_idx,
    'evaluator': evaluator
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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
train Ran
ran; our contract draft was wrong, not the code
nineabyss/glbench/models/gnn/mlp.py
code served (permissive licence) · get_code("fffc14ec419e60ce")
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 torch.optim as optim

torch.manual_seed(0)

# Define a simple model that takes input and outputs log probabilities
class SimpleModel(nn.Module):
    def __init__(self, input_dim, num_classes):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        # Returns log probabilities for nll_loss
        return torch.nn.functional.log_softmax(self.linear(x), dim=1)

# Create model
model = SimpleModel(input_dim=4, num_classes=3)

# Create tiny tensors
# x: batch_size=2, features=4
x = torch.randn(2, 4)

# y_true: class labels (2 samples, num_classes=3)
y_true = torch.tensor([0, 2])

# train_idx: indices for training subset
train_idx = torch.tensor([0, 1])

# Create optimizer
optimizer = optim.SGD(model.parameters(), lr=0.01)

ARGS = {
    'model': model,
    'x': x,
    'y_true': y_true,
    'train_idx': train_idx,
    'optimizer': optimizer
}
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 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
get_data Not yet run
unverified (harvested, no recorded run)
nineabyss/glbench/models/enhancer/OneForAll/get_wiki.py
code served (permissive licence) · get_code("0c31b93e3f644d27")
How it ran

no invocation recorded.

read_knowledge_graph Not yet run
unverified (harvested, no recorded run)
nineabyss/glbench/models/enhancer/OneForAll/get_KG.py
code served (permissive licence) · get_code("01fe61ce74c391f9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

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 emergence of large language models (LLMs) has revolutionized the way we interact with graphs, leading to a new paradigm called GraphLLM. Despite the rapid development of GraphLLM methods in recent years, the progress and understanding of this field remain unclear due to the lack of a benchmark with consistent experimental protocols. To bridge this gap, we introduce GLBench, the first comprehensive benchmark for evaluating GraphLLM methods in both supervised and zero-shot scenarios. GLBench provides a fair and thorough evaluation of different categories of GraphLLM methods, along with traditional baselines such as graph neural networks. Through extensive experiments on a collection of real-world datasets with consistent data processing and splitting strategies, we have uncovered several key findings. Firstly, GraphLLM methods outperform traditional baselines in supervised settings, with LLM-as-enhancers showing the most robust performance. However, using LLMs as predictors is less effective and often leads to uncontrollable output issues. We also notice that no clear scaling laws exist for current GraphLLM methods. In addition, both structures and semantics are crucial for effective zero-shot transfer, and our proposed simple baseline can even outperform several models tailored for zero-shot scenarios. The data and code of the benchmark can be found at https://github.com/NineAbyss/GLBench.

For agents

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

get_harvested_code_for_paper("2407.07457")
get_code_for_paper("2407.07457")
have("2407.07457")

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

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

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

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

Connect an agent — have() is free.