AutoTransfer: AutoML with Knowledge Transfer -- An Application to Graph
  Neural Networks
AutoML has demonstrated remarkable success in finding an effective neural
architecture for a given machine learning task defined by a specific dataset
and an evaluation metric. However, most present AutoML techniques consider each
task independently from scratch, which requires exploring many architectures,
leading to high computational cost. Here we propose AutoTransfer, an AutoML
solution that improves search efficiency by transferring the prior
architectural design knowledge to the novel task of interest. Our key
innovation includes a task-model bank that captures the model performance over
a diverse set of GNN architectures and tasks, and a computationally efficient
task embedding that can accurately measure the similarity among different
tasks. Based on the task-model bank and the task embeddings, we estimate the
design priors of desirable models of the novel task, by aggregating a
similarity-weighted sum of the top-K design distributions on tasks that are
similar to the task of interest. The computed design priors can be used with
any AutoML search algorithm. We evaluate AutoTransfer on six datasets in the
graph machine learning domain. Experiments demonstrate that (i) our proposed
task embedding can be computed efficiently, and that tasks with similar
embeddings have similar best-performing architectures; (ii) AutoTransfer
significantly improves search efficiency with the transferred design priors,
reducing the number of explored architectures by an order of magnitude.
Finally, we release GNN-Bank-101, a large-scale dataset of detailed GNN
training information of 120,000 task-model combinations to facilitate and
inspire future research.
Kaidi Cao, Jiaxuan You, Jiaju Liu, Jure Leskovec
# AutoTransfer: AutoML with Knowledge Transfer - An Application to Graph Neural Networks

###### Abstract

AutoML has demonstrated remarkable success in finding an effective neural architecture for a given machine learning task defined by a specific dataset and an evaluation metric. However, most present AutoML techniques consider each task independently from scratch, which requires exploring many architectures, leading to high computational costs. Here we propose AutoTransfer, an AutoML solution that improves search efficiency by transferring the prior architectural design knowledge to the novel task of interest. Our key innovation includes a _task-model bank_ that captures the model performance over a diverse set of GNN architectures and tasks, and a computationally efficient _task embedding_ that can accurately measure the similarity among different tasks. Based on the task-model bank and the task embeddings, we estimate the design priors of desirable models of the novel task, by aggregating a similarity-weighted sum of the top-K design distributions on tasks that are similar to the task of interest. The computed design priors can be used with any AutoML search algorithm. We evaluate AutoTransfer on six datasets in the graph machine learning domain. Experiments demonstrate that (i) our proposed task embedding can be computed efficiently, and that tasks with similar embeddings have similar best-performing architectures; (ii) AutoTransfer significantly improves search efficiency with the transferred design priors, reducing the number of explored architectures by _an order of magnitude_. Finally, we release GNN-Bank-101, a large-scale dataset of detailed GNN training information of 120,000 task-model combinations to facilitate and inspire future research.

## 1 Introduction

Deep neural networks are highly modular, requiring many design decisions to be made regarding network architecture and hyperparameters. These design decisions form a search space that is nonconvex and costly even for experts to optimize over, especially when the optimization must be repeated from scratch for each new use case. Automated machine learning (AutoML) is an active research area that aims to reduce the human effort required for architecture design that usually covers hyperparameter optimization and neural architecture search. AutoML has demonstrated success (Zoph and Le, 2016; Pham et al., 2018; Zoph et al., 2018; Cai et al., 2018; He et al., 2018; Guo et al., 2020; Erickson et al., 2020; LeDell and Poirier, 2020) in many application domains.

Finding a reasonably good model for a new learning _task1_ in a computationally efficient manner is crucial for making deep learning accessible to domain experts with diverse backgrounds. Efficient AutoML is especially important in domains where the best architectures/hyperparameters are highly sensitive to the task. A notable example is the domain of graph learning2. _First_, graph learning methods receive input data composed of _a variety of data types_ and optimize over tasks that span an equally _diverse set of domains and modalities_ such as recommendation (Ying et al., 2018; He et al., 2020), physical simulation (Sanchez-Gonzalez et al., 2020; Pfaff et al., 2020), and bioinformatics (Zitnik et al., 2018). This differs from computer vision and natural language processing where the
input data has a predefined, fixed structure that can be shared across different neural architectures. _Second_, neural networks that operate on graphs come with _a rich set of design choices_ and _a large set of parameters to explore_. However, unlike other domains where a few pre-trained architectures such as ResNet (He et al., 2016) and GPT-3 (Brown et al., 2020) dominate the benchmarks, it has been shown that the best graph neural network (GNN) design is highly task-dependent (You et al., 2020).

Although AutoML as a research domain is evolving fast, existing AutoML solutions have massive computational overhead when finding a good model for a _new_ learning task is the goal. Most present AutoML techniques consider each task independently and in isolation, therefore they require redoing the search from scratch for each new task. This approach ignores the potentially valuable architectural design knowledge obtained from the previous tasks, and inevitably leads to a high computational cost. The issue is especially significant in the graph learning domain Gao et al. (2019); Zhou et al. (2019), due to the challenges of diverse task types and the huge design space that are discussed above.

