Graph-R1: Unleashing LLM Reasoning with NP-Hard Graph Problems

๐Ÿ“… 2025-08-27
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
To address the scalability challenges in training long-chain-of-thought (Long CoT) reasoning capabilities for large language models (LLMs) and the high cost of high-quality human-annotated data, this work introduces a synthetic data generation method grounded in NP-hard graph problems and a two-stage post-training framework. It is the first to leverage NP-hard graph problems as controllable, diverse, and infinitely scalable reasoning corpora, augmented by deep-reasoning guidance and reflective mechanisms to elicit extended reasoning chains. A fine-grained reward function is further designed, enabling joint optimization of reasoning path quality and efficiency via rejection-samplingโ€“driven supervised fine-tuning and reinforcement learning. The resulting Graph-R1-7B model demonstrates strong generalization across mathematical, programming, STEM, and logical reasoning benchmarks, and notably outperforms QwQ-32B in both accuracy and inference efficiency on NP-hard graph problem solving.

Technology Category

Application Category

๐Ÿ“ Abstract
Reasoning Large Language Models (RLLMs) have recently achieved remarkable progress on complex reasoning tasks, largely enabled by their long chain-of-thought (Long CoT) capabilities. However, developing these Long CoT behaviors relies heavily on post-training with high-quality datasets, which are typically costly and human-curated (e.g., mathematics and code), leaving scalable alternatives unexplored. In this work, we introduce NP-hard (NPH) graph problems as a novel synthetic training corpus, as they inherently require deep reasoning, extensive exploration, and reflective strategies, which are core characteristics of Long CoT reasoning. Building on this insight, we develop a two-stage post-training framework: (i) Long CoT Supervised Fine-Tuning (SFT) on rejection-sampled NPH graph instances, which substantially enhances reasoning depth, and (ii) Reinforcement Learning (RL) with a fine-grained reward design, which sharpens reasoning efficiency. Our flagship model, Graph-R1-7B, demonstrates strong generalization across mathematics, coding, STEM, and logic, and surpasses QwQ-32B on NPH graph problems in both accuracy and reasoning efficiency. These results position NPH graph problems as an effective and scalable resource for advancing Long CoT reasoning in LLMs, opening a new frontier for LLM post-training. Our implementation is available at https://github.com/Graph-Reasoner/Graph-R1, with models and datasets hosted in our Hugging Face collection HKUST-DSAIL/Graph-R1.
Problem

Research questions and friction points this paper is trying to address.

Developing scalable alternatives to costly human-curated reasoning datasets
Enhancing LLM reasoning depth and efficiency through graph problems
Creating synthetic training corpus for long chain-of-thought capabilities
Innovation

Methods, ideas, or system contributions that make the work stand out.

Synthetic NP-hard graph problems for scalable training
Two-stage fine-tuning with SFT and reinforcement learning
Fine-grained reward design to enhance reasoning efficiency
๐Ÿ”Ž Similar Papers
No similar papers found.
Y
Yuyao Wang
Hong Kong University of Science and Technology (Guangzhou)
Bowen Liu
Bowen Liu
Andreessen Horowitz, insitro, Stanford
Computational ChemistryDrug DiscoveryGraph Machine Learning
Jianheng Tang
Jianheng Tang
Hong Kong University of Science and Technology
Graph Data MiningNatural Language ProcessingAnomaly Detection
N
Nuo Chen
Hong Kong University of Science and Technology (Guangzhou)
Y
Yuhan Li
Hong Kong University of Science and Technology (Guangzhou)
Q
Qifan Zhang
Hong Kong University of Science and Technology (Guangzhou)
J
Jia Li
Hong Kong University of Science and Technology (Guangzhou)