Year: 2019

Abstract:
Graph Neural Network (GNN) is a popular architecture for the analysis of chemical molecules, and it has numerous applications in material and medicinal science. Current lines of GNNs developed for molecular analysis, however, do not fit well on the training set, and their performance does not scale well with the complexity of the network. In this paper, we propose an auxiliary module to be attached to a GNN that can boost the representation power of the model without hindering the original GNN architecture. Our auxiliary module can improve the representation power and the generalization ability of a wide variety of GNNs, including those that are used commonly in biochemical applications.

heading: 1 INTRODUCTION
text: Recently, Graph Neural Network (GNN) is a popular choice of model in the analysis of molecular datasets in medicinal and material science. Many molecular datasets consist of molecular graphs with feature vectors associated to each atom, and numerous methods based on GNN has been proposed to date just for learning the features of chemical molecules (Wu et al., 2018; Duvenaud et al., 2015; Kearnes et al., 2016; Li et al., 2017; Gilmer et al., 2017; Shang et al., 2018), such as those pertaining to electrical conductivity and toxicity. One problem in the application of GNN to molecular datasets is the difficulty in reducing the training loss. Unlike in the applications of Deep Neural Networks (DNNs) to image datasets, the training loss of GNN on molecular dataset does not decrease consistently with the number of layers nor number of nodes per layers (cf. Fig. 4 in the appendix, thin dashed lines), and this seems to happen to numerous GNN architectures that are used in applications today (Duvenaud et al., 2015; Li et al., 2016; Kipf & Welling, 2017; Xu et al., 2019; Busbridge et al., 2018). Unfortunately, many strong techniques developed for deep CNNs such as ResNet (He et al., 2016) cannot be applied naively to GNN, because the tasks for GNNs are oftentimes fundamentally different in nature from that of standard DNN. For example, each graph data to be passed to the network can differ in size, and it is also often desired that GNN is equivariant (invariant under the reordering of vertices) in general. To the best of the authors’ knowledge, there have not been many studies done to date that directly addressed the problem of training loss.
In this study, we propose graph warp module (GWM), a supernode (Li et al., 2017; Gilmer et al., 2017; Battaglia et al., 2018) based auxiliary module that can be attached to generic GNNs of various types to improve its representation power. The I/O of the auxiliary module is defined independently from the GNN to which it is attached, and the users can install the GWM just by adding a small segment of code.
Our GWM consists of three major components. The first component is virtual supernode (Li et al., 2017; Gilmer et al., 2017), which communicates with all nodes in the graph and promotes the remote message passing. The second and third components are attention unit (Vaswani et al., 2017; Veličković et al., 2018) and gating units (Cho et al., 2014). These adaptive weighting functions in the module help to adjust the flow of messages and deliver a message of appropriate strength to each node in the graph.
Our GWM can consistently improve the performance of various types of GNN on various types of dataset. In Fig. 1 we show the effect of GWM on the performance of four types of GNNs with the same embedding dimension and the same number of layers on four molecular graph datasets. As we
Reduction Ratio of Train Loss
Re d
uc tio
n Ra
tio o
f T es
t L os
s
0.2 0.4 0.80.6-0.2 0.0 1.0
0.2
0.4
0.6
0.0
0.8
1.0
NFP GGNN RSGCN GIN Tox21 HIV QM9 Lipo
DatasetGNN
Figure 1: Train loss reduction and test loss reduction achieved by GWM on various modeldataset pair. The shape of each point presents the dataset used, and the color of each point presents the GNN model used. The horizontal axis denotes the ratio of reduced training loss, and the vertical axis denotes that of the test loss. That the x-coordinate of a point is positive implies that the attachment of GWM improved the train performance for the corresponding model-dataset pair. That the ycoordinate of a point is positive implies that GWM improves the test-performance.
can see in the figure, the attachment of GWM reduces both train loss and test loss for all but three model-dataset pairs. The GWM provides not only more representation powers (less train loss), but also better generalization performances (less test loss) for various GNNs.
As we will show in section 4.4, we can further improve the positive effect of GWM using hyperparameter optimization softwares such as Optuna (Akiba et al., 2019).
Our contributions are as follows:
1. We introduce GWM, an auxiliary module that can help improve the representation power of the GNNs that are designed for the analysis of small graphs.
2. We show that the attachment of GWM can improve both the representation power and the generalization ability of various GNN models on many popular molecular graph datasets.

heading: 2 RELATED WORK

heading: 2.1 VIRTUAL SUPERNODE
text: A common challenge in the application of GNNs to a graphical dataset is the difficulty in propagating the information across remote parts of graphs. Previously proposed solutions include sub-sampling (Hamilton et al., 2017) and pooling of neighbor nodes (Ying et al., 2018). However, these clustering approaches are not too effective on the analysis of small graphs, in which every node can have a strong influence on the graph label.
In this study, we use supernode (Gilmer et al., 2017; Li et al., 2017; Pham et al., 2017) to promote the global propagation of the information in molecular graphs. By adding a supernode to a graph, we can allow any pair of nodes in the graph to communicate through the supernode in one hop. Battaglia et al. (Battaglia et al., 2018) discusses a framework of GNNs that generalizes the supernodeaugmented GNNs. One advantage of the supernode-based approach is that we can modify the network architecture while keeping the original GNN model intact. However, naive addition of a supernode to a graph can potentially lead to inadvertent over-smoothing of information propagation (c.f. (Li et al., 2018)). In our study, we therefore make the supernode a module by combining it with a gated message passing mechanism. This auxiliary module enables us to regulate the amount and type of information that is propagated through the feature space of the supernode.