Here we propose AutoTransfer3, an AutoML solution that drastically improves AutoML architecture search by transferring previous architectural design knowledge to the task of interest. Our key innovation is to introduce a _task-model bank_ that stores the performance of a diverse set of GNN architectures and tasks to guide the search algorithm. To enable knowledge transfer, we define a _task embedding_ space such that tasks close in the embedding space have similar corresponding top-performing architectures. The challenge here is that the task embedding needs to capture the performance rankings of different architectures on different datasets, while being efficient to compute. Our innovation here is to embed a task by using the condition number of its Fisher Information Matrix of various _randomly initialized_ models and also a learning scheme with an empirical generalization guarantee. This way we implicitly capture the properties of the learning task, while being orders of magnitudes faster (within seconds). We then estimate the design prior of desirable models for the new task, by aggregating design distributions on tasks that are close to the task of interest. Finally, we initiate a hyperparameter search algorithm with the task-informed design prior computed.

Footnote 3: Source code is available at [https://github.com/snap-stanford/AutoTransfer](https://github.com/snap-stanford/AutoTransfer).

We evaluate AutoTransfer on six datasets, including both node classification and graph classification tasks. We show that our proposed task embeddings can be computed efficiently and the distance measured between tasks correlates highly (0.43 Kendall correlation) with model performance rankings. Furthermore, we present AutoTransfer significantly improves search efficiency when using the transferred design prior. AutoTransfer reduces the number of explored architectures needed to reach a target accuracy by _an order of magnitude_ compared to SOTA. Finally, we release GNN-Bank-101--the first large-scale database containing detailed performance records for 120,000 task-model combinations which were trained with 16,128 GPU hours--to facilitate future research.

## 2 Related Work

In this section, we summarize the related work on AutoML regarding its applications on GNNs, the common search algorithms, and pioneering work regarding transfer learning and task embeddings.

**AutoML for GNNs.** Neural architecture search (NAS), a unique and popular form of AutoML for deep learning, can be divided into two categories: multi-trial NAS and one-shot NAS. During multi-trial NAS, each sampled architecture is trained separately. GraphNAS (Gao et al., 2020) and Auto-GNN (Zhou et al., 2019) are typical multi-trial NAS algorithms on GNNs which adopt an RNN controller that learns to suggest better sets of configurations through reinforcement learning. One-shot NAS (_e.g._, (Liu et al., 2018; Qin et al., 2021; Li et al., 2021)) involves encapsulating the entire model space in one super-model, training the super-model once, and then iteratively sampling sub-models from the super-model to find the best one. In addition, there is work that explicitly studies fine-grained design choices such as data augmentation (You et al., 2021), message passing layer type (Cai et al., 2021; Ding et al., 2021; Zhao et al., 2021), and graph pooling (Wei et al., 2021). Notably, AutoTransfer is the _first_ AutoML solution for GNNs that efficiently transfer design knowledge across tasks.

**HPO Algorithms.** Hyperparameter Optimization (HPO) algorithms search for the optimal model hyperparameters by iteratively suggesting a set of hyperparameters and evaluating their performance. Random search samples hyperparameters from the search space with equal probability. Despite not
learning from previous trials, random search is commonly used for its simplicity and is much more efficient than grid search (Bergstra and Bengio, 2012). The TPE algorithm (Bergstra et al., 2011) builds a probabilistic model of task performance over the hyperparameter space and uses the results of past trials to choose the most promising next configuration to train, which the TPE algorithm defines as maximizing the Expected Improvement value (Jones, 2001). Evolutionary algorithms (Real et al., 2017; Jaderberg et al., 2017) train multiple models in parallel and replace poorly performing models with "mutated" copies of the current best models. AutoTransfer is a general AutoML solution and can be applied in combination with any of these HPO algorithms.

**Transfer Learning in AutoML.** Wong et al. (2018) proposed to transfer knowledge across tasks by reloading the controller of reinforcement learning search algorithms. However, this method assumes that the search space on different tasks starts with the same learned prior. Unlike AutoTransfer, it cannot address the core challenge in GNN AutoML: the best GNN design is highly task-specific. GraphGym (You et al., 2020) attempts to transfer the best architecture design directly with a metric space that measures task similarity. GraphGym (You et al., 2020) computes task similarity by training a set of 12 "anchor models" to convergence which is computationally expensive. In contrast, AutoTransfer designs light-weight task embeddings requiring minimal computations overhead. Additionally, Zhao and Bilen (2021); Li et al. (2021) proposes to conduct architecture search on a proxy subset of the whole dataset and later transfer the best searched architecture on the full dataset. Jeong et al. (2021) studies a similar setting in vision domain.

**Task Embedding.** There is prior research trying to quantify task embeddings and similarities. Similar to GraphGym, Taskonomy (Zamir et al., 2018) estimates the task affinity matrix by summarizing final losses/evaluation metrics using an Analytic Hierarchy Process (Saaty, 1987). From a different perspective, Task2Vec (Achille et al., 2019) generates task embeddings for a given task using the Fisher Information Matrix associated with a pre-trained probe network. This probe network is shared across tasks and allows Task2Vec to estimate the Fisher Information Matrix of different image datasets. Le et al. (2022) extends a similar idea to neural architecture search. The aforementioned task embeddings cannot be directly applied to GNNs as the inputs do not align across datasets. AutoTransfer avoids the bottleneck by using asymptotic statistics of the Fisher Information Matrix with randomly initiated weights.

## 3 Problem Formulation and Preliminaries

We first introduce formal definitions of data structures relevant to AutoTransfer.

Figure 1: **Overview of AutoTransfer. Left: We introduce GNN-Bank-101, a large database containing a diverse set of GNN architectures and hyperparameters applied to different tasks, along with their training/evaluation statistics. Middle: We introduce a task embedding space, where each point corresponds to a different task. Tasks close in the embedding space have similar corresponding top-performing models. Right: Given a new task of interest, we guide the AutoML search by referencing the design distributions of the most similar tasks in the task embedding space.**
**Definition 1** (Task): _We denote a task as \(T=(\mathcal{D},\mathcal{L}(\cdot))\), consisting of a dataset \(\mathcal{D}\) and a loss function \(\mathcal{L}(\cdot)\) related to the evaluation metric._

For each training attempt on a task \(T^{(i)},\) we can record its model architecture \(M_{j}\), hyperparameters \(H_{j}\), and corresponding value of loss \(l_{j}\), _i.e._, \((M_{j},H_{j},l_{j})\). We propose to maintain a task-model bank to facilitate knowledge transfer to future novel tasks.

**Definition 2** (Task-Model Bank): _A task-model bank \(\mathcal{B}\) is defined as a collection of tasks, each with multiple training attempts, in the form of \(\mathcal{B}=\{(T^{(i)},\{(M_{j}^{(i)},H_{j}^{(i)},l_{j}^{(i)})\})\}\)._

**AutoML with Knowledge Transfer.** Suppose we have a task-model bank \(\mathcal{B}\). Given a novel task \(T^{(n)}\) which has not been seen before, our goal is to quickly find a model that works reasonably well on the novel task by utilizing knowledge from the task-model bank.

In this paper, we focus on AutoML for graph learning tasks, though our developed technique is general and can be applied to other domains. We define the input graph as \(G=\{V,E\}\), where \(V\) is the node set and \(E\subseteq V\times V\) is the edge set. Furthermore, let \(y\) denote its output labels, which can be node-level, edge-level or graph-level. A GNN parameterized by weights \(\theta\) outputs a posterior distribution \(\mathcal{P}(G,y,\theta)\) for label predictions.

## 4 Proposed Solution: AutoTransfer

In this section, we introduce the proposed AutoTransfer solution. AutoTransfer uses the _task embedding space_ as a tool to understand the relevance of previous architectural designs to the target task. The designed task embedding captures the performance rankings of different architectures on different tasks while also being efficient to compute. We first introduce a theoretically motivated solution to extract a scale-invariant performance representation of each task-model pair. We use these representations to construct task features and further learn task embeddings. These embeddings form the task embedding space that we finally use during the AutoML search.

### Basics of the Fisher Information Matrix (FIM)

Given a GNN defined above, its Fisher Information Matrix (FIM) \(F\) is defined as

\[F=\mathbb{E}_{G,y}[\nabla_{\theta}\log\mathcal{P}(G,y,\theta)\;\nabla_{\theta} \log\mathcal{P}(G,y,\theta)^{\top}].\]

which formally is the expected covariance of the scores with respect to the model parameters. There are two popular geometric views for the FIM. First, the FIM is an upper bound of the Hessian and coincides with the Hessian if the gradient is 0. Thus, the FIM characterizes the local landscape of the loss function near the global minimum. Second, similar to the Hessian, the FIM models the loss

Figure 2: **Pipeline for extracting task embeddings. Left: To efficiently embed a task, we first extract task features by concatenating features measured from \(R\) randomly initialized anchor models. Then, we introduce a projection function \(g(\cdot)\) with learned weights to transform the task features into task embeddings. Right: Training objective for optimizing \(g(\cdot)\) with triplet supervision.**
landscape with respect not to the input space, but to the parameter space. In the information geometry view, if we add a small perturbation to the parameter space, we have

\[\text{KL}(\mathcal{P}(G,y,\theta)\|\mathcal{P}(G,y,\theta+d\theta))=d\theta^{ \top}Fd\theta.\]

where \(\text{KL}(\cdot,\cdot)\) stands for Kullback-Leibler divergence. It means that the parameter space of a model forms a Riemannian manifold and the FIM works as its Riemannian metric. The FIM thus allows us to quantify the importance of a model's weights in a way that is applicable to different architectures.

### FIM-based Task Features

**Scale-invariant Representation of Task-Model Pairs.** We aim to find a scale-invariant representation for each task-model pair which will form the basis for constructing task features. The major challenge in using the FIM to represent GNN performance is that graph datasets do not have a universal, fixed input structure, so it is infeasible to find a single pre-trained model and extract its FIM. However, training multiple networks poses a problem as the FIMs computed for different networks are not directly comparable. We choose to use multiple networks but additionally propose to use asymptotic statistics of the FIM associated with randomly initialized weights. The theoretical justification for the relationship between the asymptotic statistics of the FIM and the trainability of neural networks was studied in (Karakida et al., 2019; Pennington and Worah, 2018) to which we refer the readers. We hypothesize that such a measure of trainability encodes loss landscapes and generalization ability and thus correlates with final model performance on the task. Another issue that relates to input structures of graph datasets is that different models have different number of parameters. Despite some specially designed architectures, _e.g._, (Lee et al., 2019; Ma et al., 2019), most GNN architecture design can be represented as a sequence of pre-processing layers, message passing layers, and post-processing layers. Pre-process layers and post-process layers are Multilayer Perceptron (MLP) layers, of which the dimensions vary across different tasks due to different input/output structures. Message passing layers are commonly regarded as the key design for GNNs and the number of weight parameters can remain the same across tasks. In this light, we only consider the FIM with respect to the parameters in message passing layers so that the number of parameters considered stays the same for all datasets. We note that such formulation has its limitations, in the sense that it cannot cover all the GNN designs in the literature. We leave potential extensions with better coverage for future work. We further approximate the FIM by only considering the diagonal entries, which implicitly neglects the correlations between parameters. We note that this is common practice when analyzing the FIMs of deep neural networks, as the full FIM is massive (quadratic in the number of parameters) and infeasible to compute even on modern hardware. Similar to Pennington and Worah (2018), we consider the first two moments of FIM

\[m_{1}=\frac{1}{n}\text{tr}[F]\quad\text{and}\quad m_{2}=\frac{1}{n}\text{tr}[F ^{2}] \tag{1}\]

and use \(\alpha=m_{2}/m_{1}^{2}\) as the scale-invariant representation. The computed \(\alpha\) is lower bounded by 1 and captures how concentrated the spectrum is. A small \(\alpha\) indicates the loss landscape is flat, and its corresponding model design enjoys fast first-order optimization and potentially better generalization. To encode label space information into each task, we propose to train only the last linear layer of each model on a given task, which can be done efficiently. The parameters in other layers are frozen after being randomly initialized. We take the average over \(R\) initializations to estimate the average \(\bar{\alpha}\).

**Constructing Task Features.** We denote task features as measures extracted from each task that characterize its important traits. The design of task features should reflect our final objective: to use these features to identify similar tasks and transfer the best design distributions. Thus, we select \(U\) model designs as anchor models and concatenate the scale-invariant representations \(\bar{a}_{u}\) of each design as task features. To retain only the relative ranking among anchor model designs, we normalize the concatenated feature vector to a scale of 1. We let \(\mathbf{z}_{f}\) denote the normalized task feature.

### From Task Features to Task Embeddings

The task feature \(\mathbf{z}_{f}\) introduced above can be regarded as a means of feature engineering. We construct the feature vector with domain knowledge, but there is no guarantee it functions as anticipated. We thus propose to learn a projection function \(g(\cdot):\mathbb{R}^{U}\rightarrow\mathbb{R}^{D}\) that maps task feature \(\mathbf{z}_{f}\) to final task
embedding \(\mathbf{z}_{e}=g(\mathbf{z}_{f})\). We do not have any pointwise supervision that can be used as the training objective. Instead, we consider the metric space defined by GraphGym. The distance function in GraphGym - computed using the Kendall rank correlation between performance rankings of anchor models trained on the two compared tasks - correlates nicely with our desired knowledge transfer objective. It is not meaningful to enforce that task embeddings mimic GraphGym's exact metric space, as GraphGym's metric space can still contain noise, or does not fully align with the transfer objective. We consider a surrogate loss that enforces only the rank order among tasks. To illustrate, let us consider tasks \(T^{(i)},T^{(j)}\), \(T^{(k)}\) and their corresponding task embeddings, \(\mathbf{z}_{e}^{(i)}\), \(\mathbf{z}_{e}^{(j)}\), \(\mathbf{z}_{e}^{(k)}\). Note that \(\mathbf{z}_{e}\) is normalized to 1 so \({\mathbf{z}_{e}^{(i)}}^{\top}\mathbf{z}_{e}^{(j)}\) measures the cosine similarity between tasks \(T^{(i)}\) and \(T^{(j)}\). Let \(d_{g}(\cdot,\cdot)\) denote the distance estimated by GraphGym. We want to enforce

\[\mathbf{z}_{e}^{(i)}{}^{\top}\mathbf{z}_{e}^{(j)}>\mathbf{z}_{e}^{(i)}{}^{\top}\mathbf{z}_{e}^ {(k)}\quad\text{if}\quad d_{g}(T^{(i)},T^{(j)})<d_{g}(T^{(i)},T^{(k)}).\]

To achieve this, we use the margin ranking loss as our surrogate supervised objective function:

\[\mathcal{L}_{r}(\mathbf{z}_{e}^{(i)},\mathbf{z}_{e}^{(j)},\mathbf{z}_{e}^{(k)},y)=\max(0, -y\cdot(\mathbf{z}_{e}^{(i)}{}^{\top}\mathbf{z}_{e}^{(j)}-\mathbf{z}_{e}^{(i)}{}^{\top} \mathbf{z}_{e}^{(k)})+\text{margin}). \tag{2}\]

Here if \(d_{g}(T^{(i)},T^{(j)})<d_{g}(T^{(i)},T^{(k)})\), then we have its corresponding label \(y=1\), and \(y=-1\) otherwise. Our final task embedding space is then a FIM-based metric space with cosine distance function, where the distance is defined as \(d_{e}(T^{(i)},T^{(j)})=1-\mathbf{z}_{e}^{(i)}{}^{\top}\mathbf{z}_{e}^{(j)}\). Please refer to the detailed training pipeline at Algorithm 2 in the Appendix.

### AutoML Search Algorithm with Task Embeddings

To transfer knowledge to a novel task, a naive idea would be to directly carry over the best model configuration from the closest task in the bank. However, even a high Kendall rank correlation between model performance rankings of two tasks \(T^{(i)}\), \(T^{(j)}\) does not guarantee the best model configuration in task \(T^{(i)}\) will also achieve the best performance on task \(T^{(j)}\). In addition, since task similarities are subject to noise, this naive solution may struggle when there exist multiple reference tasks that are all highly similar.

To make the knowledge transfer more robust to such failure cases, we introduce the notion of design distributions that depend on top performing model designs and propose to transfer design distributions rather than the best design configurations. Formally, consider a task \(T^{(i)}\) in the task-model bank \(\mathcal{B}\), associated with its trials \(\{(M^{(i)}_{j},H^{(i)}_{j},l^{(i)}_{j})\}\). We can summarize its designs as a list of configurations \(C=\{c_{1},\ldots,c_{W}\}\), such that all potential combinations of model architectures \(M\) and hyperparameters \(H\) fall under the Cartesian product of the configurations. For example, \(c_{1}\) could be the instantiation of aggregation layers, and \(c_{2}\) could be the start learning rate. We then define design distributions as random variables \(\texttt{c}_{1},\texttt{c}_{2},\ldots,\texttt{c}_{W}\), each corresponding to a hyperparameter. Each random variable c is defined as the frequency distribution of the design choices used in the top \(K\) trials. We multiply all distributions for the individual configurations \(\{\texttt{c}_{1},\ldots,\texttt{c}_{W}\}\) to approximate the overall task's design distribution \(\mathcal{P}(C|T^{(i)})=\prod_{w}\mathcal{P}(\texttt{c}_{w}|T^{(i)})\).

During inference, given a novel task \(T^{(n)}\), we select a close task subset \(\mathcal{S}\) by thresholding task embedding distances, _i.e._, \(\mathcal{S}=\{T^{(i)}|d_{e}(T^{(n)},T^{(i)})\leq d_{\text{these}}\}\). We then derive the transferred design prior \(\mathcal{P}_{t}(C|T^{(n)})\) of the novel task by weighting design distributions from the close task subset \(\mathcal{S}\).

\[\mathcal{P}_{t}(C|T^{(n)})=\frac{\sum_{T^{(i)}\in\mathcal{S}}\frac{1}{d_{e}(T^ {(n)},T^{(i)})}\mathcal{P}(C|T^{(i)})}{\sum_{T^{(i)}\in\mathcal{S}}\frac{1}{d_{ e}(T^{(n)},T^{(i)})}}. \tag{3}\]

The inferred design prior for the novel task can then be used to guide various search algorithms. The most natural choice for a few trial regime is random search. Rather than sampling each design configuration following a uniform distribution, we propose to sample from the task-informed design prior \(\mathcal{P}_{t}(C|T^{(n)})\). Please refer to Appendix A to check how we augment other search algorithms.

For AutoTransfer, we can preprocess the task-model bank \(\mathcal{B}\) into \(\mathcal{B}_{p}=\{(\mathcal{D}^{(i)},\mathcal{L}^{(i)}(\cdot)),\mathbf{z}_{e}^{(i )},\mathcal{P}(C|T^{(i)})\}\) as our pipeline only requires using task embedding \(\mathbf{z}_{e}^{(i)}\) and design distribution \(\mathcal{P}(C|T^{(i)})\) rather than detailed training trials. A detailed search pipeline is summarized in Algorithm 1.
```
0: A processed task-model bank \(\mathcal{B}_{p}=\{(\mathcal{D}^{(i)},\mathcal{C}^{(i)}(\cdot)),\mathbf{z}_{e}^{(i)}, \mathcal{P}(C|T^{(i)})\}\), a novel task \(T^{(n)}=\big{(}\mathcal{D}^{(n)},\mathcal{C}^{(n)}(\cdot)\big{)}\), \(U\) anchor models \(M_{1},...,M_{U}\), \(R\) specifies the number of repeats.
1:for\(u=1\) to \(U\)do
2:for\(r=1\) to \(R\)do
3: Initialize weights \(\theta\) for anchor model \(M_{u}\) randomly
4: Estimate FIM \(F\leftarrow\mathbb{E}_{\mathcal{D}}[\nabla_{\theta}\log\mathcal{P}(M_{u},y, \theta)\ \nabla_{\theta}\log\mathcal{P}(M_{u},y,\theta)^{\top}]\)
5: Extract scale-invariant representation \(a_{u}^{(v)}\gets m_{2}/m_{1}^{2}\) following Eq. 1
6:endfor
7:\(\bar{\mathbf{a}}_{u}\leftarrow\text{mean}(a_{u}^{(1)},a_{u}^{(2)},...,a_{u}^{(V)})\)
8:endfor
9:\(\mathbf{z}_{f}^{(n)}\leftarrow\text{concat}(\bar{a}_{1},\bar{a}_{2},...,\bar{a}_{U})\)
10:\(\mathbf{z}_{e}^{(n)}\gets g(\mathbf{z}_{f}^{(n)})\)
11: Select close task subset \(\mathcal{S}\leftarrow\{T^{(i)}|1-\mathbf{z}_{e}^{(n)}\}^{\top}\mathbf{z}_{e}^{(i)}\leq d _{\text{dnews}}\}\)
12: Get design prior \(\mathcal{P}_{t}(C|T^{(n)})\) by aggregating subset \(\mathcal{S}\) following Eq. 3
13: Start a HPO search algorithm with the task-informed design prior \(\mathcal{P}_{t}(C|T^{(n)})\)
```

**Algorithm 1** Summary of AutoTransfer search pipeline

## 5 Experiments

### Experimental Setup

**Task-Model Bank: GNN-Bank-101.**

To facilitate AutoML research with knowledge transfer, we collected GNN-Bank-101 as the first large-scale graph database that records reproducible design configurations and detailed training performance on a variety of tasks. Specifically, GNN-Bank-101 currently includes six tasks for node classification (AmazonComputers (Shchur et al., 2018), AmazonPhoto (Shchur et al., 2018), CiteSeer (Yang et al., 2016), CoauthorCS (Shchur et al., 2018), CoauthorPhysics (Shchur et al., 2018), Cora (Yang et al., 2016)) and six tasks for graph classification (PROTEINS (Ivanov et al., 2019), BZR (Ivanov et al., 2019), COX2 (Ivanov et al., 2019), DD (Ivanov et al., 2019), ENZYMES (Ivanov et al., 2019), IMDB-M (Ivanov et al., 2019)). Our design space follows (You et al., 2020), and we extend the design space to include various commonly adopted graph convolution and activation layers. We extensively run 10,000 different models for each task, leading to 120,000 total task-model combinations, and record all training information including train/val/test loss.

**Benchmark Datasets.** We benchmark AutoTransfer on six different datasets following prior work (Qin et al., 2021). Our datasets include three standard node classification datasets (CoauthorPhysics (Shchur et al., 2018), CoraFull (Bojchevski and Gunnemann, 2017) and OGB-Arxiv (Hu et al., 2020)), as well as three standard benchmark graph classification datasets, (COX2 (Ivanov et al., 2019), IMDB-M (Ivanov et al., 2019) and PROTEINS (Ivanov et al., 2019)). CoauthorPhysics and CoraFull are transductive node classification datasets, so we randomly assign nodes into train/valid/test sets following a 50%:25%:25% split (Qin et al., 2021). We randomly split graphs following a 80%:10%:10% split for the three graph classification datasets (Qin et al., 2021). We follow the default train/valid/test split for the OGB-Arxiv dataset (Hu et al., 2020). To make sure there is no information leakage, we temporarily _remove_ all records related to the task from our task-model bank if the dataset we benchmark was collected in the task-model bank.

**Baselines.** We compare our methods with the state-of-the-art approaches for GNN AutoML. We use GCN and GAT with default architectures following their original implementation as baselines. For multi-trial NAS methods, we consider GraphNAS (Gao et al., 2020). For one-shot NAS methods, we include DARTS (Liu et al., 2018) and GASSO (Qin et al., 2021). GASSO is designed for transductive settings, so we omit it for graph classification benchmarks. We further provide results of HPO algorithms based on our proposed search space as baselines: Random, Evolution, TPE (Bergstra et al., 2011) and HyperBand (Li et al., 2017).

We by default allow searching 30 trials maximum for all the algorithms, _i.e._, an algorithm can train 30 different models and collect the model with the best accuracy. We use the default setting for one-shot
NAS algorithms (DARTS and GASSO), as they only train a super-model once and can efficiently evaluate different architectures. We are mostly interested in studying the few-trial regime where most advanced search algorithms degrade to random search. Thus we additionally include a random search (3 trials) baseline where we pick the best model out of only 3 trials.

### Experiments on Search Efficiency

We evaluate AutoTransfer by reporting the average best test accuracy among all trials considered over ten runs of each algorithm in Table 1. The test accuracy collected for each trial is selected at the epoch with the best validation accuracy. By comparing results from random search (3 trials) and AutoTransfer (3 trials), we show that our transferred task-informed design prior significantly improves test accuracy in the few-trial regime, and can be very useful in environments that are where computationally constrained. Even if we increase the number of search trials to 30, AutoTransfer still demonstrates non-trivial improvement compared with TPE, indicating that our proposed pipeline has advantages even when computational resources are abundant. Notably, with only 3 search trials, AutoTransfer surpasses most of the baselines, even those that use 30 trials.

To better understand the sample efficiency of AutoTransfer, we plot the best test accuracy found at each trial in Figure 3 for OGB-Arxiv and TU-PROTEINS datasets. We notice that the advanced search algorithms (Evolution and TPE) have no advantages over random search at the few-trial regime since the amount of prior search data is not yet sufficient to infer potentially better design configurations. On the contrary, by sampling from the transferred design prior, AutoTransfer achieves significantly better average test accuracy in the first few trials. The best test accuracy at trial 3 of AutoTransfer surpasses its counterpart at trial 10 for every other method.

### Analysis of Task Embeddings

**Qualitative analysis of task features.** To examine the quality of the proposed task features, we visualize the proposed task similarity matrix (Figure 4 (b)) along with the task similarity matrix (Figure 4 (a)) proposed in GraphGym. We show that our proposed task similarity matrix captures similar patterns as GraphGym's task similarity matrix while being computed much more efficiently

\begin{table}
\begin{tabular}{c|c c c|c c c} \hline \hline  & \multicolumn{3}{c|}{Node} & \multicolumn{3}{c}{Graph} \\ Method & Physics & CoraFull & OGB-Arxiv & COX2 & IUBB & PROTEINS \\ \hline GCN (30 trials) & 95.88\(\pm\)0.16 & 67.12\(\pm\)0.52 & 70.46\(\pm\)0.18 & 79.23\(\pm\)2.19 & 50.40\(\pm\)3.02 & 74.84\(\pm\)2.82 \\ GAT (30 trials) & 95.71\(\pm\)0.24 & 65.92\(\pm\)0.68 & 68.82\(\pm\)0.32 & 81.56\(\pm\)4.17 & 49.67\(\pm\)4.30 & 75.30\(\pm\)3.72 \\ GraphNAS (30 trials) & 92.77\(\pm\)0.84 & 63.13\(\pm\)3.28 & 65.90\(\pm\)2.64 & 77.73\(\pm\)4.04 & 46.93\(\pm\)3.94 & 72.51\(\pm\)3.36 \\ DARTS & 95.28\(\pm\)1.67 & 65.79\(\pm\)2.85 & 69.02\(\pm\)1.18 & 79.82\(\pm\)3.15 & 50.26\(\pm\)4.08 & 75.04\(\pm\)3.81 \\ GASSO4  & 96.38 & 68.89 & 70.52 & - & - & - \\ \hline Random (3 trials) & 95.16\(\pm\)0.55 & 61.24\(\pm\)4.04 & 67.92\(\pm\)1.92 & 76.88\(\pm\)3.17 & 45.79\(\pm\)4.39 & 72.47\(\pm\)2.57 \\ TPE (30 trials) & 96.41\(\pm\)0.36 & 66.37\(\pm\)1.73 & 71.35\(\pm\)4.04 & 82.27\(\pm\)2.00 & 50.33\(\pm\)4.00 & 79.46\(\pm\)1.28 \\ HyperBand (30 trials) & 96.56\(\pm\)0.30 & 67.75\(\pm\)1.24 & 71.60\(\pm\)0.36 & 82.21\(\pm\)1.79 & 50.86\(\pm\)3.45 & 79.32\(\pm\)1.16 \\ \hline \hline
**AutoTransfer (3 trials)** & 96.64\(\pm\)0.42 & 69.27\(\pm\)0.76 & 71.24\(\pm\)0.39 & 82.13\(\pm\)1.59 & 52.33\(\pm\)2.13 & 77.81\(\pm\)2.19 \\
**AutoTransfer (30 trials)** & 96.91\(\pm\)0.27 & 70.05\(\pm\)0.42 & 72.21\(\pm\)0.27 & 86.52\(\pm\)1.58 & 54.93\(\pm\)1.23 & 81.25\(\pm\)1.17 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Performance comparisons of AutoTransfer and other baselines. We report the average test accuracy and the standard deviation over ten runs. With only 3 trials AutoTransfer already outperform most SOTA baselines with 30 trials.

Figure 3: Performance comparisons in the few-trial regime. At trial \(t\), we plot the best test accuracy among all models searched from trial \(1\) to trial \(t\). AutoTransfer can reduce the number of trials needed to search by an order of magnitude (see also Table 4 in Appendix).
by omitting training. We notice that the same type of tasks, _i.e._, node classification and graph classification, share more similarities within each group. As a sanity check, we examined that the closest task in the bank with respect to CoraFull is Cora. The top 3 closest tasks for OGB-Arxiv are AmazonComputers, AmazonPhoto, and CoauthorPhysics, all of which are node classification tasks.

**Generalization of projection function \(g(\cdot)\).** To show the proposed projection function \(g(\cdot)\) can generate task embeddings that can generalize to novel tasks, we conduct leave-one-out cross validation with all tasks in our task-model bank. Concretely, for each task considered as a novel task \(T^{(n)}\), we use the rest of the tasks, along with their distance metric \(d_{g}(\cdot,\cdot)\) estimated by GraphGym's exact but computationally expensive metric space, to train the projection function \(g(\cdot)\). We calculate Kendall rank correlation over task similarities for Task Feature (without \(g(\cdot)\)) and Task Embedding (with \(g(\cdot)\)) against the exact task similarities. The average rank correlation and the standard deviation over ten runs is shown on Figure 4 (c). We find that with the proposed \(g(\cdot)\), our task embeddings indeed correlate better with the exact task similarities, and therefore, generalize better to novel tasks.

**Ablation study on alternative task space design.** To demonstrate the superiority of the proposed task embedding, we further compare it with alternative task features. Following prior work (Yang et al., 2019), we use the normalized losses over the first 10 steps as the task feature. The results on OGB-Arxiv are shown in Table 2. Compared to AutoTransfer's task embedding, the task feature induced by normalized losses has a lower ranking correlation with the exact metric and yields worse performance. Table 2 further justifies the efficacy of using the Kendall rank correlation as the metric for task embedding quality, as higher Kendall rank correlation leads to better performance.

## 6 Conclusion

In this paper, we study how to improve AutoML search efficiency by transferring existing architectural design knowledge to novel tasks of interest. We introduce a _task-model bank_ that captures the performance over a diverse set of GNN architectures and tasks. We also introduce a computationally efficient _task embedding_ that can accurately measure the similarity between different tasks. We release GNN-Bank-101, a large-scale database that records detailed GNN training information of 120,000 task-model combinations. We hope this work can facilitate and inspire future research in efficient AutoML to make deep learning more accessible to a general audience.

\begin{table}
\begin{tabular}{c|c c} \hline \hline  & Kendall rank correlation & Test accuracy \\ \hline Alternative: Normalized Loss & -0.07\(\pm\)0.43 & 68.13\(\pm\)1.27 \\ AutoTransfer’s Task Feature & 0.18\(\pm\)0.30 & 70.67\(\pm\)0.52 \\ AutoTransfer’s Task Embedding & 0.43\(\pm\)0.22 & 71.42\(\pm\)0.39 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Ablation study on the alternative task space design versus AutoTransfer’s task embedding. We report the average test accuracy and the standard deviation OGB-Arxiv over ten runs.

Figure 4: (a) GraphGym’s task similarity between all pairs of tasks (computed from the Kendall rank correlation between performance rankings of models trained on the two compared tasks), a higher value represents a higher similarity. (b) The proposed task similarity computed by computing the dot-product between extracted task features. (c) The Kendall rank correlation of similarity rankings of the other tasks with respect to the central task between the proposed method and GraphGym.
## Acknowledgements

We thank Xiang Lisa Li, Hongyu Ren, Yingxin Wu for discussions and for providing feedback on our manuscript. We also gratefully acknowledge the support of DARPA under Nos. HR00112190039 (TAMI), N660011924033 (MCS); ARO under Nos. W911NF-16-1-0342 (MURI), W911NF-16-1-0171 (DURIP); NSF under Nos. OAC-1835598 (CINES), OAC-1934578 (HDR), CCF-1918940 (Expeditions), NIH under No. 3U54HG010426-04S1 (HuBMAP), Stanford Data Science Initiative, Wu Tsai Neurosciences Institute, Amazon, Docomo, GSK, Hitachi, Intel, JPMorgan Chase, Juniper Networks, KDDI, NEC, and Toshiba. The content is solely the responsibility of the authors and does not necessarily represent the official views of the funding entities.