Manuscript Offprint

arXiv:2609.08709

Chimaera: A Mixture-of-Graph-Experts Architecture for Cross-Task and Cross-Dataset Graph Learning

Jonathan Frank, David Richerby, Ansgar Scherp

Jonathan Frank University of Ulm Ulm, Germany jonathan.frank@uni-ulm.de

David Richerby University of Essex Colchester, UK david.richerby@essex.ac.uk

Ansgar Scherp University of Ulm Ulm, Germany ansgar.scherp@uni-ulm.de

Abstract—Designing foundation models for graphs is challenging due to the irregular structure of graphs and the different sizes and characteristics of embeddings. Chimaera integrates mixture-of-experts with graph foundation models (GFM). It integrates different GFM architectures, such as graph prompts and linear GNN models. Large language models are used to generate embeddings, and experts can be trained and combined following different strategies, GFMs, embeddings, etc. Furthermore, Chimaera extends existing linear GNNs to support link-level and graph-level tasks in addition to node-level tasks. Empirical analyses are performed on same-task and cross-task experiments with node, link, and graph classification tasks using six benchmark text-attributed graph datasets. The experiments demonstrate the effectiveness of Chimaera and its capabilities for transfer across tasks and datasets. Further insights include the need to use both large and small language models to generate embeddings for the experts, a strong cross-task transferability of simple but effective linear GNNs, and using few samples only to provide strong results. The source code: https://github.com/ascherp/ChIMERA-dev

Index Terms—graph foundation models, mixture-of-experts

I. INTRODUCTION

The success of foundation models [1] in computer vision [2], [3] and natural language processing [4], [5], [6] inspired the development of foundation models specifically for graphs [7]. However, the significant successes in natural language processing have not yet been replicated in graphs, because of their non-i.i.d. nature. Learning from graphs is inherently more complex due to their irregular structure and the lack of a standardized vocabulary [8]. Challenges faced by graph foundation models (GFMs) [7] include handling graph features of different kinds and sizes. For example, a text-attributed graph may be encoded with sparse embeddings like TF-IDF or dense neural embeddings such as a BERT model [9]. Additionally, there are two key characteristics one expects from a foundation model: homogenization [10] and generalizability (also known as emergence) [11]. Homogenization refers to a model's applicability to different tasks. Graph learning tasks are node classification, link prediction, and graph classification. Generalizability is the model's ability to perform well on unseen datasets and tasks with an increasing amount of training data or parameters.

Even though graph neural networks (GNNs) [12], [13], [14], [15] emerge as a specific family of graph learning methods that exhibit impressive performance in tasks such as node classification [13], [16], [17], [18] and link prediction [14],

Figure

Encoders Experts Gating Classifier

Fig. 1: Mixture-of-Graph-Experts configuration with Chimaera. We use n+1n+1 input encoders η\eta (one encoder is from the original dataset). The input is combined via nn GNN experts ξ\xi in a gating function γ\gamma, followed by a classifier κ\kappa.

they are limited to the same feature and label spaces as they are trained on. In other words, a GNN trained on a specific dataset for a certain task does not generalize to other datasets and tasks. Hence, one has to try different models and configurations for each new dataset and task. A mixture-of-experts architecture can learn to combine different GNNs depending on their strengths and, therefore, can mitigate this problem. However, the dependency on the same feature and label spaces remains. A solution for the feature space dependency in text-attributed graphs is provided by large language models (LLMs), which transfer the text features of the node into the same embedding space. For the label space dependency, the solution can be found in prompting [19] and linear GNNs [20], [21].

To solve these problems and create a GFM based on GNNs, we introduce Chimaera,1^1 the first model that combines existing GFMs, such as prompting and linear GNNs, with a mixture-of-experts (MoE) architecture. In this context, we extend linear GNNs from node classification to include link-level and graph-level tasks. Our model is illustrated in Figure 1, where the experts ξ(i)\xi^{(i)} represent a sequence of different GNNs operating on potentially different embeddings. We use different embeddings generated by neural encoders η(i)\eta^{(i)}, e.g., BERT [9]. Consequently, Chimaera is fundamentally a GNN-based model but also functions as a GNN+LLM-based model for text-attributed graphs. The gating function γ\gamma combines the output embedding of the experts and resembles a MoE. The classifier κ\kappa is a GFM that uses the combined embeddings for

1^1“Chimaera” (Greek mythology) is a creature part lion, goat, and serpent. In a similar way, we combine familiar elements to create something new.

classification. Thus, our model aims to generalize by integrating various experts and embeddings while ensuring homogenization through existing GFM methods. Chimaera supports node-, link-, and graph-level classification tasks and can transfer knowledge across tasks and datasets. Thus, it is a GFM itself.

We experiment with various LLMs as encoders, GNNs as experts, gating functions, and GFMs as classifiers. We compare co-training with pre-training and evaluate our method in both same-task and cross-task test settings, following [22]. Co-training applies a trained model to similar datasets, while pre-training involves using trained models on datasets not included in the training phase. Same-task models transfer knowledge within a specific task type, such as node classification; cross-task models focus on transferring knowledge between different tasks, e.g., from node classification to graph classification. Additionally, we use varying numbers of samples for the classification process using linear GNNs and prompting.

Using six benchmark datasets on four tasks (node classification, link prediction, reasoning, and graph classification), we observe that Chimaera performs well when trained on the same datasets and tasks, achieving scores similar to the baseline GNNs. In cross-task or pre-training scenarios, Chimaera demonstrates strong generalization capabilities, achieving performance close to that of models directly trained on the target dataset in more than half of the cases. This highlights the robustness of Chimaera, especially given that, unlike the baselines, our model was not explicitly trained for those specific tasks or datasets. In summary, our contributions are:

  • We introduce Chimaera, a model that combines GFMs with MoE. As a feature by design, our model itself is a GFM that shows generalizability and homogenization.

  • An analysis of complexity and an examination of a gating function across different contexts.

  • Experiments in 64 settings on 6 benchmarks with 4 tasks demonstrate Chimaera's effectiveness in cross-task settings and transferring to new datasets with few training samples.

We summarize related work below. Section III introduces Chimaera. The experimental apparatus is described in Section IV. An overview of the achieved results is reported in Section V and discussed in Section VI, before we conclude.

References (56)