heading: 2.2 MESSAGE PASSING AND ATTENTION/GATE MECHANISM IN GNN
text: The supernode in our GWM transmits information using the mechanism of message passing neural network (MPNN) (Gilmer et al., 2017), which is defined recursively as follows by composing multiple layers of the form:
h`,i = F` ({h`−1,j ; j ∈ N(i) ∪ {i}}) (1)
where i, j are indices of nodes in a graph. h`,i is the feature vector of the node i at the `th layer, N(i) is the neighborhood of the node i, and F` is an appropriate choice of function that updates the
feature vectors of the previous layer. That is, MPNNs work by passing the information of each node to its neighbors in a recursive manner. Various methods are proposed for the choice of F and for the method of pooling the information of the neighbors of each node (Schlichtkrull et al., 2017; Kipf & Welling, 2017; Li et al., 2016; Bruna & Szlam, 2014; Duvenaud et al., 2015).
Attention mechanism is a mechanism that helps the network regulate the importance of each node/edge in message passing (cf. (Wang et al., 2018)). A Relational GCN (Schlichtkrull et al., 2017) assumes that the aggregation weights of h`−1,j is fixed a priori in all F`. With such architectures, however, one cannot regulate the higher order correlation amongst the outputs from each node. Graph Attention Networks (GATs) (Veličković et al., 2018) introduce a self-attention mechanism (Vaswani et al., 2017), which is equipped with a trainable set of weights that controls the importance of edges for each node. The relational graph attention network (RGAT) (Busbridge et al., 2018) also builds upon GAT and constructed multiple types of attentions derived from relation-type-wise intermediate node representations. Finally, a GRU (Cho et al., 2014) is a gating mechanism originally introduced for recurrent neural networks. Gated Graph sequence Neural Networks (GGNN) (Li et al., 2016) are the first to apply GRUs to the GNNs, and their method aims to introduce a recurrence relation between successive layers. Although not in the form of super-node, a very recent paper (anonymous, 2019) uses a mechanism that combines GGNN and self-attention to capture both local and global relationships of a graph structure of program source codes. Our GWM is equipped with both multirelational attention mechanisms and GRUs to grant the module greater flexibility for the transmission of message between supernode and the bulk nodes.

heading: 3 GRAPH WARP MODULE
text: Our Graph Warp Module (GWM) is made of three building blocks: (1) a supernode, (2) a transmitter unit, and (3) a warp gate unit (Fig. 2). In a GWM-attached GNN, information is propagated across the graph through communication between the supernode and the original (main) GNN at each layer. Messages from the supernode and the main GNN are transmitted to the warp gate through the transmitter unit, and the results of the communication are passed back to the module/main network through the warp gate units. In this section, we describe the Graph Warp Module in detail, and present the motivation of our design.

heading: 3.1 PREMISE: VANILLA GNN AND ITS I/O
text: Before describing our GWM, we need to present the I/O notation for the family of GNNs we consider, and explain how they will be used when a GWM is attached to a GNN. We denote an arbitrary
graph with the edge set E and the node set V as G = (V,E). We will label the nodes in V as i = 1, 2, ...|V |, and represent each edge as a pair of nodes in V . The adjacency matrix A ∈ R|V |×|V | is a matrix whose (i, j)th entry is the weight assigned to the edge between the node i and the node j. Each instance of data passed to the GNN is a set of input feature vectors. We denote an input feature vector associated with node i as xi. The type of GNN that we consider computes the output recursively by applying a composition of smooth functions F` to xis. With the understanding that xj = h0,j , let h`,i = F`−1,i(h`−1,j ; j ∈ V ) ∈ Rd be the vector of features to be assigned to the ith node by the `th layer of the GNN. When the GNN is operating on its own without the attachment of a GWM, the GNN updates a feature vector using h`,i = F`−1,i(h`−1,j ; j ∈ V ) ∈ Rd. Finally, the GNN reports some form of the aggregation of {hL,i; i ∈ V } as the final Readout output. When a GWM is attached to the GNN, the main(bulk) GNN is requested to report F`−1,i(h`−1,j ; j ∈ V ) ∈ Rd as the message from the `− 1th main layer to the module, where it is treated as an element in the intermodule hyperspace and is mixed with the transmission from the supernode. The GWM will return the mixed message h` back to the `th layer of the main GNN. At the same time, the GWM requests a transmission message from the main GNN to the `th supernode. The module will mix the transmission and the message from the `− 1th supernode and return the mixed message g` to the `th supernode. The final output is produced by aggregating {hL,i; i ∈ V } and gL.

heading: 3.2 SUPERNODE
text: A supernode is a special node that is connected to nodes in the original graph to promote global information propagation across the network (Fig. 2). A supernode is to be prepared for each `th layer of the main GNN, and we associate a feature vector g` to the supernode at the `th layer. At each layer, the transmitter requests the following from the supernode: (1) a message G` (g`) for the `+ 1th layer and (2) a transmission to the main network, where G` is an appropriate choice of a smooth function.
Because a supernode is a superficial variable, we must initialize g0 manually. For instance, we can use some form of aggregation of the global graph features (e.g. a number of nodes or edges, graph diameter, girth, cycle number, min, max, histogram, or an average of input node features, . . . ). A detailed example of the aggregated feature is presented in the appendix.

