G1: Teaching LLMs to Reason on Graphs with Reinforcement Learning
Xiaojun Guo, Ang Li, Yifei Wang, Stefanie Jegelka, Yisen Wang
Abstract
Although Large Language Models (LLMs) have demonstrated remarkable progress, their proficiency in graph-related tasks remains notably limited, hindering the development of truly general-purpose models. Previous attempts, including pretraining graph foundation models or employing supervised fine-tuning, often face challenges such as the scarcity of large-scale, universally represented graph data. We introduce G1, a simple yet effective approach demonstrating that Reinforcement Learning (RL) on synthetic graph-theoretic tasks can significantly scale LLMs'graph reasoning abilities. To enable RL training, we curate Erdõs, the largest graph reasoning dataset to date comprising 50 diverse graph-theoretic tasks of varying difficulty levels, 100k training data and 5k test data, all drived from real-world graphs. With RL on Erdõs, G1 obtains substantial improvements in graph reasoning, where our finetuned 3B model even outperforms Qwen2.5-72B-Instruct (24x size). RL-trained models also show strong zero-shot generalization to unseen tasks, domains, and graph encoding schemes, including other graph-theoretic benchmarks as well as real-world node classification and link prediction tasks, without compromising general reasoning abilities. Our findings offer an efficient, scalable path for building strong graph reasoners by finetuning LLMs with RL on graph-theoretic tasks, which combines the strengths of pretrained LLM capabilities with abundant, automatically generated synthetic data, suggesting that LLMs possess graph understanding abilities that RL can elicit successfully. Our implementation is open-sourced at https://github.com/PKU-ML/G1, with models and datasets hosted on Hugging Face collections https://huggingface.co/collections/PKU-ML/g1-683d659e992794fc99618cf2 for broader accessibility.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
6 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- GraphScout: Empowering Large Language Models with Intrinsic Exploration Ability for Agentic Graph Reasoning cites Can Language Models Solve Graph Problems in Natural Language?
- Finding and Reactivating Post-Trained LLMs' Hidden Safety Mechanisms cites Let's Verify Step by Step
- Finding and Reactivating Post-Trained LLMs' Hidden Safety Mechanisms cites Efficient Memory Management for Large Language Model Serving with PagedAttention
- GRASP: Graph Reasoning via Agentic Solving and Probing of LLMs cites Can Language Models Solve Graph Problems in Natural Language?
- Can Language Models Solve Graph Problems in Natural Language? cites Language Models are Few-Shot Learners
- Can Language Models Solve Graph Problems in Natural Language? cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Towards Next Graph Token Prediction: Discrete Graph Tokenization for Structural Reasoning in Large Language Models cites Can Language Models Solve Graph Problems in Natural Language?
- Towards Next Graph Token Prediction: Discrete Graph Tokenization for Structural Reasoning in Large Language Models cites Language Models are Few-Shot Learners
- Let's Verify Step by Step cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Efficient Memory Management for Large Language Model Serving with PagedAttention cites Language Models are Few-Shot Learners
Cited by top-tier papers6
- Benefits and Pitfalls of Reinforcement Learning for Language Model Planning: A Theoretical PerspectiveSiwei Wang, Yifei Shen, Haoran Sun, Shi Feng et al.ICLR 2026 · 7 citations
- Finding and Reactivating Post-Trained LLMs' Hidden Safety MechanismsMingjie Li, Wai Man Si, Michael Backes, Yang Zhang et al.NeurIPS 2025 · 4 citations
- GraphScout: Empowering Large Language Models with Intrinsic Exploration Ability for Agentic Graph ReasoningYuchen Ying, Weiqi Jiang, Tongya Zheng, Yu Wang et al.KDD 2026 · 2 citations
- GRASP: Graph Reasoning via Agentic Solving and Probing of LLMsXiaojun Guo, Mingxue Tian, Chenheng Zhang, Xiaohan Wang et al.ICML 2026
- Towards Next Graph Token Prediction: Discrete Graph Tokenization for Structural Reasoning in Large Language ModelsZhonghao Wang, Yugang Ji, Zhuonan Zheng, Sheng Zhou et al.KDD 2026
Builds on20
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Let's Verify Step by StepHunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards et al.ICLR 2024 · 3,045 citations
- Efficient Memory Management for Large Language Model Serving with PagedAttentionWoosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng et al.SOSP 2023 · 1,016 citations
- Can Language Models Solve Graph Problems in Natural Language?Heng Wang, Shangbin Feng, Tianxing He, Zhaoxuan Tan et al.NeurIPS 2023 · 420 citations
Related papers
- Evaluating LLMs on Large-Scale Graph Property Estimation via Random WalksSunil Kumar Maurya, Xin LiuACL 2026
- Graph-R1: Incentivizing the Zero-Shot Graph Learning Capability in LLMs via Explicit ReasoningYicong Wu, Guangyue Lu, Yuan Zuo, Huarong Zhang et al.EMNLP 2025
- Zero-shot Graph Reasoning via Retrieval Augmented Framework with LLMsHanqing Li, Sharika Mahadevan, Kiran Sheena Jyothi, Henry Liang et al.EMNLP Findings 2025
- Rewarding Graph Reasoning Process makes LLMs more Generalized ReasonersMiao Peng, Nuo Chen, Zongrui Suo, Jia LiKDD 2025 · 1 citation
- SynLogic: Synthesizing Verifiable Reasoning Data at Scale for Learning Logical Reasoning and BeyondJunteng Liu, Yuanxiang Fan, Zhuo Jiang, Han Ding et al.NeurIPS 2025 · 49 citations
