Model merging has emerged as a powerful paradigm for combining the capabilities of multiple trained neural networks without the prohibitive cost of retraining or the need for original training datasets. While successful in domains like Computer Vision and Natural Language Processing, standard merging techniques fail when applied to Graph Neural Networks (GNNs). This paper introduces GNNMerge, the first specialized framework for merging GNNs that addresses the unique challenges of graph-structured data and non-shared initializations.
The Challenge of GNN Merging
Most existing model merging algorithms, such as Weight Averaging or Task Arithmetic, rely on a critical assumption: the models to be merged must share a common pre-trained initialization (e.g., a foundation model). However, GNNs are typically trained from scratch with random initializations for specific graph datasets. When models do not share an initial state, their weight spaces become "misaligned," and simple averaging leads to catastrophic forgetting.
As shown in the comparison table, GNNMerge and its analytical variant GNNMerge++ are the only methods that do not require a shared initial state or training labels, while avoiding the pitfalls of model inflation and complex numerical optimization.
The GNNMerge Approach: Aligning Embeddings
The core innovation of GNNMerge is shifting the merging objective from the parameter space to the node embedding space. The intuition is that if a merged model can produce node embeddings similar to those of the original base models, it will effectively inherit their predictive performance.
To implement this efficiently, the authors propose two key strategies:
- Layer-wise Independent Alignment: Instead of a complex end-to-end alignment, GNNMerge aligns the embeddings at each layer independently. This simplifies the optimization and prevents issues like vanishing gradients.
- Analytical Solution (GNNMerge++): For common message-passing architectures like GCN and GraphSAGE, the layer-wise alignment problem is convex. The authors derived a closed-form analytical solution, allowing the merged weights to be calculated instantly via matrix equations rather than iterative gradient descent.
Experimental Results and Insights
The authors evaluated GNNMerge across eight diverse datasets, including citation networks (Cora, Citeseer), co-purchase networks (Amazon), and social networks (Reddit).
Performance and Efficiency
GNNMerge++ demonstrates significant improvements over baseline methods. In in-domain merging tasks, it outperformed standard Weight Averaging by approximately 24% and state-of-the-art methods like Surgery by 11%.
The efficiency gains are even more striking. On the large-scale Reddit dataset, GNNMerge++ completed the merging process in just 5.12 seconds on a CPU. In contrast, training a joint model from scratch required nearly 700 seconds on an NVIDIA A100 GPU, representing a 136x speedup.
Robustness Across Tasks
GNNMerge proves highly versatile, successfully merging models trained on entirely different tasks, such as combining a node classification model with a link prediction model. While baseline methods often collapse on link prediction during merging, GNNMerge maintains high accuracy. Furthermore, it can merge up to five models trained on distinct datasets with minimal performance degradation.
Conclusion and Future Directions
GNNMerge establishes a new benchmark for GNN model merging by prioritizing embedding alignment over weight averaging. By providing an analytical solution, it offers a path toward near-instantaneous model composition that is both privacy-preserving and computationally efficient. While currently limited to merging models of the same architecture, future work may extend these principles to heterogeneous GNN architectures, further expanding the utility of model merging in the graph domain.
Summary updated