Graph-R1: Incentivizing the Zero-Shot Graph Learning Capability in LLMs via Explicit Reasoning

Yicong Wu, Guangyue Lu, Yuan Zuo, Huarong Zhang, Junjie Wu

Abstract

Generalizing to unseen graph tasks without task-specific supervision remains challenging. Graph Neural Networks (GNNs) are limited by fixed label spaces, while Large Language Models (LLMs) lack structural inductive biases. Recent advances in Large Reasoning Models (LRMs) provide a zero-shot alternative via explicit, long chain-of-thought reasoning. Inspired by this, we propose a GNN-free approach that reformulates graph tasks—node classification, link prediction, and graph classification—as textual reasoning problems solved by LRMs. We introduce the first datasets with detailed reasoning traces for these tasks and develop GRAPH-R1, a reinforcement learning framework that leverages task-specific rethink templates to guide reasoning over linearized graphs. Experiments demonstrate that GRAPH-R1 outperforms state-of-the-art baselines in zero-shot settings, producing interpretable and effective predictions. Our work highlights the promise of explicit reasoning for graph learning and provides new resources for future research.

Introduction

Traditional Graph Neural Networks (GNNs) are powerful but rigid; they are typically tied to fixed label spaces and struggle to generalize to entirely new domains without expensive fine-tuning. Conversely, standard Large Language Models (LLMs) possess immense general knowledge but lack the "structural inductive bias" needed to understand graph topology—they often fail to interpret structural relationships when a graph is simply flattened into text.

Existing attempts to bridge this gap usually involve hybrid models that plug GNN features into LLM token streams. However, these architectures often suffer from weak task conditioning and high computational overhead. GRAPH-R1 addresses this by ditching the GNN entirely, instead incentivizing an LLM to reason its way through a graph using pure text and explicit chain-of-thought processes.

The GRAPH-R1 Framework

GRAPH-R1 is built on a "reason-then-predict" paradigm that converts structural graph data into a format suitable for high-level textual reasoning. The framework follows a multi-stage pipeline designed to bridge the gap between graph topology and natural language processing.

Overview of the GRAPH-R1 pipeline, from subgraph extraction to explicit reasoning and final answer generation.

The process begins with Graph-to-Text Linearization, where subgraphs (typically h-hop neighborhoods) are converted into natural language descriptions, including node attributes and edge relations. This is followed by a two-phase training strategy:

  1. Joint Instruction Tuning: The model is trained on a newly curated dataset of 10,000 examples featuring explicit "reasoning traces" (Chain-of-Thought) that explain the logic behind each prediction.
  2. Reinforcement Learning (RL) with the "Rethink" Template: Using Group Relative Policy Optimization (GRPO), the model is fine-tuned with a structured template that forces it through four stages: <structure> (topology analysis), <semantic> (attribute interpretation), <comprehensive> (hypothesis generation), and <rethink> (critical re-evaluation).

Evaluation and Results

The researchers evaluated GRAPH-R1 across 11 representative datasets spanning citation networks, e-commerce, social media, knowledge graphs, and logical reasoning. To test "strict" zero-shot capabilities, the model was also evaluated on unseen molecular regression tasks (ESOL, Lipo, Freesolv).

Zero-shot performance comparison of GRAPH-R1 against state-of-the-art baselines across multiple graph tasks.

As shown in the experimental results, GRAPH-R1 achieved the best accuracy in 8 out of 10 settings, significantly outperforming specialized baselines like GOFA and UniGraph. Notably, on the Cora-Link prediction task, GRAPH-R1 reached 86.31% accuracy, nearly doubling the performance of its base model (Llama2-7B at 48.15%). Furthermore, the 14B parameter GRAPH-R1 matched or exceeded the performance of the massive DeepSeek-R1-671B on several benchmarks, suggesting that task-specific reasoning incentives can be more effective than raw model scale.

Key Insights

  • Reasoning as Inductive Bias: Explicit reasoning traces act as a functional substitute for the hard-coded priors in GNNs. By justifying every step, the model learns to "see" the graph structure within the text.
  • The Power of Self-Correction: The "Rethink" phase is crucial for stability and accuracy. Structuring the reasoning process into a multi-phase internal debate allows the model to excel at structure-heavy tasks like link prediction.
  • GNN-Free Viability: The results prove that specialized geometric architectures are not strictly necessary for graph problems if the underlying reasoning engine is sufficiently incentivized to handle structural data.

Conclusion and Future Work

While GRAPH-R1 demonstrates the power of explicit reasoning, challenges remain. Linearizing graphs is token-intensive, which may limit scalability for very dense or large-scale graphs. Additionally, generating long reasoning traces increases inference latency compared to standard GNN forward passes. Future research will focus on distilling these reasoning capabilities into more compact models and exploring more efficient graph encoding methods to handle larger context windows.

Summary updated

BibTeX
@misc{wu2025graph,
  author = {Yicong Wu and Guangyue Lu and Yuan Zuo and Huarong Zhang and Junjie Wu},
  title = {{Graph-R1: Incentivizing the Zero-Shot Graph Learning Capability in LLMs via Explicit Reasoning}},
  year = {2025},
  eprint = {2508.17387},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.17387},
}
Figure