Abstract
Graph Data Augmentation (GDA) is critical for improving Graph Neural Network (GNN) performance on sparse or noisy data. While recent methods leverage Large Language Models (LLMs) for knowledge injection, they often require "white-box" access to internal embeddings or produce over-connected, noisy graphs. We present DemoGraph, a novel framework that utilizes black-box LLMs to generate context-aware Knowledge Graphs (KGs). By employing granularity-aware prompting and recursive refinement, DemoGraph extracts structured triples that are stochastically merged into the original graph during training. Our approach achieves significant performance gains across diverse benchmarks, particularly in healthcare, without requiring internal LLM access.
Introduction
Graph Neural Networks (GNNs) are powerful tools for modeling relational data, yet their efficacy is frequently hampered by the inherent sparsity and noise of real-world datasets. Traditional Graph Data Augmentation (GDA) techniques, such as edge dropping or node masking, focus primarily on structural perturbations while neglecting the semantic context of the data.
Recent advancements have turned to Large Language Models (LLMs) to bridge this gap by injecting open-world knowledge. However, existing LLM-based GDA methods typically operate as "white-box" systems, necessitating access to latent embeddings or model weights. This limits their utility with state-of-the-art closed-source models like GPT-4. Furthermore, naive LLM-driven augmentation can lead to "graph hairballs"—noisy, over-connected structures that obscure meaningful patterns. DemoGraph addresses these challenges by treating the LLM as a black-box generator of structured, pruned Knowledge Graphs.
Methodology: The DemoGraph Framework
DemoGraph introduces a three-stage pipeline designed to democratize LLM-based augmentation through structured knowledge retrieval.
1. Context-Driven Knowledge Retrieval
Instead of extracting vector embeddings, DemoGraph utilizes text-based prompting. It feeds dataset metadata—such as node labels and summaries—into the LLM to generate a Knowledge Graph (KG) composed of triples (e.g., 'division' → 'requires' → 'anesthesia').
2. Granularity Selection and Concept Pruning
To maintain graph sparsity and relevance, DemoGraph employs granularity-aware prompting at the dataset, node-type, or individual node levels. A recursive refinement process, akin to instruction fine-tuning, prompts the LLM to review its own output and prune uninformative or redundant concepts (e.g., "is", "dataset").
3. Dynamic Graph Merging
A key innovation is the stochastic merging of the generated KG with the original graph $\mathcal{G}_0$. Rather than a one-time static augmentation, DemoGraph samples connections from the KG at each training epoch. This dynamic approach acts as a regularizer, preventing the GNN from overfitting to a single augmented structure and improving generalization.
Experimental Evaluation
We evaluated DemoGraph across a spectrum of domains, including citation networks (Cora, Citeseer), protein interactions (PPI), and large-scale benchmarks (OGBN-products, OGBN-arxiv). A particular focus was placed on healthcare using the MIMIC-III Electronic Health Record dataset.
Key Results and Performance
- General Benchmarks: DemoGraph achieved an average 3% improvement over traditional GDA methods across standard GNN architectures like GCN, GAT, and GraphSAGE.
- Healthcare Dominance: In clinical tasks such as length-of-stay prediction on MIMIC-III, DemoGraph outperformed competitors by 7.4% in accuracy.
- Scalability: Unlike traditional methods that often suffer from Out-Of-Memory (OOM) errors on large graphs, DemoGraph's modular KG generation scales effectively to massive datasets.
As shown in the visualization above, DemoGraph successfully identifies and prioritizes relevant medical concepts—such as "Anticoagulants" and "Arterial Blood Gases"—to inform its predictions, enhancing both accuracy and model interpretability.
Conclusion and Future Work
DemoGraph demonstrates that high-performance graph augmentation does not require white-box LLM access. By focusing on structured knowledge retrieval and dynamic merging, the framework provides a scalable, model-agnostic solution for enriching graph data.
Current limitations include the computational latency of querying LLMs, which necessitates offline KG generation. Future research will explore real-time LLM adaptation during GNN training, potentially through simultaneous instruction fine-tuning, to create even more responsive and domain-integrated latent knowledge graphs.
Summary updated