SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.13023 · 2023

GraphGPT: Graph Instruction Tuning for Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

7 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; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 6 failures of our instrument; 1 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/2310.13023.json · badge: /api/ran/2310.13023.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
HKUDS/GraphGPT canonical (classifier label)
classifier basis: plan_row
7 ran · 1 no recorded run
FunctionStatusWhere it lives
compress Ran
ran; our contract draft was wrong, not the code
HKUDS/GraphGPT/graphgpt/model/compression.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Git-King-Zhan/LoReC, is pointer only (licence: NONE) · get_code("80dde39da1ba3708")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Git-King-Zhan/LoReC, 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.

find_all_linear_names Ran
ran; our contract draft was wrong, not the code
HKUDS/GraphGPT/graphgpt/model/GraphLlama_pl.py
code served (permissive licence) · get_code("649fc48067a48529")
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 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

torch.manual_seed(0)

# Build a minimal model with Linear layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Sequential(
            nn.Linear(3, 2),
            nn.ReLU()
        )
        self.lm_head = nn.Linear(2, 5)
        self.other_linear = nn.Linear(5, 4)
    
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        x = self.lm_head(x)
        x = self.other_linear(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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 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
get_compressed_list Ran
ran; our contract draft was wrong, not the code
HKUDS/GraphGPT/graphgpt/model/compression.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Git-King-Zhan/LoReC, is pointer only (licence: NONE) · get_code("c5824da57107fe8c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Git-King-Zhan/LoReC, 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.

load_compress_model Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HKUDS/GraphGPT/graphgpt/model/compression.py
code served (permissive licence) · get_code("a730a935c1f257ae")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from unittest.mock import Mock, MagicMock
import os
import tempfile

torch.manual_seed(0)

# Create minimal tokenizer mock
class MockTokenizer:
    def __init__(self):
        self.vocab_size = 1000
        self.model_max_length = 512

# Create minimal model
class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(1000, 4)
        self.linear1 = nn.Linear(4, 8)
        self.linear2 = nn.Linear(8, 4)
    
    def forward(self, input_ids):
        x = self.embedding(input_ids)
        x = self.linear1(x)
        x = self.linear2(x)
        return x

# Create a temporary directory with dummy checkpoint file
tmpdir = tempfile.mkdtemp()
model_path = tmpdir

# Create a small state dict and save it
model = MockModel()
checkpoint_path = os.path.join(model_path, 'pytorch_model-00001-of-00001.bin')
torch.save(model.state_dict(), checkpoint_path)

# Create config mock
class MockConfig:
    def __init__(self):
        self.hidden_size = 4
        self.num_hidden_layers = 2
        self.vocab_size = 1000
        self.torch_dtype = torch.float32

# Mock AutoTokenizer.from_pretrained
original_auto_tokenizer = None
try:
    from transformers import AutoTokenizer
    original_auto_tokenizer = AutoTokenizer.from_pretrained
    AutoTokenizer.from_pretrained = lambda x, **kwargs: MockTokenizer()
except:
    pass

# Mock AutoConfig.from_pretrained
original_auto_config = None
try:
    from transformers import AutoConfig
    original_auto_config = AutoConfig.from_pretrained
    AutoConfig.from_pretrained = lambda x, **kwargs: MockConfig()
except:
    pass

# Mock AutoModelForCausalLM.from_pretrained
original_auto_model = None
try:
    from transformers import AutoModelForCausalLM
    original_auto_model = AutoModelForCausalLM.from_pretrained
    AutoModelForCausalLM.from_pretrained = lambda x, **kwargs: MockModel()
except:
    pass

ARGS = {
    'model_path': model_path,
    'device': 'cpu',
    'torch_dtype': torch.float32
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
accelerate, torch, tqdm, transformers — 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
load_model_pretrained Ran
ran; our contract draft was wrong, not the code
HKUDS/GraphGPT/graphgpt/model/GraphLlama.py
code served (permissive licence) · get_code("48e990ea1b99a86d")
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 json
import os
import tempfile
import shutil

torch.manual_seed(0)

# Create a temporary directory for the pretrain model
pretrain_dir = tempfile.mkdtemp()

# Create a minimal config.json file
config_dict = {
    "hidden_dim": 64,
    "num_layers": 2,
    "dropout": 0.1
}
config_path = os.path.join(pretrain_dir, 'config.json')
with open(config_path, 'w') as f:
    json.dump(config_dict, f)

# Create a minimal state dict and save it as .pkl
state_dict = {
    "layer1.weight": torch.randn(64, 64),
    "layer1.bias": torch.randn(64),
    "layer2.weight": torch.randn(64, 64),
    "layer2.bias": torch.randn(64),
    "logit_scale": torch.tensor(0.07)
}
pkl_path = os.path.join(pretrain_dir, 'model.pkl')
torch.save(state_dict, pkl_path)

# Create a minimal model class that accepts args and has load_state_dict
class MinimalGraphModel(nn.Module):
    def __init__(self, args):
        super().__init__()
        self.hidden_dim = args.hidden_dim
        self.num_layers = args.num_layers
        self.dropout = args.dropout
        self.layer1 = nn.Linear(64, 64)
        self.layer2 = nn.Linear(64, 64)
    
    def forward(self, x):
        return x

ARGS = {
    "model_name": MinimalGraphModel,
    "pretrain_model_path": pretrain_dir
}
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
raise_warning_for_incompatible_cpu_offloading_configuration Ran
ran, violated the contract we drafted
HKUDS/GraphGPT/graphgpt/model/model_adapter.py
code served (permissive licence) · get_code("0bf414a2b44babe6")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 sys
import warnings

# Set up arguments for the function
ARGS = {
    "device": "cuda",
    "load_8bit": True,
    "cpu_offloading": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
transfer_param_tograph Ran
ran; our contract draft was wrong, not the code
HKUDS/GraphGPT/graphgpt/model/GraphLlama.py
code served (permissive licence) · get_code("17582c82f42bd6a2")
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 MinimalGNN. 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)

# Build a minimal GNN module
class MinimalGNN(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Build a minimal clip_graph that has a gnn attribute
class MinimalCLIPGraph(nn.Module):
    def __init__(self):
        super().__init__()
        self.gnn = MinimalGNN()
    
    def forward(self, x):
        return self.gnn(x)

# Create instances
clip_graph = MinimalCLIPGraph()
gnn = MinimalGNN()

ARGS = {
    "clip_graph": clip_graph,
    "gnn": gnn
}
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 MinimalGNN — a MinimalGNN output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalGNN 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
load_pretrained_model Not yet run
unverified (harvested, no recorded run)
HKUDS/GraphGPT/graphgpt/model/builder.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Git-King-Zhan/LoReC, is pointer only (licence: NONE) · get_code("bad3bd3ae89b22d3")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Git-King-Zhan/LoReC, 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.

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 (4 with at least one paper dated earlier, 2 the same month, 8 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
find_all_linear_names 22 other papers
1 dated earlier, 21 later
2308.09936 (2023-08)
BLIVA: A Simple Multimodal LLM for Better Handling of Text-Rich Visual Questions
2311.13194 (2023-11)
Towards Improving Document Understanding: An Exploration on Text-Grounding via MLLMs
aaai_27999 (2024 (year only))
BLIVA: A Simple Multimodal LLM for Better Handling of Text-Rich Visual Questions
and 19 more not named here
compress 17 other papers
4 dated earlier, 2 the same month, 11 later
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2303.06865 (2023-03)
FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU
2304.10453 (2023-04)
Phoenix: Democratizing ChatGPT across Languages
and 14 more not named here
raise_warning_for_incompatible_cpu_offloading_configuration 15 other papers
1 dated earlier, 14 later
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2312.00401 (2023-12)
VIoTGPT: Learning to Schedule Vision Tools in LLMs towards Intelligent Video Internet of Things
2312.09818 (2023-12)
SMILE: Multimodal Dataset for Understanding Laughter in Video with Language Models
and 12 more not named here
get_compressed_list 13 other papers
1 dated earlier, 1 the same month, 11 later
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2310.17631 (2023-10)
JudgeLM: Fine-tuned Large Language Models are Scalable Judges
2024.findings-emnlp.559 (2024 (year only))
A LLM-Based Ranking Method for the Evaluation of Automatic Counter-Narrative Generation
and 10 more not named here
load_pretrained_model 2 other papers
2 later
2403.00813 (2024-03)
UrbanGPT: Spatio-Temporal Large Language Models
2604.17897 (2026-04)
LoReC: Rethinking Large Language Models for Graph Data Analysis
load_compress_model 1 other paper
1 later
2403.00813 (2024-03)
UrbanGPT: Spatio-Temporal Large Language Models
load_model_pretrained 1 other paper
1 later
2402.16024 (2024-02)
HiGPT: Heterogeneous Graph Language Model
transfer_param_tograph 1 other paper
1 later
2402.16024 (2024-02)
HiGPT: Heterogeneous Graph Language Model

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

Graph Neural Networks (GNNs) have evolved to understand graph structures through recursive exchanges and aggregations among nodes. To enhance robustness, self-supervised learning (SSL) has become a vital tool for data augmentation. Traditional methods often depend on fine-tuning with task-specific labels, limiting their effectiveness when labeled data is scarce. Our research tackles this by advancing graph model generalization in zero-shot learning environments. Inspired by the success of large language models (LLMs), we aim to create a graph-oriented LLM capable of exceptional generalization across various datasets and tasks without relying on downstream graph data. We introduce the GraphGPT framework, which integrates LLMs with graph structural knowledge through graph instruction tuning. This framework includes a text-graph grounding component to link textual and graph structures and a dual-stage instruction tuning approach with a lightweight graph-text alignment projector. These innovations allow LLMs to comprehend complex graph structures and enhance adaptability across diverse datasets and tasks. Our framework demonstrates superior generalization in both supervised and zero-shot graph learning tasks, surpassing existing benchmarks. The open-sourced model implementation of our GraphGPT is available at https://github.com/HKUDS/GraphGPT.

For agents

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

get_harvested_code_for_paper("2310.13023")
get_code_for_paper("2310.13023")
have("2310.13023")

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

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

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

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

Connect an agent — have() is free.