Beyond Code Generation over Tabular Graphs: A Structural Context Tool for Graph Inference
Abstract
Large Language Models (LLMs) have demonstrated graph inference capabilities on Text-Attributed Graphs (TAGs), which are widely used in social networks and recommendation systems. Graph-as-Code (GAC) enables LLM-Graph interaction in tabular form through code generation, avoiding the need to explicitly serialize large graphs into prompts. In the node classification task, accessibility of tabular graph data does not guarantee that GAC can effectively capture local neighbor structure or global data bias. We observe that the overlap between misclassified nodes of GAC and GNN-based methods (GCN, GAT, GraphSAGE) is substantially smaller than the overlap among GNN-based methods themselves. The oracle upper bound of GAC and GNN indicates complementary predictive performance. To enhance interaction performance, we introduce a Structural Context Tool (SCT) that augments the original tabular graph data with GNN predictions and topic summaries by aggregating over K-hop neighbors or random walks. The SCT can generate augmentation during graph inference. Across ten datasets, our method achieved an average improvement of 3.91% in node classification accuracy compared to baseline GAC. Further analytical experiments indicate that LLM-Graph interactions in tabular form require both the global data bias from GNN training and the local structural summary from neighbor aggregation. Executor code and preprocessed dataset are available at the https://anonymous.4open.science/r/anonymous-artifact-C7A2.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.