heading: 3.3 TRANSMITTER UNIT
text: The transmitter unit handles the communications between the main GNN module and the GWM (Fig. 3). The transmitter module is responsible for translating the messages from the recipient into a form that can be mixed in the intermodule hyperspace. We will use multiple types of messages and thus use a separate attention mechanism for each type of message. Before transmitting messages from the main GNN to the supernode, the transmitter uses the K-head attention mechanism to aggregate messages of each type. We enumerate the components included therein:
• mmain→super`,k : aggregated message of head k from the main GNN to the supernode at layer `.
• hmain→super` : transmission from the main GNN to the supernode, derived from m main→super `,k .
• gsuper→main` : transmission from the supernode to the main at layer `.
The transmissions are to be constructed from the following set of equations. For a vector v, we use vm:n ∈ R(m−n)d to denote the concatenation of the vectors vm, vm+1, ... ∈ Rd. Throughout, we use capital letters to denote the trainable coefficients.
hmain→super` = tanh ( W` m main→super `,1:k ) ∈ RD ′ , (2)
mmain→super`,k = ∑ i α`,i,kU`,kh`−1,i ∈ RD ′ , (3)
α`,i,k = softmax ( hT`−1,iA`,kg`−1 ) ∈ (0, 1) , (4)
where α`,i,k denotes an attention weight of the ith node at the kth head (type) and the lth layer.
The transmission from the supernode to the main is simply given by:
gsuper→main` = tanh (F`g`−1) ∈ R D. (5)
There is no analogue of m for the supernode because we are not considering a set of messages of different types to be transmitted from the supernode.

heading: 3.4 WARP GATE
text: The warp gate is responsible for merging the transmitted messages and for passing the results to the supernode and the main network through self recurrent units. The gate uses warp gate coefficients to control the mixing-rate of the messages. The components of the warp Gate are:
• h0` : inputs to the GRU unit at `th layer that transmits the message to the main GNN. • g0` : inputs to the GRU unit at `th layer that transmits the message to the supernode.
• ĥ`,i: the message F`−1,i(h`−1,k; k ∈ V ) ∈ RD from the `− 1th layer of the main network, expressed in the intermodule hyperspace.
• ĝ`: the message G`−1 (g`−1) ∈ RD ′
from the `− 1th supernode, where G is an appropriate smooth function with outputs in the intermodule hyperspace.
• z`,i: tensor of warp gate coefficients for the transmission from the supernode to the main GNN.
• z(S)`,i : tensor of warp gate coefficients for the transmission from the main GNN to the supernode.
The module then mixes the transmissions and the messages from the previous layer by applying the following gated interpolations:
h0`,i = (1− z`,i) ĥ`−1,i + zl,i g super→main ` ∈ R D , (6)
g0` = z (S) ` h main→super ` + (1− z (S) ` ) ĝ` ∈ R D′ , (7) z`,i = σ ( H`h̃`,i +G`g super→main ` ) , z (S) ` = σ ( H (S) ` h main→super ` +G (S) ` ĝ` ) , (8)
where σ is a nonlinear function whose range lies in [0, 1]. Finally, the warp gate returns the mixed messages to the main GNN and the supernode through gated recurrent unit (GRU) s:
h`,i = GRU ( h`−1,i, h 0 `,i ) ∈ RD , g` = GRU ( g`−1, g 0 ` ) ∈ RD ′ . (9)
As for the structure of GRU, we used the original design introduced by (Cho et al., 2014).
As we will show with ablation studies (Sec. 4.4), every component of GWM is essential in making the module work. The Attention coefficients (Eqs.(3,4)) are important because the amount and the type of information that must be transmitted to remote nodes may differ for different nodes. The Gating coefficients (Eqs.(6-8)) are important because we want to regulate the transmission from each
node in the graph to the supernode and vice versa. We use different recurring units (Eq.9) for the transmission from the module to the supernode and the transmission from the module to the main network for each layer because the amount of the information that must be reinforced may differ for the main network and the supernode at each layer.

heading: 3.4.1 COMPUTATIONAL COMPLEXITY
text: Let V be the vertex set, K be the number of attention heads, and D be the dimension of the node embedding. Then the additional computational cost incurred by the attachment of GWM is at most O(|V |KD2). As for the actual computation time, GWM attached module consumes approximately double the time of the original unattached version.

heading: 4 EXPERIMENTS
text: In this section, we present our experimental results on multiple molecular graph datasets, testing the efficacy of the GWM for graph regression tasks and graph classification tasks.

heading: 4.1 DATASETS
text: We used four datasets collected in MoleculeNet (Wu et al., 2018). These datasets are described in the SMILES string format, which admits the graph representations we described above. For details, please see (Wu et al., 2018).
For the graph regression tasks, we used the QM9 dataset and the Lipophilicity (LIPO) dataset. QM9 is a dataset with numerical labels, containing about 133K drug-like molecules with 12 important chemical-energetic, electronic, and thermodynamic properties, such as HOMO, LUMO, and electron gaps. The LIPO dataset is another numeric-valued dataset, containing the solubility values of roughly 4K drug molecules. Each instance of data in these datasets is a pair of a molecular graph and a numerical value(s): the 12 chemical properties in the QM9 dataset, and the solubility in the LIPO dataset. For both datasets, the task is to predict the numerical value(s) from the molecular graph. We evaluated the performance of the models using mean absolute errors (MAEs). We report the averaged MAE over 12 sub-tasks (properties) for QM9.
For the graph classification tasks, we used the Tox21 and the HIV datasets. The Tox21 dataset contains about 8K pairs of molecular graph and 12 dimensional binary vector that represent the experimental outcomes of toxicity measurements on 12 different targets. The HIV dataset contains roughly 42K pairs of molecular graph and binary label that represent the medicinal effect of the molecule. For these datasets, the task is to predict the binary label(s) from the molecular graph. For these tasks, we use ROC-AUC values as a measure of performance. We report the averaged ROC-AUC over 12 sub-tasks (targets) for Tox21.
Throughout, we used the train/validation/test data splits of the “scaffold” type, which is considered by (Ruddigkeit et al., 2012; Ramakrishnan et al., 2014) as the difficult type for test predictions. Please find the appendix for details.

heading: 4.2 CHOICES OF THE MAIN GNN MODELS AND IMPLEMENTATIONS
text: We test GWMs on various GNN models. Neural Fingerprints (NFP) (Duvenaud et al., 2015) and Weavenet (Kearnes et al., 2016) are relatively classical baselines. A Gated Graph Neural Network (GGNN) (Li et al., 2016) is a strong GRU-based GNN. Renormalized Spectral Graph Convolutional Network (RSGCN1) (Kipf & Welling, 2017), a popular GNN model approximating a CNN for graphs (Defferrard et al., 2016). The relational graph attention network (RGAT) (Busbridge et al., 2018) uses multiple attention mechanisms for a set of edge types. Graph Isomorphism Network (GIN) (Xu et al., 2019) employs multi layer perceptrons within each layer for richer transformations.
We implement all models in Chainer (Tokui et al., 2015). In the readout layer, we first aggregate all information from the main nodes in the same way as in the original paper, concatenated the result with the features from the supernode, and passed the concatenated tensor to a fully connected layer.
1Referred as RSGCN in Chainer-Chemistry package, but often simply referred as “GCN” in several papers.
For evaluation, we used a softmax cross entropy for classification tasks and a mean squared error for regression tasks. We use a fixed set of hyperparameters throughout the study.
All models were trained with Adam (Kingma & Ba, 2015). We report the results of the model snapshots of the epoch for which the best validation score was achieved. For implementation details including readouts and hyperparameters, please read the appendix.

heading: 4.3 TRAINING AND TEST LOSS REDUCTION
text: We explain the details of the experiment that produced the result presented in Fig. 1. For this experiment, we reported the average r̄ of the loss reduction ratio r = L−L (+)
‖L‖ for both training loss
and test loss over 10 runs. L denotes the loss of the vanilla model, and L (+) denote the loss of the GWM-installed model. r̄train denotes a reduction ratio of the training loss, and r̄test denotes a reduction ratio of the test loss.
Fig. 1 is the scatter plot of the (r̄train, r̄test), with the dotted slope representing r̄train = r̄test. For all GNNs and datasets, we set L = 3 and D = 50. As we can see in the plot, r̄trains were negative for the two GNNs in the HIV dataset (blue and brown circles). r̄train for GGNN on QM9 (blue cross) was a very small negative value). For the other 13 (model-dataset) pairs, the attachment of GWM consistently reduces the training loss( i.e. improves the fit to the training graph datasets. ) Remarkably, 15 out of 16 pairs had positive r̄tests: the GWM improved generalization performances in most cases. It is worthy of note that r̄train and r̄test are positively correlated in this scatter plot. We were able to obtain similar results for all other choices of hyperparameters we tested. For the results with different hyperparameter values, see the appendix. This result implies that our GWM has the general effect of improving the generalization performance by augmenting the representation power of the main GNN.

heading: 4.4 EFFECT OF THE GWM ON THE REPRESENTATION POWER OF MODEL SPACE
text: In the second experiment, we studied the effect of GWM on the representation power of GNN models. To compare the GWM-augmented GNNs with their vanilla GNN counterparts on fair grounds, we used Bayesian optimization to optimize the number of layers and the dimension of feature vectors for each model-dataset pair we tested. Hyperparameters are optimized via the Optuna (Akiba et al., 2019) library.
We conducted a set of ablation studies to investigate the effect of (1) attention mechanism, (2) Gating mechanism, and (3) the Recurrent unit. We used two ablation models. Simple supernode model is a supernode without attention, gatings, and GRU functions. This ablation model can be considered a variant of (Pham et al., 2017)’s supernode model in which the supernode and the bulk networks communicate with each other in bidirectional manner. This model can be also considered as an extended version of supernode proposed in (Li et al., 2017).
NoGate GWM is a GWM without gatings, and it lacks GRU for the main GNN.
Table 1 summarizes the details of our ablation studies. For the detailed formulations of the two ablation models, please see the appendix.
Table 2 and Table 3 respectively present the MAEs on the regression tasks and the ROC-AUCs for the classification tasks, averaged over 10 random runs. In the tables, bold faces indicate the improvements from the vanilla GNN and asterisks indicate the best model among supernode models
for each (dataset, GNN) pair. Full tables with standard deviations are presented in the appendix. As we can see in the tables, the proposed GWM improves the generalization performances for 23 out of 24 (model-dataset) pairs. These results suggest that the proposed (full) GWM can improve GNNs’ performances irrespective of the choice of GNN models and the dataset.
A few words of caution are in order here. Two ablation models did not improve the generalization of GNNs for the QM9 and the HIV datasets (see the column “# Improved”). This suggests an appropriate combination of attentions, gatings, and GRUs is essential in making the supernode effective for the analysis of molecular graph datasets.
We shall emphasize that the goal of this study is not to find the specific network architecture that achieves the states of the art performance for selected datasets2. Instead, the goal of our work is propose an attachable module that improves the representation power and a generalization performance irrespective of the choice of GNN architecture. As we can see in the presented result, the attachment of GWM improves the result in most cases; one of the results of our GWM attached model for Tox21 is actually SOTA (0.787, achieved by GWM attached RGAT).

heading: 5 CONCLUSION
text: For a generic DNN, numerous effective installable modules have been proposed for the improvement of the model (e.g. (Srivastava et al., 2014; Ioffe & Szegedy, 2015; Miyato et al., 2018; He et al., 2016)). The proposed GWM is the first of its kind to be installed to a generic GNN as an auxiliary module. Experimental results show that the GWM can generally improve the representation power as well as the generalization performance of a GNN, irrespective of the choice of GNN architecture and the molecular graph datasets. We would like to emphasize that the choice of the internal structure of GWM is not limited to the ones we described in this study, and that there are possibly numerous ways to construct a GWM-like module. For example, there is no provable justification for the use of a linear transformation in the transmissions or a bilinear form in the attention coefficients α. Effective choices of supernode features are also open to further research. Our study can possibly open an entirely new avenue for the architectural study of GNNs.
2For example, Yang et al. (2019) and Li et al. (2017) achieve the SotA AUCs (0.776) of GNNs on the HIV dataset.

heading: A OUR FORMULATION OF RGAT
text: Apart from the original RGAT (Busbridge et al., 2018), we have developed a similar GNN in a slightly different formulation. Followings are our RGAT formulation:
h`+1,i = tanh ( WlconcatKk=1h̃`,i,k ) , (10)
h̃`,i,k = F`,kh`,i + ∑ j∈Ni αi,j,kG`,kh`,j , (11)
αi,j,k = softmax ( a ( h`,i, h`,j ;A`,k,ei,j )) . (12)
a ( h`,i, h`,j ;A`,k,ei,j ) = hT`,iA`,k,ei,jh`,j . (13)
W,F,G,A are the coefficient matrix to be tuned. ` is the index of the layer up to L, k is the index of the attention head up to K, i, j are the index of the nodes up to N , ei,j = r is the index of the edge type up to R.
The main point is the edge type information in Eq.13. The edge type ei,j = r switches the weight matrix of the attention similarity function, a. This means that the associations between nodes should be computed dependent on the edge type. This is a natural assumption for chemical molecular graphs. Typically we have multiple bond types between nodes = atoms: single-bond, double-bound, triple-bond, and the aromatic ring. It is natural to assume that interactions between atoms are affected by the bond types among the atoms.
The main differences from the original RGAT lie in the Eq.11. The original RGAT assumes that the weight matrix G is also dependent on the edge type (G`,k,ei,j ) while we omit this dependency. Also, the original RGAT does not provide a self-link weight matrix F while we do. We made these changes based on our preliminary experiments. We found our formulation is better than the original RGAT formulation in the MoleculeNet dataset, in terms of the training stability and the generalization performances.
Another difference is the choice of the attention function. In our formulation, the attention similarity measure a(·) is defined by the general attention in (Luong et al., 2015) while the original GAT (Veličković et al., 2018) and the RGAT (Busbridge et al., 2018) employed a simpler concat attention.

