Task-Oriented GNNs Training on Large Knowledge Graphs for Accurate and Efficient Modeling

Hussein Abdallah, Waleed Afandi, Panos Kalnis, Essam Mansour · DOI

Introduction

Training Heterogeneous Graph Neural Networks (HGNNs) on massive Knowledge Graphs (KGs) has traditionally been a computational bottleneck. As KGs like Wikidata or the Microsoft Academic Graph (MAG) grow to billions of triples, the sheer volume of data often obscures the specific signals needed for downstream tasks. This paper introduces KG-TOSA, an automated approach for extracting task-oriented subgraphs (TOSGs). By filtering out irrelevant "noise" nodes and edges, KG-TOSA reduces training time and memory usage by up to 70% while simultaneously improving model accuracy.

The Challenge of Massive KGs

Knowledge Graphs are characterized by a high diversity of entity and relation types. When a researcher aims to train a GNN for a specific task—such as predicting a research paper’s venue—the vast majority of the graph's facts are irrelevant.

Current practices generally fall into three categories, each with significant drawbacks:

  1. Full Graph Training: This approach is computationally exhaustive, leading to massive memory consumption and prohibitive training times.
  2. Manual Subgraph Extraction: Hand-carving a relevant subgraph requires deep domain expertise and is a slow, non-scalable process.
  3. Standard Sampling Methods: Techniques like uniform random walks often fail to capture critical task-related nodes or include too many disconnected components. This frequently results in "over-smoothing," where node embeddings become indistinguishable, degrading predictive performance.

KG-TOSA addresses these issues by automating the extraction of a Task-Oriented Subgraph (TOSG) that is compact enough for efficiency but rich enough to preserve or enhance the model's predictive power.

Visual representation of task-oriented subgraphs extracted from different large-scale knowledge graphs, showing varying levels of connectivity and density.

The KG-TOSA Methodology

KG-TOSA (Knowledge Graph Task-Oriented Sampling) utilizes a generic graph pattern to capture both local context and global structure relevant to a specific target. The authors propose three distinct algorithms for subgraph extraction:

  • Biased Random Walk (BRW): This method biases the walk toward regions centered around target vertices, ensuring that the resulting subgraph has sufficient data density for the task.
  • Influence-Based Sampling (IBS): Leveraging Personalized PageRank (PPR) scores, IBS identifies and retains only the most "influential" neighbors for a specific task, effectively pruning noise.
  • SPARQL-based Extraction: Perhaps the most innovative contribution, this method offloads the extraction work to an RDF engine. By utilizing SPARQL queries, it leverages the database's built-in indices to extract the TOSG with almost zero preprocessing overhead, avoiding the need to migrate the entire KG to a training environment.

Benchmarking on Large-Scale KGs

To evaluate KG-TOSA, the authors developed a comprehensive benchmark using large-scale real-world KGs that exceed the complexity of standard OGB benchmarks:

  • MAG-42M: 42.4 million nodes and 166 million triples (Academic domain).
  • YAGO-30M: 30.7 million nodes and 400 million triples (General facts).
  • DBLP-15M: 15.6 million nodes and 252 million triples (Computer science bibliography).

These datasets feature hundreds of node and edge types, providing a rigorous environment for testing HGNNs.

Key Results and Insights

The experimental evaluation across six state-of-the-art GNN methods, including ShaDowSAINT and SeHGNN, yielded several key insights:

  • Efficiency Gains: KG-TOSA reduced training time and memory usage by up to 70% in most scenarios. In extreme cases, such as link prediction on DBLP, memory requirements plummeted from 330GB to just 11GB—a 98% reduction.
  • Improved Accuracy: Counter-intuitively, training on less data often led to better results. For instance, on the MAG Paper-Venue task, accuracy increased from 74% on the full graph to 81% using KG-TOSA. This is attributed to the removal of irrelevant nodes that otherwise introduce noise and lead to over-smoothing.
  • Operational Benefits: The resulting models were up to 34x smaller and achieved inference speeds up to 40x faster. Furthermore, models trained on TOSGs converged more quickly due to a higher signal-to-noise ratio.
Comparison of Accuracy, Training Time, and Memory usage across different models and datasets, highlighting the advantages of KG-TOSA.

Conclusion

KG-TOSA demonstrates that "more data" is not always synonymous with "better models" in the context of large-scale Knowledge Graphs. By focusing on task-relevant subgraphs and leveraging the indexing power of RDF engines, researchers can achieve significant gains in both efficiency and accuracy. Future work will look toward automated parameter tuning and the creation of multi-task TOSGs to further streamline the GNN training pipeline.

Summary updated

BibTeX
@inproceedings{abdallah2024task,
  author = {Hussein Abdallah and Waleed Afandi and Panos Kalnis and Essam Mansour},
  title = {{Task-Oriented GNNs Training on Large Knowledge Graphs for Accurate and Efficient Modeling}},
  booktitle = {ICDE},
  year = {2024},
  url = {https://openreview.net/forum?id=1cdX6ohlkV},
}
Figure