Positional encodings (PEs) enhance the power of graph neural networks (GNNs), both theoretically and empirically. Two of the most popular families of PEs - spectral (e.g., Laplacian eigenspaces, effective resistance) and walk-based (polynomials of the adjacency matrix) - are theoretically equivalent in expressive power, with expressivity between the 1-WL and 3-WL tests. However, this equivalence assumes the GNN uses the "complete" version of these PEs, which requires $O(n^3)$ time and space complexity. Instead, practitioners commonly use truncated variants of these encodings, such as the first $k$ eigenspaces or powers of the adjacency matrix. However, the theoretical properties of these truncated PEs are unknown. In this work, we initiate the study of these truncated PEs. Theoretically, we show that, under truncation, several families of PEs are fundamentally different in expressive power. As a corollary, we show that truncated spectral PEs are no longer stronger than the 1-WL test. We also study a family of spectral PEs, the $k$-harmonic distances, to highlight the differences in expressive power of even closely related truncated PEs. Finally, we experimentally show that a mix of truncated PEs is preferable to any single family on real-world datasets.
翻译:位置编码(PEs)从理论和实证两方面增强了图神经网络(GNN)的能力。两类最流行的位置编码——谱编码(如拉普拉斯特征空间、有效电阻)和游走编码(邻接矩阵的多项式)——在表达能力上理论等价,其表达力介于1-WL和3-WL测试之间。然而,这一等价性假设GNN使用这些位置编码的“完整”版本,这需要$O(n^3)$的时间和空间复杂度。相反,从业者通常使用这些编码的截断变体,例如前$k$个特征空间或邻接矩阵的幂次。然而,这些截断位置编码的理论性质尚不明确。在这项工作中,我们率先对这些截断位置编码展开研究。理论上,我们证明在截断条件下,多类位置编码的表达能力存在根本性差异。作为推论,我们表明截断谱编码不再强于1-WL测试。我们还研究了一类谱编码——$k$调和距离——以突显即便相近的截断位置编码在表达能力上的差异。最后,通过实验我们表明,在真实世界数据集上,混合使用多种截断位置编码优于任何单一类型的编码。