heading: B OUR IMPLEMENTATION OF GIN
text: We implement the simplest GIN: 2-layer MLP with ReLU activation for each layer and a bias parameter fixed at 0. We regularize GIN with dropout (Srivastava et al., 2014), instead of batchnormalization (Ioffe & Szegedy, 2015). This is because the batch-normalization of the ChainerChemistry library did not correctly treat the padded node elements in the minibatches when we conducted the experiments.

heading: C EXPERIMENTS DETAILS: GENERAL ISSUES

heading: C.1 GRAPH DATA REPRESENTATION
text: All datasets used in our experiments are taken from the MoleculeNet(Wu et al., 2018). Four used datasets are provided in the SMILES format. A SMILES format is a line notation for describing the
structure of chemical compounds. We decode a SMILES molecular data into a graph representation of the molecule. A node in the graph corresponds to an atom. Each atom node is associated with the symbolic label of the atom name (“H”, “C”, ...). An edge in the graph corresponds to a bond between atoms. Each bond edge is associated with the bond type information (single-, double-, ....).
Given the graph, we extract input feature vectors for node xi and that of supernode x′. xi, the input feature vector for the node i is a D-dimensional continuous vector, which is an embedded vector of the one-hot atom label vector with a trainable linear transformation. X ′, The input feature vector for the supernode is a D′-dimensional continuous vector, which again is an embedded vector of some graph-global features with a trainable linear transformation. Choices for the graph-global features are detailed in the following section.
The edge information is converted in an adjacency matrix, A .

