Author response to Reviewer rtFz (1)
We would like to thank the reviewer for their time and insightful comments.
> The CNN graph construction is effective but feels quite hacky. To use the method, the user must first specify a maximum kernel size. While this is unlikely to be a problem in practice, because the kernel size of modern CNNs does not vary much, it is not obvious how to extend this to other network layers that exhibit parameter sharing. For example, attention layers share parameters over sequence length which may vary significantly more than kernel size.
Indeed, our construction requires prior knowledge on a maximum allowed kernel size. Note, however, that the maximum kernel size merely decides the input feature dimensions of the edges. On the other hand, the parameter sharing of attention layers is more comparable to how a shared convolutional kernel is applied over the different spatial regions. Hence, the graph construction for attention layers is unaffected by the variability in the sequence length, similar to how it is unaffected by the variability in the image size for CNNs.
> Moreover, other standard building blocks like normalization layers are not covered in this work and there is no clear recipe provided for designing the corresponding neural graph representations.
Thank you for the suggestion. We provide recipes for normalization layers and multi-head self-attention layers in the updated manuscript in appendix C. For completeness, we also describe the two types of building blocks here.
Normalization layers, e.g. BatchNorm [3] and LayerNorm [4] are formulated as $\mathbf{y} = \gamma \odot \mathbf{x} + \beta$, which can be rewritten as a linear layer with diagonal weights $\mathbf{y} = \mathrm{diag}(\gamma) \mathbf{x} + \beta$. As such, we can treat normalization layers like linear layers: given $d$ nodes that represent the $d$-dimensional input to the normalization layer $\mathbf{x}$, we add an additional $d$ nodes that correspond to the $d$-dimensional output $\mathbf{y}$. The additional node features capture the additive terms $\beta$, while the edge features capture the multiplicative terms $\gamma$. We only add edges from $\mathbf{x}_i$ to the corresponding $\mathbf{y}_i$ to model the element-wise multiplication.
Multi-head self-attention layers initially apply linear projections to the inputs $\mathbf{X}$. In total, assuming H heads, we have $3H$ linear layers applied independently to the inputs.
$$ \mathbf{Q}_h = \mathbf{X} \mathbf{W}_h^Q, \mathbf{K}_h = \mathbf{X} \mathbf{W}_h^K, \mathbf{V}_h = \mathbf{X} \mathbf{W}_h^V, h \in \{1, \ldots, H\} $$
Each head is followed by a dot-product attention layer $\mathbf{Y}_h = \mathrm{s}(\mathbf{Q}_h \mathbf{K}_h^T) \mathbf{V}_h$, where $\mathrm{s}$ is the softmax function.
Finally, we concatenate all heads and perform a final linear projection:
$ \textrm{MHSA}(\mathbf{X}) = \mathrm{Concat}(\mathbf{Y}_1, \ldots, \mathbf{Y}_H) \mathbf{W}^O$
A multi-head self attention layer takes $d$-dimensional vectors as inputs and produces $d_H$-dimensional vectors as output of each head, which are then concatenated and linearly projected to $d$ dimensions. In the neural graph construction, we add $d$ nodes for each dimension of the input, $H \cdot d_H$ nodes for each dimension of each head, and $d$ nodes for each dimension of the output.
We model the 3 different types of linear projections with multidimensional edge features. More specifically, for each edge feature we have $\mathbf{e}_{ij}^h=\left(\left(\mathbf{W}_h^Q\right)\_{ij}, \left(\mathbf{W}_h^K\right)\_{ij}, \left(\mathbf{W}_h^V\right)\_{ij}\right)$. Since dot-product attention is a parameter-free operation, we do not model it explicitly and let the neural graph network approximate it. The concatenation of all heads is automatically handled by the neural graph itself by connecting the appropriate nodes from each head through the output weights $\mathbf{W}^O$ to the corresponding output node. The final projection $\mathbf{W}^O$ is treated as a standard linear layer.
We’ve covered a variety of popular architectural choices including convolutions, skip connections, and different activation functions, which serve as inspiration for how other neural network components can be turned into neural graphs.
> There is little theoretical justification for the proposed approach. Prior work proves the expressivity of their methods alongside their group equivariance properties. Neither of these are explored formally in this work.
Thank you for the suggestion. Navon et al. [1] proved that DWSNet can approximate the forward pass of an MLP with ReLU activations as a first step towards formally characterizing the expressivity of (equivariant) networks for networks. In the new Appendix B, we demonstrate that an MPNN applied to neural graphs can achieve this too. We further formalized the equivariance property in the new Appendix A (as also suggested by Reviewer 6cHp).