GraphGen: Enhancing Supervised Fine-Tuning for LLMs with Knowledge-Driven Synthetic Data Generation

Zihong Chen, Wanli Jiang, Jinzhe Li, Zhonghang Yuan, Huanjun Kong, Wanli Ouyang, Nanqing DongarXiv 2025 · DOI

Abstract

Supervised Fine-Tuning (SFT) is a critical step in adapting Large Language Models (LLMs) to specialized domains, yet the scarcity of high-quality, human-annotated data remains a significant bottleneck. While synthetic data generation offers a scalable alternative, it often suffers from factual inaccuracies, a lack of structural complexity, and a failure to address the model's specific knowledge gaps. We present GraphGen, a framework that leverages Knowledge Graphs (KGs) to systematically generate targeted synthetic data. By assessing the "comprehension loss" of a trainee model on KG-derived facts, GraphGen prioritizes the generation of data for identified "blind spots." Our evaluation across agricultural, medical, and multi-hop reasoning domains demonstrates that GraphGen consistently outperforms state-of-the-art synthetic data baselines, producing more diverse and effective training sets.

Introduction

The efficacy of Supervised Fine-Tuning (SFT) is heavily dependent on the quality and diversity of the training data. In specialized fields like medicine or agriculture, obtaining expert-labeled data is prohibitively expensive. Consequently, researchers have turned to LLM-based synthetic data generation. However, existing pipelines face four major hurdles: factual hallucinations, neglect of long-tail knowledge, simplistic single-fact structures, and data homogenization. GraphGen addresses these by grounding the generation process in structured Knowledge Graphs and employing a model-aware selection strategy.

The GraphGen Framework

GraphGen operates through a four-stage pipeline designed to move from raw text to targeted, complex QA pairs.

The GraphGen pipeline consists of four stages: Knowledge Construction, Comprehension Assessment, Graph Organization, and QA Generation.
  1. Knowledge Construction: Entities and relationships are extracted from source documents to build a fine-grained Knowledge Graph.
  2. Comprehension Assessment: This stage identifies the "knowledge blind spots" of the target LLM. KG triples are converted into binary statements. The model's Expected Calibration Error (ECE) is measured; facts where the model is incorrect or uncertain are assigned a high "Comprehension Loss."
  3. Graph Organization: Instead of random sampling, GraphGen uses a max_loss strategy to select subgraphs containing high-loss facts. This ensures the fine-tuning data is tailored to what the model does not yet know.
  4. QA Generation: A high-capability Synthesizer LLM transforms these subgraphs into three distinct types of questions: Atomic (single-fact), Aggregated (summarizing multiple entities), and Multi-hop (requiring reasoning across links).

Experimental Results

We evaluated GraphGen against several baselines, including WRAP, Genie, and EntiGraph, across three datasets: SeedEval (Agriculture), PQArefEval (Medicine), and HotpotEval (Multi-hop reasoning).

Performance comparison of GraphGen against baselines across SeedEval, PQArefEval, and HotpotEval benchmarks.

As shown in Figure 3, GraphGen consistently achieves the highest scores across all benchmarks. Notably, on the medical PQArefEval dataset, it outperformed the best baseline by 2.7 points (ROUGE-F), and on the multi-hop HotpotEval task, it led by 4.73 points. These results underscore the effectiveness of using structured KGs to guide the synthesis of complex reasoning tasks.

Analysis and Insights

A key finding of this work is the efficiency of training on "ignorance." By focusing on the "tail" of the data distribution—facts the model fails to comprehend—GraphGen achieves superior performance with a fraction of the data required by traditional methods. Furthermore, the use of KGs acts as a factual guardrail, significantly reducing hallucinations in the synthetic output. Lexical diversity analysis (MTLD) also revealed that GraphGen's data is substantially more diverse than its competitors, likely due to the varied structural patterns inherent in the sampled subgraphs.

Conclusion

GraphGen represents a significant step forward in model-aware synthetic data generation. By combining the structural rigor of Knowledge Graphs with a targeted assessment of model comprehension, it provides a scalable way to inject specialized knowledge into LLMs. Future work will explore scaling this framework to broader domains and investigating dynamic KG updates to support continuous learning.

Summary updated

BibTeX
@misc{chen2025graphgen,
  author = {Zihong Chen and Wanli Jiang and Jinzhe Li and Zhonghang Yuan and Huanjun Kong and Wanli Ouyang and Nanqing Dong},
  title = {{GraphGen: Enhancing Supervised Fine-Tuning for LLMs with Knowledge-Driven Synthetic Data Generation}},
  year = {2025},
  eprint = {2505.20416},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.20416},
}
Figure