H2GFM: Towards unifying Homogeneity and Heterogeneity on Text-Attributed Graphs

Trung-Kien Nguyen, Heng Ping, Shixuan Li, Peiyu Zhang, Nikos Kanakaris, Nicholas A. Kotov, Paul BogdanarXiv 2025 · DOI

Abstract

H2GFM is a novel framework for Graph Foundation Models (GFMs) designed to bridge the gap between homogeneous and heterogeneous text-attributed graphs (TAGs). By integrating Large Language Model (LLM)-based text encoding with a mixture of context-adaptive graph transformers, H2GFM achieves state-of-the-art performance in both zero-shot and fine-tuning scenarios across diverse domains.

Introduction

Graph Foundation Models aim to serve as general-purpose tools for graph learning, capable of generalizing to unseen graphs and tasks. To address varying feature dimensions across datasets, researchers utilize Text-Attributed Graphs (TAGs), where nodes and edges are described in natural language and encoded by LLMs.

However, most existing GFMs are limited to homogeneous graphs (single node/edge type). Real-world data is frequently heterogeneous, such as academic networks with "Author," "Paper," and "Venue" nodes. Current models often struggle with these diverse schemas, either ignoring type information or relying on dataset-specific architectures. H2GFM addresses this by creating a single, unified model for both graph types.

Methods

The H2GFM architecture incorporates three primary innovations to enable cross-schema generalization:

  1. Unified Textual Meta-Relations: Instead of discrete categories, node and edge types are converted into text templates (e.g., "A paper is written by an author"). These are encoded into a unified vector space using Sentence-BERT, allowing the model to understand relationships across different datasets without a fixed schema.
  2. Context-Adaptive Graph Transformer (CGT): To move beyond standard GNNs that treat neighbors uniformly, CGT employs Feature-wise Linear Modulation (FiLM). This adjusts information flow based on the specific "meta-path" connecting nodes, capturing higher-order semantic relationships.
  3. Mixture of Experts (MoE): Recognizing that different graphs (e.g., citation vs. e-commerce) have distinct structural patterns, H2GFM uses a "Mixture of CGT Experts." A gating network dynamically selects the optimal experts for a node's local neighborhood.
The H2GFM framework: (a) Dataset processing, (b) Context graph sampling and encoding, (c) Mixture of CGT experts, and (d) Task prediction.

Experimental Setup

The model was evaluated on 12 datasets spanning two categories:

  • Homogeneous (HoTAG): Arxiv, DBLP, Products, History, CiteSeer, Pubmed, WikiCS, and Child.
  • Heterogeneous (HeTAG): He_Arxiv, He_CroVal, He_TMDB, and He_DBLP.

These datasets cover domains such as academic citations, e-commerce, biology, and movie collaborations.

Key Results

H2GFM demonstrates superior performance across various learning settings:

  • Co-training Performance: When trained on multiple graphs simultaneously, H2GFM consistently outperformed baselines like OFA and AnyGraph. For instance, it achieved a 10.72% improvement in node classification on the Arxiv dataset.
  • Zero-Shot Generalization: The model's most significant achievement is its zero-shot performance on unseen datasets (Cross-train setting). On the WikiCS dataset, H2GFM reached a 379% improvement in accuracy over the runner-up baseline, highlighting its ability to learn transferable graph patterns.
  • Efficiency: Despite its performance, H2GFM uses a relatively efficient 16M parameter GNN-based approach, outperforming much larger LLM-based models while maintaining linear training time scalability relative to node count.
Performance comparison in the Cross-train (zero-shot) setting for Node Classification (NC) and Link Prediction (LP).

Discussion and Limitations

By treating text as a universal interface for both features and relationships, H2GFM bypasses the traditional schema-matching problem. The MoE architecture allows the model to adapt its mathematical strategy to the specific structural patterns of a graph, whether it exhibits simple homophily or complex heterogeneity.

Currently, the framework focuses on node-level and edge-level tasks. Future work may extend this to graph-level classification and incorporate geometric information to better serve scientific domains like molecular biology or materials science.

Summary updated

BibTeX
@misc{nguyen2025h,
  author = {Trung-Kien Nguyen and Heng Ping and Shixuan Li and Peiyu Zhang and Nikos Kanakaris and Nicholas A. Kotov and Paul Bogdan},
  title = {{H2GFM: Towards unifying Homogeneity and Heterogeneity on Text-Attributed Graphs}},
  year = {2025},
  eprint = {2506.08298},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.08298},
}
Figure