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 the 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. The resulting NPG-Muse-series models exhibit substantially enhanced Long CoT reasoning capabilities, achieving consistent gains across mathematics, coding, logical, and graph reasoning benchmarks. NPG-Muse-7B even 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 LLM post-training.
Introduction: The Scalability Bottleneck
The recent success of models like OpenAI’s o1 and DeepSeek-R1 has highlighted the power of Long Chain-of-Thought (Long CoT)—the ability of a model to "think" via extensive exploration, reflection, and self-correction before answering. However, developing these behaviors typically requires high-quality, human-curated datasets in domains like mathematics and programming. These datasets are expensive, difficult to scale, and often limited in scope. NPG-Muse addresses this gap by identifying a training corpus that is synthetically scalable yet inherently complex enough to force models into deep reasoning patterns.
NPH Graphs: A Synthetic Reasoning Gym
The authors propose treating NP-Hard (NPH) graph problems as a "reasoning gym." Because NPH problems have exponential worst-case complexity, they cannot be solved by simple heuristics. They naturally elicit behaviors like topological analysis, case decomposition, and backtracking—the core pillars of Long CoT. The framework focuses on three classic problems: Traveling Salesman Problem (TSP), Graph Edit Distance (GED), and Maximum Clique Problem (MCP).
The NPG-Muse Training Pipeline
The training follows a two-stage pipeline designed to first instill reasoning depth and then optimize for efficiency:
- Long-CoT Supervised Fine-Tuning (SFT): A teacher model (QwQ-32B) generates reasoning traces for small-scale NPH problems. Rejection sampling is applied to keep only the traces that are well-structured, logically feasible, and result in the correct answer.
- Reinforcement Learning (RL): To address the "overthinking" and redundancy often seen after SFT, the authors use Group Relative Policy Optimization (GRPO) with a fine-grained reward function. This includes a repetition penalty based on suffix-tree algorithms, a solution quality reward for suboptimal but close-to-global-optimum answers, and a format reward to ensure adherence to the
<think>...</think>structure.
Empirical Results and Generalization
NPG-Muse-7B (based on Qwen2.5) outperformed its teacher model, QwQ-32B, on NPH graph problems in both accuracy and efficiency, using 49% fewer tokens on average. Perhaps the most striking insight is the "cross-domain" transfer: training on graphs significantly improved performance on mathematics (AIME), coding (CRUX), and logic (Zebra-grid) benchmarks.
For instance, NPG-Muse-8B showed a massive jump in MATH-500 accuracy, rising from 64.5% to 85.5%. On the challenging AIME24 benchmark, it improved from 11.5% to 23.6%. This suggests the model is learning meta-reasoning strategies—such as verification and backtracking—rather than just memorizing graph patterns.
Conclusion
NPG-Muse demonstrates that NP-Hard graph problems are a highly effective, synthetically scalable alternative to human-curated data for training reasoning LLMs. By leveraging the algorithmic verifiability and inherent complexity of graphs, the framework successfully scales Long CoT capabilities, positioning NPH problems as a vital resource for the future of LLM post-training.
Summary updated