TL;DR
Can general-purpose Large Language Models (LLMs) effectively understand and reason over graph-structured data? This paper benchmarks GPT-3.5 and GPT-4 across node-, edge-, and graph-level tasks, showing that while LLMs still lag behind Graph Neural Networks (GNNs) on node classification, incorporating structural neighborhood information into prompts can dramatically boost link prediction accuracy—sometimes even outperforming specialized GNNs.
What Problem Does This Paper Address?
LLMs excel at sequential NLP tasks, but the real world is heavily graph-structured—from citation and social networks to knowledge graphs and molecular structures. While Graph Neural Networks (GNNs) explicitly exploit topological connections and message passing, it remains unclear whether pre-trained LLMs can interpret graph structures directly from textual prompts.
The authors address three core questions:
- Can LLMs perform graph analytics tasks using purely contextual text, without explicit graph topology?
- Does injecting structural neighbor information into prompts actually improve LLM predictions?
- How do task levels (node, edge, graph) and domain characteristics influence LLM performance compared to specialized GNNs?
Methods
The authors designed prompt strategies to benchmark GPT-3.5 (gpt-3.5-turbo-16k) and GPT-4 under zero-shot and few-shot regimes against standard semi-supervised GNN baselines (GCN, GAT, GAE, GIC):
- Node Classification: Tested three prompt variations:
- No structure: Evaluating text attributes alone (e.g., paper title and abstract).
- Direct neighborhood: Appending neighbor text (titles/abstracts of cited papers).
- Retrieval-guided reasoning: Instructing the model to analyze topics, extract relevant citations, and synthesize predictions.
- Edge Prediction (Link Prediction): Tested node pairs without context vs. providing the first node's cited neighbors.
- Graph Classification: Summarized top-$k$ posts from the most active users within Reddit communities to classify the subreddit from varying numbers of candidate classes.
Datasets
The authors evaluated five widely studied benchmark datasets:
- CORA & PUBMED: Citation networks used for 7-class and 3-class node classification, as well as link prediction.
- OGBN-ARXIV: Large-scale citation network for 40-class node classification.
- WORDNET18: Knowledge graph used for 18-class relation/link classification.
- REDDIT: Post-discussion subgraphs sampled across up to 70 communities for graph-level classification.
(No new datasets were introduced; the authors relied on standard existing benchmarks).
Key Insights and Ideas
- Graph structure is critical for edges, but optional for nodes: Adding neighbor information provided only marginal or inconsistent gains in node classification. In contrast, providing neighbor context caused a dramatic leap in edge-level link prediction.
- Complex multi-step reasoning prompts can backfire: When prompted to retrieve and reason over citation patterns before classifying a node, both GPT-3.5 and GPT-4 collapsed (accuracy dropped to ~5%), struggling to execute explicit multi-step graph search in-context.
- Information overload hurts link prediction: In edge prediction, providing neighboring paper titles yielded high accuracy, but adding full neighboring abstracts deteriorated performance, indicating LLMs are sensitive to noise and context dilution.
- Pre-trained parametric knowledge introduces domain bias: On PUBMED (diabetes literature), zero-shot GPT-4 outperformed GNNs without seeing graph structure, largely because biomedical concepts are sharply defined in pre-training data. On computer science papers (OGBN-ARXIV), semantic overlap between overlapping fields led to frequent misclassifications.
Key Results
- Node Classification: Semi-supervised GNNs generally outperformed zero-shot LLMs on CORA (GAT: 0.832 vs. GPT-3.5: 0.627 / GPT-4: 0.432) and OGBN-ARXIV (GAT: 0.742 vs. GPT-4: 0.642). However, on PUBMED, GPT-4 achieved 0.821 (zero-shot) and 0.833 (few-shot), surpassing GCN (0.790).
- Edge-Level Link Prediction: On CORA, supplying neighborhood titles increased GPT-3.5 accuracy from 51.2% to 64.6%, and skyrocketed GPT-4 from 57.8% to 96.7%, beating dedicated link prediction models like GAE (0.793) and GIC (0.812).
- Graph-Level Classification: On REDDIT, GPT-3.5 achieved 77.3% accuracy with binary/few candidate communities, decaying monotonically to 50.7% when classifying across 70 candidate subreddits.
Limitations and Future Work
- Fairness & Data Contamination: LLMs were evaluated zero-/few-shot while GNNs were trained on task splits; additionally, public benchmark graphs (like CORA) might already exist within the LLM pre-training corpus.
- Context Window & API Constraints: Cost and token limits prevented testing GPT-4 on full 70-class Reddit graph classifications and limited few-shot demonstrations to 2 examples per class.
- Future Directions: The authors emphasize exploring open-source LLM fine-tuning directly on graph topologies, designing better graph-serialization prompt structures, and evaluating LLMs on broader graph-theoretic tasks.
Summary updated