G1: Teaching LLMs to Reason on Graphs with Reinforcement Learning
Xiaojun Guo, Ang Li, Yifei Wang, Stefanie Jegelka, Yisen Wang

TL;DR
This paper introduces G1, a reinforcement learning approach on synthetic graph tasks that significantly enhances large language models' ability to reason about graphs, outperforming larger models and generalizing well to unseen tasks.
Contribution
Proposes G1, a novel RL-based training method on a large synthetic graph dataset, to improve LLMs' graph reasoning capabilities beyond previous methods.
Findings
G1 finetuned 3B model outperforms Qwen2.5-72B-Instruct.
RL-trained models generalize to unseen graph tasks and real-world data.
Synthetic RL training significantly boosts graph reasoning in LLMs.
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\~os, 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\~os, G1 obtains substantial improvements in graph reasoning,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
- 🤗PKU-ML/G1-3Bmodel· 211 dl· ♡ 1211 dl♡ 1
- 🤗PKU-ML/G1-7Bmodel· 10 dl· ♡ 210 dl♡ 2
- 🤗PKU-ML/G1-Zero-3Bmodel· 54 dl54 dl
- 🤗PKU-ML/G1-Zero-7Bmodel· 3 dl3 dl
- 🤗PKU-ML/G1-Direct-SFT-7Bmodel· 2 dl2 dl
- 🤗PKU-ML/G1-CoT-SFT-7Bmodel· 2 dl2 dl
- 🤗PKU-ML/G1-Direct-SFT-3Bmodel· 31 dl31 dl
- 🤗PKU-ML/G1-CoT-SFT-3Bmodel· 33 dl33 dl
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Semantic Web and Ontologies · Artificial Intelligence in Law
