Training A Foundation Model to Represent Graphs as Vectors
Qi Feng, Jicong Fan
TL;DR
This work addresses cross-domain graph-level representation by training a Graph Foundation Model (GraphVec-FM) that maps any graph to a fixed-dimensional vector while preserving topology and semantics. It introduces a multi-graph feature alignment strategy to derive consistent node embeddings across domains, a density-maximization mean alignment with convergence guarantees, and a multi-layer reference-distribution readout to retain node-embedding information in the graph representation. The model is trained with supervised (and optionally unsupervised) contrastive objectives, and a theoretical generalization bound is provided to support cross-domain applicability. Empirically, GraphVec-FM achieves strong performance on few-shot graph classification and graph clustering and demonstrates scalability to large datasets via Nyström approximations and batching. The work highlights a principled, domain-agnostic graph representation framework, with potential extension to cross-modal alignment in future work.
Abstract
This paper aims to train a graph foundation model that is able to represent any graph as a vector preserving structural and semantic information useful for downstream graph-level tasks such as graph classification and graph clustering. To learn the features of graphs from diverse domains while maintaining strong generalization ability to new domains, we propose a multi-graph-based feature alignment method, which constructs weighted graphs using the attributes of all nodes in each dataset and then generates consistent node embeddings. To enhance the consistency of the features from different datasets, we propose a density maximization mean alignment algorithm with guaranteed convergence. The original graphs and generated node embeddings are fed into a graph neural network to achieve discriminative graph representations in contrastive learning. More importantly, to enhance the information preservation from node-level representations to the graph-level representation, we construct a multi-layer reference distribution module without using any pooling operation. We also provide a theoretical generalization bound to support the effectiveness of the proposed model. The experimental results of few-shot graph classification and graph clustering show that our model outperforms strong baselines.
