MUG: Meta-path-aware Universal Heterogeneous Graph Pre-Training

Lianze Shan, Jitao Zhao, Dongxiao He, Yongqi Huang, Zhiyong Feng, Weixiong Zhang

TL;DR

MUG (Meta-path-aware Universal Heterogeneous Graph Pre-Training) is the first framework to achieve universal graph pre-training on heterogeneous graphs without relying on Large Language Models (LLMs). By unifying diverse node attributes and leveraging shared structural homophily, MUG allows a single encoder to generalize to entirely unseen graph schemas and datasets in a zero-shot or few-shot manner.

What Problem Does This Paper Address?

Universal Graph Pre-training (UGP) has become a powerful paradigm for training graph neural networks that can generalize across different datasets and tasks. However, existing UGP techniques are almost exclusively designed for homogeneous graphs (which contain only a single type of node and edge).

Real-world data is rarely that simple. Networks like citation databases or recommendation systems are heterogeneous, containing multiple node types (e.g., papers, authors, venues) and relation types (e.g., writes, published in). Training a single universal encoder for these graphs is incredibly difficult because:

  1. Mismatched Input Spaces: Different datasets have completely different node types, relation types, and attribute dimensions.
  2. Dataset-Specific Schemas: Traditional heterogeneous graph models rely on custom aggregation strategies (like attention weights) tailored to a specific dataset's schema, making them fail when transferred to an unseen graph.

While some recent methods use LLMs to translate node attributes into text descriptions to bypass this, they fall short when dealing with sparse or non-textual attributes. MUG addresses this gap by creating an LLM-free architecture capable of handling diverse heterogeneous graph structures out of the box.

Methods

MUG breaks down the universal pre-training problem into two main phases: Heterogeneous Input Unification and Heterogeneous Information Transfer.

Figure 2: Overview of the MUG. Given a heterogeneous graph with diverse node types, relation types, and attributes, we first get embedding Zstruct by contextual structural encoding. The embedding is concatenated with the original node attributes X to obtain unified representation ˜X, which contains diverse type and attribute information. Then, a dimension-aware encoder is applied to align representation spaces and produce the unified input Xunify. Finally, a shared GNN encoder is used to encode each masked adjacency matrix ˜Aϕ with the unified input Xunify, producing Zϕ. The model is optimized by three objectives: a dimension alignment loss Lalign, a meta-path masked reconstruction loss Lϕ and a global scattering regularization loss Lscatter.

1. Heterogeneous Input Unification

To handle different node and relation types across datasets, MUG avoids encoding type identities directly. Instead, it uses Contextual Structural Encoding (CSE). By running meta-path-guided random walks and applying a skip-gram model, MUG learns structural embeddings ($\mathbf{Z}^{\text{struct}}$) based purely on how nodes interact. These are concatenated with the original node attributes.

Next, a Dimension-Aware Alignment module treats each attribute dimension as an independent semantic unit, projecting them into a unified representation space ($\mathbf{X}^{\text{unify}}$) using a learnable semantic basis matrix and a mean-centering loss ($\mathcal{L}_{\text{align}}$).

2. Heterogeneous Information Transfer

Once the inputs are unified, MUG utilizes a single shared GNN encoder across different meta-path views. It employs a masked autoencoder strategy—masking edges in the meta-path adjacency matrices and forcing the model to reconstruct them ($\mathcal{L}_{\phi}$).

Crucially, to prevent the model from overfitting to a specific dataset's layout, MUG introduces a Global Scattering Regularization Loss ($\mathcal{L}_{\text{scatter}}$). This pushes node embeddings away from the global mean in the representation space, maximizing their discriminability without relying on dataset-specific labels.

Datasets

The authors evaluated MUG across four widely used heterogeneous graph benchmarks:

  • ACM: Nodes include papers, authors, and subjects.
  • DBLP: Nodes include authors, papers, conferences, and terms.
  • AMiner: Nodes include papers, authors, and references.
  • Freebase: Nodes include movies, actors, directors, and writers.

Key Insights and Ideas

  • The Homophily Discovery: The foundational justification for MUG comes from a motivational experiment analyzing homophily (the tendency of similar nodes to connect). As shown in Figure 1, the authors discovered that meta-path-based views in heterogeneous graphs exhibit high homophily ratios (62% to 92%), which are highly comparable to standard homogeneous graphs like Cora and CiteSeer. This insight justifies using a single, shared GNN encoder across diverse meta-path views.
Figure 1: Homophily ratios on six datasets. Cora and Cite- Seer (Yang, Cohen, and Salakhudinov 2016) are homoge- neous graphs, while ACM (Zhao et al. 2020), DBLP (Fu et al. 2020), AMiner (Hu, Fang, and Shi 2019) and Free- base (Li et al. 2021a) are heterogeneous. For heterogeneous graphs, we compute the homophily ratio for each meta-path- based adjacency matrix and report the average.
  • Structure Over Labels: By focusing on the contextual structure of how nodes relate rather than the literal text labels of the node types, the model extracts purely structural patterns that easily transfer across domains (e.g., from co-authorship patterns in ACM to co-acting patterns in Freebase).

Key Results

MUG was tested in cross-domain scenarios where it was trained on one dataset and evaluated on the others with frozen parameters.

  • Superior Cross-Domain Performance: MUG consistently outperformed strong self-supervised baselines like HeCo, HGMAE, and HERO. For example, when trained on ACM and evaluated on the AMiner dataset, MUG achieved a 76.35% Macro-F1 score, vastly outperforming HERO's 44.08% (see Figure 4).
  • Resilience to Information Loss: Baselines typically rely on Singular Value Decomposition (SVD) to align input dimensions, which destroys rich semantic information—especially on datasets like AMiner that use one-hot encoded attributes. MUG's dimension-aware alignment preserves this integrity.
  • Excellent Few-Shot Transfer: In 1-shot, 3-shot, and 5-shot target domain tests, MUG maintained a commanding lead. Remarkably, with just 5 labeled samples per class, MUG's performance closely approached the fully supervised results of the baseline models (see Figure 5).

Limitations and Future Work

As an initial exploration into LLM-free universal heterogeneous graph pre-training, MUG still relies on pre-defined meta-paths to guide its contextual structural encoding. Defining these meta-paths requires some domain knowledge of the source and target datasets. The authors note that future work should focus on automating meta-path discovery or learning completely arbitrary structural templates to make the framework truly plug-and-play for any graph structure.

Summary updated

BibTeX
@inproceedings{shan2026mug,
  author = {Lianze Shan and Jitao Zhao and Dongxiao He and Yongqi Huang and Zhiyong Feng and Weixiong Zhang},
  title = {{MUG: Meta-path-aware Universal Heterogeneous Graph Pre-Training}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i30.39718},
}
Figure