SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.10136 · 2024

Can LLMs Convert Graphs to Text-Attributed Graphs?

arXiv · PDF · Open in the Atlas

Code that ran

2 of 4 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 0 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/2412.10136.json · badge: /api/ran/2412.10136.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: classifier_2025
2 ran · 2 no recorded run
FunctionStatusWhere it lives
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
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.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 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
discrepancy 1 other paper
1 later
2025.naacl-long.65 (2025 (year only))
Can LLMs Convert Graphs to Text-Attributed Graphs?
encode_text_sbert 1 other paper
1 later
2025.naacl-long.65 (2025 (year only))
Can LLMs Convert Graphs to Text-Attributed Graphs?
get_addition_text 1 other paper
1 later
2025.naacl-long.65 (2025 (year only))
Can LLMs Convert Graphs to Text-Attributed Graphs?
get_default_text 1 other paper
1 later
2025.naacl-long.65 (2025 (year only))
Can LLMs Convert Graphs to Text-Attributed 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-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

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 cross-graph 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 graph-structured 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("2412.10136")
get_code_for_paper("2412.10136")
have("2412.10136")

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

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

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

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

Connect an agent — have() is free.