GraphICL: Unlocking Graph Learning Potential in LLMs through Structured Prompt Design
Yuanfu Sun, Zhengnan Ma, Yi Fang, Jing Ma, Qiaoyu Tan
TL;DR
This work tackles the challenge of evaluating graph reasoning capabilities of LLMs without training by introducing GraphICL, a comprehensive prompt-benchmark for Text-Attributed Graphs (TAGs). GraphICL employs a unified template with four components ($$anchor ext{-}node ext{ text}, task ext{ description}, structure ext{-}aware ext{ information}, demonstrations$$) to produce 55 prompts that encode graph structure and labeled cues for two core tasks: node classification and link prediction. Across 9 datasets and multiple LLMs (e.g., LLaMA variants and GPT-4o), GraphICL-enabled LLMs often exceed state-of-the-art supervised GNNs and graph LLMs in both in-domain and cross-domain settings, underscoring the power of prompt design to unlock graph reasoning without training. The results establish a strong baseline for graph LLM research and highlight the potential of in-context learning to advance practical graph understanding in large language models.
Abstract
The growing importance of textual and relational systems has driven interest in enhancing large language models (LLMs) for graph-structured data, particularly Text-Attributed Graphs (TAGs), where samples are represented by textual descriptions interconnected by edges. While research has largely focused on developing specialized graph LLMs through task-specific instruction tuning, a comprehensive benchmark for evaluating LLMs solely through prompt design remains surprisingly absent. Without such a carefully crafted evaluation benchmark, most if not all, tailored graph LLMs are compared against general LLMs using simplistic queries (e.g., zero-shot reasoning with LLaMA), which can potentially camouflage many advantages as well as unexpected predicaments of them. To achieve more general evaluations and unveil the true potential of LLMs for graph tasks, we introduce Graph In-context Learning (GraphICL) Benchmark, a comprehensive benchmark comprising novel prompt templates designed to capture graph structure and handle limited label knowledge. Our systematic evaluation shows that general-purpose LLMs equipped with our GraphICL outperform state-of-the-art specialized graph LLMs and graph neural network models in resource-constrained settings and out-of-domain tasks. These findings highlight the significant potential of prompt engineering to enhance LLM performance on graph learning tasks without training and offer a strong baseline for advancing research in graph LLMs.
