GNNMERGE: MERGING OF GNN MODELS WITHOUT ACCESSING TRAINING DATA

Vipul Garg, Ishita Thakre, Sayan Ranu

TL;DR

GNNMerge is the first framework specifically designed to merge multiple Graph Neural Network (GNN) models into a single unified model without requiring access to the original training data. By shifting the focus from parameter-space averaging to node embedding alignment, the authors achieve up to 24% higher accuracy than existing methods and a staggering 136x speedup compared to retraining from scratch.

What Problem Does This Paper Address?

Model merging is an emerging field that allows researchers to combine the capabilities of different pre-trained models (e.g., one trained to classify research papers and another to predict citations) without the massive computational cost of retraining or the privacy risks of sharing raw data.

While model merging has seen success in Computer Vision and NLP, GNNs present unique hurdles. Most existing techniques rely on a "shared initialization" assumption—the idea that models were started from the same pre-trained "foundation" weights. In the GNN world, such foundation models are rare. Furthermore, GNNs often operate on diverse tasks (node classification vs. link prediction) where the loss landscapes are fundamentally different. This paper identifies that standard merging techniques fail to align GNN parameters effectively, leading to significant performance drops.

Methods

The authors propose GNNMERGE, which moves away from merging raw weights and instead focuses on Node Embedding Alignment. The core idea is simple: if the merged model can produce node embeddings that closely match those of the original "teacher" models, it will naturally inherit their performance on specific tasks.

Key technical contributions include:

  • Task-Agnostic Objective: The merging process doesn't need to know what the models were trained for; it only cares about replicating the embeddings they produce.
  • Layer-wise Relaxation: To avoid the high cost of backpropagation, the authors "relax" the optimization objective. They align each GNN layer independently, treating the output of the previous layer from the teacher models as the fixed input for the merged model.
  • Analytical Solution (GNNMERGE++): For the most common GNN architectures—Message Passing Neural Networks (MPNNs) like GCN, GAT, and GraphSAGE—the authors derived a closed-form analytical solution. This means the optimal weights for the merged model can be calculated directly using matrix algebra (specifically, a Frobenius norm minimization), completely bypassing the need for iterative gradient descent.

Datasets

The study provides the first comprehensive benchmark for GNN model merging using eight diverse graph datasets:

  • Citation Networks: Cora, Citeseer, Pubmed, and OGB-Arxiv.
  • E-commerce/Social: Amazon Computers, Amazon Photo, and Reddit.
  • General: WikiCS.

The authors evaluated three primary scenarios: merging models trained on disjoint label sets of the same dataset, merging models trained on entirely different datasets, and merging models trained for different tasks (e.g., Node Classification + Link Prediction).

Key Insights and Ideas

  • Embeddings are the Universal Language of GNNs: Regardless of the final task, all GNNs function by mapping nodes into a continuous embedding space. Aligning this space is a much more robust merging strategy than trying to align raw weight matrices.
  • Independence is a Feature, Not a Bug: By aligning layers independently, the authors found they could circumvent the vanishing gradient problem that often plagues "joint" alignment in deeper networks. This makes the merging process "embarrassingly parallel."
  • The "Aha!" of GNNMERGE++: The realization that GNN operations are essentially linear transformations (post-aggregation) allowed the authors to turn a complex deep-learning optimization problem into a standard linear least-squares problem that can be solved in seconds on a CPU.

Key Results

  • Superior Accuracy: GNNMERGE++ outperformed existing state-of-the-art merging baselines (like ZipIt! and RE-BASIN) by an average of 10% to 24% across various tasks.
  • Extreme Efficiency: Because of the analytical solution, GNNMERGE++ achieved a 136x speedup over retraining from scratch. On the Reddit dataset, it merged models in roughly 5 seconds on a CPU, whereas training took over 11 minutes on a high-end GPU.
  • Robustness to Scale: Unlike baselines that degrade rapidly as more models are added, GNNMERGE maintained high accuracy even when merging up to five different models simultaneously.

Limitations and Future Work

  • Homogeneous Architectures: The current framework requires all models being merged to share the same architecture (e.g., you can merge two GCNs, but not a GCN with a GAT). The authors note that merging heterogeneous architectures remains an open challenge.
  • Domain Consistency: While the method doesn't need the original training data, it does assume the merging is performed using a graph from a similar domain to ensure the node features and structural distributions are relevant.
  • Future Directions: The authors suggest this work paves the way for more scalable continual learning and privacy-preserving collaborative graph learning.

Summary updated

BibTeX
@inproceedings{garg2025gnnmerge,
  author = {Vipul Garg and Ishita Thakre and Sayan Ranu},
  title = {{GNNMERGE: MERGING OF GNN MODELS WITHOUT ACCESSING TRAINING DATA}},
  booktitle = {WSL @ ICLR},
  year = {2025},
  url = {https://openreview.net/forum?id=DIYMPC16Pi},
}
Figure