heading: C.2 EXPLICIT FEATURES FOR SUPERNODE
text: Since the supernode does not exist in the original graph G, we have no observable cues for the supernode. For simplicity, we propose to use an aggregation of node features, such as:
• Histograms of discrete labels attached to original nodes • Averages, maximums, minimums, or medians of numerical attributes attached to original
nodes
• Histograms of edge types if the graph is multiple relational graph. • Number of nodes, graph diameters, modularity, and other simple statistics for graph structure.
We can augment the super feature vector x′ if some additional information about the graph is provided. Essentially, these simple aggregations of the feature vectors do not bring new information into the network. However we found that the graph-wise super feature input boosts the performance of the learned network model.

heading: C.3 DATA SPLITS
text: In chemical datasets, a totally random shuffling of samples into train/val/test subsets is not always a valid way of data splitting. Therefore MoleculeNet provides several ways of data splitting. The “random” split is the random sample shuffling that are most familiar to the machine learning community. The “scaffold” split separate samples based on the molecular two-dimensional structure. Since the scaffold split separates structurally different molecules into different subsets, “it offers a greater challenge for learning algorithms than the random split” (Wu et al., 2018). Throughout the paper, we adopt the scaffold split to assess the full potential of the GWM-attaching GNNs.
The actual construction of the scaffold split train/validation/test subsets has a freedom of algorithm choices. We basically adopted the algorithm provided by the deepchem3 library, which is the standard split algorithm for many papers. However, for the experiment of train/test loss comparison, we adopted the algorithm provided by the Chainer Chemistry library.

