SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2025.naacl-long.65 · NAACL · 2025

Can LLMs Convert Graphs to Text-Attributed Graphs?

Chuxu Zhang, Yanfang Ye, Zheyuan Zhang, Zehong Wang, Tianyi Ma, Sidney Liu

Code that ran

10 of 16 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 6 no recorded run), measured 2026-11-24; 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/2025.naacl-long.65.json · badge: /api/ran/2025.naacl-long.65.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
Zehong-Wang/TANS canonical (classifier label)
classifier basis: census
10 ran · 6 no recorded run
FunctionStatusWhere it lives
compute_node_properties Ran
ran; our contract draft was wrong, not the code
Zehong-Wang/TANS/TANS/preprocess/node_property.py
code served (permissive licence) · get_code("ff5668a2d973040f")
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 dict. 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 networkx as nx

# Create a simple undirected graph for testing
G = nx.Graph()
G.add_edges_from([(0, 1), (1, 2), (2, 3), (3, 0), (0, 2)])

ARGS = {
    'G': G
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
discrepancy Ran
ran, honoured the contract we drafted
Zehong-Wang/TANS/TANS/train/da.py
code served (permissive licence) · get_code("968dd238a64eb395")
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 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 as nn

torch.manual_seed(0)

class SimpleEncoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(3, 4)
    
    def encode(self, x, edge_index, edge_attr):
        # x: [num_nodes, 3]
        # Returns encoded features [num_nodes, 4]
        return self.linear(x)
    
    def pooling(self, z, k_hop_edge_index, k_hop_edge_attr):
        # z: [num_nodes, 4]
        # Returns pooled representation [batch_size, 4]
        # Simple mean pooling
        return z.mean(dim=0, keepdim=True)

class SimpleData:
    def __init__(self, num_nodes=2):
        self.x = torch.randn(num_nodes, 3)
        self.edge_index = torch.tensor([[0, 1], [1, 0]], dtype=torch.long).t().contiguous()
        self.edge_attr = torch.randn(2, 2)
        self.k_hop_edge_index = torch.tensor([[0, 1], [1, 0]], dtype=torch.long).t().contiguous()
    
    def get(self, key, default=None):
        if key == 'k_hop_edge_attr':
            return torch.randn(2, 2) if default is None else default
        return default

class SimpleCmd:
    def mmatch(self, z1, z2, n_moments=3):
        # z1, z2: [batch_size, feature_dim]
        # Returns a scalar discrepancy measure
        return torch.tensor(0.5)

encoder = SimpleEncoder()
src_data = SimpleData(num_nodes=2)
data = SimpleData(num_nodes=2)
cmd = SimpleCmd()

ARGS = {
    'encoder': encoder,
    'src_data': src_data,
    'data': data,
    'cmd': cmd,
    'n_moments': 3
}
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 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
encode_text_sbert Ran
ran, honoured the contract we drafted
Zehong-Wang/TANS/TANS/preprocess/encode_text.py
code served (permissive licence) · get_code("d6f4b79a34b2b77e")
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 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

torch.manual_seed(0)

class MockSBERTModel(nn.Module):
    """Minimal mock of sentence-bert model with encode method"""
    def __init__(self):
        super().__init__()
        self.embedding_dim = 4
    
    def encode(self, text):
        """Mock encode that returns embeddings"""
        if isinstance(text, str):
            text = [text]
        if isinstance(text, list):
            batch_size = len(text)
        else:
            batch_size = 1
        return torch.randn(batch_size, self.embedding_dim)

model = MockSBERTModel()
text = ["Hello world", "This is a test"]

ARGS = {
    "text": text,
    "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 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
generate_text Ran
ran; our contract draft was wrong, not the code
Zehong-Wang/TANS/TANS/preprocess/airport_graphs.py
code served (permissive licence) · get_code("2e37bdf0888f6f82")
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.

class Args:
    def __init__(self, data_name):
        self.data_name = data_name

node = 42
methods = {
    'degree_centrality': (0.7234, 15),
    'betweenness_centrality': (0.4521, 87),
    'closeness_centrality': (0.6789, 23)
}
args = Args('usa')

ARGS = {
    'node': node,
    'methods': methods,
    'args': args
}
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
get_file_paths Ran
ran; our contract draft was wrong, not the code
Zehong-Wang/TANS/TANS/preprocess/query_llms.py
code served (permissive licence) · get_code("195e375a5a4e05e3")
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 os.path as osp

class Args:
    def __init__(self, setting, dataset, model, without_neigh):
        self.setting = setting
        self.dataset = dataset
        self.model = model
        self.without_neigh = without_neigh

ARGS = {
    'args': Args(
        setting='test_setting',
        dataset='test_dataset',
        model='test_model',
        without_neigh=False
    )
}
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, 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_n_params Ran
ran, honoured the contract we drafted
Zehong-Wang/TANS/TANS/train/utils/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from zehong-wang/subgraph-pooling, is pointer only (licence: NONE) · get_code("daf55c979a3ffd35")
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 zehong-wang/subgraph-pooling, 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_one_hop_neighbors Ran
ran; our contract draft was wrong, not the code
Zehong-Wang/TANS/TANS/preprocess/node_property.py
code served (permissive licence) · get_code("dcdb118df7c324e4")
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 dict. 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
import tqdm

torch.manual_seed(0)

# Create a minimal graph object that has the required attributes
class MockGraph:
    def __init__(self):
        # Create edge_index as a 2xE tensor where E is number of edges
        # edge_index[0] contains source nodes, edge_index[1] contains target nodes
        # For 4 nodes, create some edges
        self.edge_index = torch.tensor([
            [0, 0, 1, 2, 2, 3],  # source nodes
            [1, 2, 3, 0, 3, 1]   # target nodes
        ], dtype=torch.long)
        self.num_nodes = 4

G = MockGraph()

ARGS = {
    "G": G
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
query_model Ran
ran; our contract draft was wrong, not the code
Zehong-Wang/TANS/TANS/preprocess/query_llms.py
code served (permissive licence) · get_code("eb4ab71f22499989")
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
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a mock client that mimics the OpenAI client API
mock_client = Mock()

# Create a mock completion response
mock_message = Mock()
mock_message.content = "Graph theory is the study of graphs, which are mathematical structures used to model pairwise relations between objects."

mock_choice = Mock()
mock_choice.message = mock_message

mock_completion = Mock()
mock_completion.choices = [mock_choice]

# Set up the client to return our mock completion
mock_client.chat.completions.create = Mock(return_value=mock_completion)

# Define arguments
ARGS = {
    'client': mock_client,
    'question': 'What is graph theory?',
    'model': 'gpt-4'
}
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 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
source_sampling Ran
ran; our contract draft was wrong, not the code
Zehong-Wang/TANS/TANS/train/utils/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from zehong-wang/subgraph-pooling, is pointer only (licence: NONE) · get_code("b73ef0ea4c1728ba")
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 zehong-wang/subgraph-pooling, 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.

target_sampling Ran
ran; our contract draft was wrong, not the code
Zehong-Wang/TANS/TANS/train/utils/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from zehong-wang/subgraph-pooling, is pointer only (licence: NONE) · get_code("eb06c3ed47978a35")
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 zehong-wang/subgraph-pooling, 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_addition_text Not yet run
unverified (harvested, no recorded run)
Zehong-Wang/TANS/TANS/preprocess/encode_text.py
code served (permissive licence) · get_code("fe55696b89eb82d7")
How it ran

no invocation recorded.

get_default_text Not yet run
unverified (harvested, no recorded run)
Zehong-Wang/TANS/TANS/preprocess/encode_text.py
code served (permissive licence) · get_code("f017dc8426deda5b")
How it ran

no invocation recorded.

get_similar_nodes Not yet run
unverified (harvested, no recorded run)
Zehong-Wang/TANS/TANS/preprocess/citation_graphs.py
code served (permissive licence) · get_code("763f9ff3d1e2f82c")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
Zehong-Wang/TANS/TANS/preprocess/citation_graphs.py
code served (permissive licence) · get_code("542896fbe92c8162")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
Zehong-Wang/TANS/TANS/preprocess/node_property.py
code served (permissive licence) · get_code("f532fc8662f1e4d9")
How it ran

no invocation recorded.

process_topological_features Not yet run
unverified (harvested, no recorded run)
Zehong-Wang/TANS/TANS/preprocess/airport_graphs.py
code served (permissive licence) · get_code("adadd836337f3b7c")
How it ran

no invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
get_n_params 14 other papers
13 dated earlier, 1 same year, order not determinable
1809.01852 (2018-09)
GAMENet: Graph Augmented MEmory Networks for Recommending Medication Combination
1912.09363 (2019-12)
Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting
2003.01332 (2020-03)
Heterogeneous Graph Transformer
and 11 more not named here
discrepancy 1 other paper
1 dated earlier
2412.10136 (2024-12)
Can LLMs Convert Graphs to Text-Attributed Graphs?
encode_text_sbert 1 other paper
1 dated earlier
2412.10136 (2024-12)
Can LLMs Convert Graphs to Text-Attributed Graphs?
get_addition_text 1 other paper
1 dated earlier
2412.10136 (2024-12)
Can LLMs Convert Graphs to Text-Attributed Graphs?
get_default_text 1 other paper
1 dated earlier
2412.10136 (2024-12)
Can LLMs Convert Graphs to Text-Attributed Graphs?
source_sampling 1 other paper
1 dated earlier
2402.08907 (2024-02)
Subgraph Pooling: Tackling Negative Transfer on Graphs
target_sampling 1 other paper
1 dated earlier
2402.08907 (2024-02)
Subgraph Pooling: Tackling Negative Transfer on Graphs

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

Repositories linked to this paper

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

Abstract

Graphs are ubiquitous structures found in numerous real-world applications, such as drug discovery, recommender systems, and social network analysis. To model graph-structured data, graph neural networks (GNNs) have become a popular tool. However, existing GNN architectures encounter challenges in crossgraph learning where multiple graphs have different feature spaces. To address this, recent approaches introduce text-attributed graphs (TAGs), where each node is associated with a textual description, which can be projected into a unified feature space using textual encoders. While promising, this method relies heavily on the availability of text-attributed graph data, which is difficult to obtain in practice. To bridge this gap, we propose a novel method named Topology-Aware Node description Synthesis (TANS), leveraging large language models (LLMs) to convert existing graphs into text-attributed graphs. The key idea is to integrate topological information into LLMs to explain how graph topology influences node semantics. We evaluate our TANS on text-rich, text-limited, and text-free graphs, demonstrating its applicability. Notably, on text-free graphs, our method significantly outperforms existing approaches that manually design node features, showcasing the potential of LLMs for preprocessing graphstructured data in the absence of textual information. The code and data are available at https://github.com/Zehong-Wang/TANS.

For agents

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

get_harvested_code_for_paper("2025.naacl-long.65")
get_code_for_paper("2025.naacl-long.65")
have("2025.naacl-long.65")

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

curl https://syntology.ai/api/ran/2025.naacl-long.65.json

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

[![Syntology run record](https://syntology.ai/api/ran/2025.naacl-long.65.svg)](https://syntology.ai/paper/2025.naacl-long.65)

Connect an agent — have() is free.