heading: C.4 READOUT LAYER
text: In many applications of GNNs users may expect a single fixed-length vector representing the characteristics of the graph G. So we add the ’readout’ layer to aggregate the original node hidden states {H`} and the global node hidden states {g`}. A main issue in the readout unit is how to aggregate the original nodes, whose number varies for each graph. A simple way is to take an arithmetic average (sum) of the hs at the L-th layer, but we can also use a DNN to compute (non-linear) “average” of hs (Li et al., 2016; Gilmer et al., 2017). After the aggregation of the node hidden states, we simply concatenate it with gs and apply some transformations to achieve the readout vector, r:
r = DNNr1 (concat [DNNr2 (HL) , gL]) . (14)
3https://deepchem.io/
In the above equation, DNNr1 is a multi-layer perceptron or a fully connected layer to mix the concatenated hidden vectors. We adopted a simple fully-connected layer for DNNr1 in this paper. DNNr2 is a specific readout unit accompanied with a original GNN to aggregate variable-length HL.

heading: C.5 OPTIMIZER
text: All models were trained with Adam (Kingma & Ba, 2015), α = 0.001, β1 = 0.9, and β2 = 0.999.

heading: C.6 ABLATION MODELS FORMULATION
text: Here we detail the formulation of the ablation models used in the main comparison experiments (Sec. 4.4).
As written in the main manuscript, we formulate the two ablation models (Table 1) as follows. A simple supernode model is an ablation model without attentions, gates, nor the GRUs, and it can be considered as a variant of (Li et al., 2017; Pham et al., 2017) with bidirectional communication between the supernode and the bulk, omitting all attentions and gates. First, there is no attention for the Transmitter. So the message from the main nodes to the supernode is just a sum of hidden vectors, h`−1,::
hmain→super` = tanh ( W` ∑ i h`−1,i ) ∈ RD ′ . (15)
Originally there is no messages from the supernode to the main GNN in (Li et al., 2017), but we allow such a simple message in this ablation model:
gsuper→main` = tanh (F`g`−1) ∈ R D′ . (16)
Messages are merged by simple linear combinations, instead of gates and GRUs, following (Li et al., 2017):
h`,i = Z`,1ĥ`,i + Z`,2g super→main ` ∈ R D , (17) g` = Z (S) `,1 h main→super ` + Z (S) `,2 ĝ` ∈ R D′ . (18)
We find it difficult to fully recover the supernode of (Gilmer et al., 2017) since their description on the supernode is quite limited. Thus, a NoGate GWM model, which surrogates (Gilmer et al., 2017), only capture the essence of their supernode: no gatings for merger, and GRU is not installed for the nodes of the main GNN. In this model, we use the same attention-based Transmitter unit as in Eqs.(2-6). We reduce the adaptive gatings in the Warp unit by a simple averaging, and omit the GRU for h`,i.
h0`,i = Z`,1ĥ`−1,i + Z`,2g super→main ` ∈ R D , (19)
g0` = Z (S) `,1 h main→super ` + Z (S) `,2 ĝ` ∈ R D′ , (20)
h`,i = h 0 `,i ∈ RD , (21) g` = GRU ( g`−1, g 0 ` ) ∈ RD ′ . (22)

heading: C.7 HYPERPARAMETER
text: We fix a part of hyperparameters throughout the experiments, which does not influence performances so much: the number of heads in all multi-head attention mechanisms toK = 8, and usedR = 4 edge types for the multi-relational mechanism in all models. Also, at every layer, we set the dimension of the supernode feature to be the same as that of the features of the nodes in the main GNN.
In the next section, we list the other hyperparameters (the number of layers L, the dimension of feature vectors D(= D′)) used in several experiments/figures, as well other experimental/implementation details.

heading: C.8 COMPUTATIONAL ENVIRONMENT
text: We use a single GPU (mainly nvidia Tesla V100) for an experimental run. A run roughly takes 1 hour to 1 day, depending on the hyperparameters and the GNN models.

heading: D EXPERIMENTS DETAILS: FOR EACH EXPERIMENT
text: In this section, we report details for each experiment, including the chosen hyperparameters and additional results.

heading: D.1 TRAINING LOSS BEHAVIORS OVER NUMBER OF LAYERS AND EMBEDDING DIMENSIONS
text: We used the Tox21 dataset to confirm behaviors of training losses, mentioned in the first paragraph of the introduction (Fig. 4).
To study the effect of the number of layers L (the left panel), we fixed the dimension D = 32. To study the effect of the feature vector dimensions D (the right panel), we fixed the number of layers L = 4.
All models are trained for 30 epochs.
Thinner dashed lines in Fig. 4 plot the training losses of original networks (w/o GWM). Thick solid lines in Fig. 4 plot the training losses of networks augmented with GWM. In general, GWM has an effect of decreasing the training loss for most choices of numbers of layers and dimensions of the node feature vectors, for all GNNs. In general, similar results are obtained from the other three datasets so we omit these figures.

heading: D.2 SECTION 4.3: TRAIN AND TEST LOSS REDUCTION
text: In the experiment in the Section 4.3 (Fig. 1), we align the hyperparameters including L,D among a vanilla GNN and its GWM-installed counterpart, to compare the loss function values. We used four datasets. For each dataset, we fixed L and D for all GNN models to compare the loss reduction performances.
In Fig. 1, L = 3 and D = 50 for all GNNs and datasets. In preliminary experiments, we manually changed Ls (∈ {2, 3, 4}) and Ds (∈ 32, 50, 100, 150) in some extent, but found the overall tendency of the scatter plots does not dramatically change. This is partially understood from the Figure 1 in the main manuscript: the loss curves of the vanilla GNNs and their GWM-augmented counterparts evolve in roughly parallel. This implies the ratios of loss reductions are not so much dependent on the hyperparameter choices.
Here we show the results of other hyperparameter settings. All cases we observe the similar plot patterns.
Fig. 5 is the scatter plot of the (r̄train, r̄loss), L = 3 and D = 32. In this case, two HIV dataset plus one case for QM9 reported the increase of the training loss. For other 13 pairs, the GWM successfully reduce the training losses. It is remarkable that all 16 plots have positive test loss reduction rates: namely, the generalization performances are improved by the GWM in this choice of the hyperparameters.
Fig. 6 is the scatter plot of the (r̄train, r̄loss), L = 4 and D = 100. In this case, only two cases of the HIV datasets record the negative r̄train values. For other 14 pairs, the GWM successfully reduce the training losses and 13 out of these 14 pairs have positive r̄tests.
All models were trained for 30 epochs.

heading: D.3 SECTION 4.4: THE FULL COMPARISON
text: For the experiments in the Section 4.3 (Table 2 and 3 in the main manuscript), we employed the Bayesian optimization to tune L and D for each combinations of a dataset and a GNN model. The Bayesian optimization (BO) trials were conducted by the Optuna library, with 200 sampling (searches) for each combination. Ranges of the BO search is: 2 ≤ L ≤ 8, 4 ≤ D ≤ 512. Chosen Ls and Ds are presented in the Table 4.
Note that GWM-attached GNNs tend to perform better with deeper architecture (i.e larger L), when the vanilla GNNs without GWM do not change its overall performance with the number of layers (Table 4). The performance of the GWM-attached models often improve with the number of layers until the model depth reaches quite a large number ( 8) (e.g. [QM9, GGNN+Proposed GWM], [HIV, GIN+Proposed GWM]). Out of 24 pairs (=4 datasets × 6 GNN models), 11 pairs perform better with deeper architecture when deployed with GWM.
For the QM9 dataset, we trained the models for 50 epochs. For the HIV and the Tox21 dataset, we trained the models for 100 epochs. For the LIPO dataset, we trained the models for 200 epochs.
Tables 5 and 6 are the full lists of the main comparison experiments in the main manuscript, with the standard deviation values in parentheses.
D at
as et
G N
N m
od el
N FP
W ea
ve N
et R
G A
T G
G N
N R
SG C
N G
IN
L IP
O va
ni lla
G N
N .6
77 (.0
40 )
1. 19
(.3 27
) .7
53 (.0
45 )
.5 82
(.0 22
) .8
01 (.0
14 )
.8 44
(.0 26 ) + Si m pl e Su pe rn od e .6 93 (.0 27 ) 1. 01 (.2 08 ) .7 40 (.0 32 ) .6 04 (.0 27 ) .7 75 (.0 11 ) .8 19 (.0 23 ) + N oG at e G W M .6 75 (.0 17 ) .7 21 (.2 25 ) .6 88 (.0 13 ) .5 76 (.0 22 ) .7 87 (.0 48 ) .8 47 (.0 48 ) + Pr op os ed G W M .6 72 * (.0 40 ) .6 88 * (.1 05 ) .6 59 * (.0 16 ) .5 69 * (.0 22 ) .7 52 * (.0 14 ) .7 84 * (.0 12
)
Q M
9 va
ni lla
G N
N 6.
16 (.2
31 )
6. 38
(.2 89
) 8.
96 (.1
92 )
4. 92
(.1 45
) 15
.2 (1
.0 5)
14 .0
(2 .4 7) + Si m pl e Su pe rn od e 7. 68 (.3 16 ) 5. 51 (.2 48 ) 9. 00 (.3 99 ) 5. 41 (.1 10 ) 14 .6 (1 .7 1) 11 .5 * (.7 55 ) + N oG at e G W M 6. 84 (.3 48 ) 5. 40 * (.2 38 ) 9. 21 (.3 68 ) 5. 52 (.3 44 ) 12 .5 (.5 64 ) 12 .9 (1 .3 2) + Pr op os ed G W M 6. 64 * (.3 60 ) 5. 90 (.2 48 ) 8. 39 * (.2 19 ) 4. 88 * (.2 31 ) 11 .9 * (1 .4 8) 11 .8 (1 .2 1)
Ta bl
e 5:
M A
Es on
th e
LI PO
da ta
se ta
nd Q
M 9
da ta
se t.
Th e
nu m
be ro
fl ay
er s
an d
th e
di m
en si
on of
th e
fe at
ur e
ve ct
or s
ar e
de fin
ed vi
a B
ay es
ia n
O pt
im iz
at io
n fo
re ac h m et ho d an d ea ch da ta se t. A ve ra ge s (s ta nd ar d de vi at io ns )o ve r1 0 ra nd om ru ns .S m al le rv al ue s ar e be tte r.
D at
as et
G N
N m
od el
N FP
W ea
ve N
et R
G A
T G
G N
N R
SG C
N G
IN
H IV
va ni
lla G
N N
.7 24
(.0 17
) .6
70 (.0
20 )
.7 07
(.0 39
) .7
46 (.0
18 )
.7 46
(.0 11
) .7
29 (.0
20 )
+ Si
m pl
e su
pe rn
od e
.7 07
(.0 23
) .6
76 (.0
31 )
.7 04
(.0 19
) .7
64 *
(.0 14
) .7
28 (.0
09 )
.7 29
(.0 25 ) + N oG at e G W M .7 14 (.0 18 ) .6 80 (.0 43 ) .7 26 (.0 24 ) .7 44 (.0 06 ) .7 42 (.0 19 ) .7 39 (.0 12 ) + Pr op os ed G W M .7 31 * (.0 20 ) .6 81 * (.0 10 ) .7 48 * (.0 19 ) .7 62 (.0 16 ) .7 58 * (.0 22 ) .7 55 * (.0 09 )
To x2
1 va
ni lla
G N
N .7
63 (.0
04 )
.7 10
(.0 29
) .7
44 (.0
08 )
.7 64
(.0 09
) .7
60 (.0
05 )
.7 40
(.0 07 ) + Si m pl e su pe rn od e .7 70 (.0 08 ) .7 50 (.0 20 ) .7 87 * (.0 05 ) .7 90 (.0 06 ) .7 70 * (.0 06 ) .7 63 (.0 06 ) + N oG at e G W M .7 75 * (.0 07 ) .7 64 (.0 11 ) .7 86 (.0 09 ) .7 92 * (.0 08 ) .7 59 (.0 07 ) .7 66 (.0 08 ) + Pr op os ed G W M .7 69 (.0 07 ) .7 67 * (.0 21 ) .7 87 * (.0 09 ) .7 85 (.0 05 ) .7 69 (.0 06 ) .7 68 * (.0 07 )
Ta bl
e 6:
R O
C -A
U C
s on
th e
H IV
da ta
se ta
nd To
x2 1
da ta
se t.
T he
nu m
be ro
fl ay
er s
an d
th e
di m
en si
on of
fe at
ur e
ve ct
or s
ar e
de fin
ed vi
a B
ay es
ia n
O pt
im iz
at io
n fo r ea ch m et ho d an d ea ch da ta se t. A ve ra ge s (s ta nd ar d de vi at io ns )o ve r1 0 ra nd om ru ns .L ar ge rv al ue s ar e be tte r.
Finally we present the detailed reports on the sub-tasks of QM9 and Tox21. These datasets consists of 12 sub-tasks and so far we reported the sub-task-averaged scores. Below we report the scores changes brought by GWM-attached GNNs in Table 7 (QM9) and Table 8 (Tox21). For QM9, we report the relative reductions of MAE in percentage(%). For Tox21, we report the improvements of binary classification accuracy in percentage (%). Numbers of sub-tasks improved by GWM (positive value slots) are in good accordance with the score gains in Table 2 and Table 3.

Review summaries:
Graph Neural Networks is a popular architecture for the analysis of chemical molecules. The authors propose an auxiliary module that can be attached to a GNN that can boost the representation power of GNNs. The auxiliary module has three building blocks: 1. a supernode, 2. a transmitter unit and 3. a warp gate unit. The authors show through carefully designed experiments that these additions can be attached to any type of GNN and that they are successful in reducing both the training error and test error. A variety of graph regression and graph classification tasks are chosen to show the efficacy of the method.