Is Distance Matrix Enough for Geometric Deep Learning?

Zian Li, Xiyuan Wang, Yinan Huang, Muhan Zhang · OpenReview

Abstract

Graph Neural Networks (GNNs) are frequently employed for tasks involving the 3D geometry of graphs, such as molecular dynamics simulations. While the distance matrix of a geometric graph contains complete geometric information, standard Message Passing Neural Networks (MPNNs) have been shown to be insufficient for learning this geometry effectively. This work expands on the families of counterexamples that MPNNs cannot distinguish from their distance matrices by constructing novel symmetric geometric graphs. To address these limitations, we propose $k$-DisGNNs, a framework that exploits the rich geometry within distance matrices. We demonstrate that $k$-DisGNNs: 1) capture high-order geometric information inaccessible to MPNNs; 2) unify several existing specialized geometric models; and 3) act as universal function approximators for geometric graphs. Our findings establish a bridge between traditional Graph Representation Learning (GRL) and Geometric Deep Learning (GDL), showing that expressive GNNs from GRL can achieve state-of-the-art performance in GDL without requiring complex, equivariant architectures.

Introduction

In Geometric Deep Learning (GDL), models must process 3D data—such as molecular structures—while maintaining invariance or equivariance to rotations and translations, a property known as $E(3)$ symmetry. Historically, the field has been divided into two approaches: coordinate-based models that use complex mathematical machinery (like spherical harmonics) to ensure symmetry, and invariant-feature models that use naturally symmetric inputs like distances and angles.

A persistent criticism of the latter approach is that "vanilla" distance-based GNNs are geometrically incomplete; they cannot distinguish between certain distinct 3D shapes. This paper investigates whether this is a fundamental flaw of using distances or merely a limitation of current model architectures. By introducing the $k$-DisGNN framework, we demonstrate that distance matrices are indeed sufficient for universal geometric representation when processed through high-order graph isomorphism frameworks.

The $k$-DisGNN Framework

The core innovation of this work is the adaptation of the Weisfeiler-Leman ($k$-WL) algorithm—a classic hierarchy for testing graph isomorphism—to the domain of 3D geometry. While standard MPNNs operate on individual nodes, $k$-DisGNNs operate on $k$-tuples of nodes.

Architecture and Variants

The $k$-DisGNN framework processes geometry through three primary mechanisms:

  1. Initialization: Instead of simple node features, the model embeds the entire distance matrix of a $k$-tuple of nodes, capturing the internal geometry of the group immediately.
  2. Message Passing: The authors define three versions—$k$-DisGNN, $k$-F-DisGNN, and $k$-E-DisGNN—which facilitate information exchange between these tuples.
  3. Edge Enhancement ($k$-E-DisGNN): This version explicitly maintains representations for the "edges" (relationships) between tuples. This allows the model to track how different groups of atoms relate to one another spatially throughout the learning process.

By moving to $k$-tuples, the model naturally captures high-order geometric information. For instance, while a model looking at pairs (2-nodes) cannot "see" an angle, a model looking at 3-tuples can implicitly represent angles and dihedrals in a data-driven manner.

Theoretical Contributions

Universal Function Approximation

The authors provide a rigorous proof that $k$-DisGNNs are universal function approximators for geometric graphs. Specifically, they show that:

  • $k=2$ is sufficient to approximate any invariant scalar function (e.g., total energy).
  • $k=3$ is sufficient to approximate equivariant vector functions (e.g., atomic forces).

Unification of Existing Models

The paper demonstrates that many popular, manually-engineered geometric models are actually restricted cases of the $k$-DisGNN framework. For example, DimeNet (which incorporates angles) and GemNet (which incorporates dihedrals) can be viewed as specific implementations of the high-order logic inherent in $k$-DisGNNs.

Symmetry via Invariance

A key insight is that "equivariant" targets do not strictly require "equivariant" layers. By utilizing invariant node representations and scaling them by relative coordinate vectors, the model can construct powerful equivariant outputs without the computational overhead of irreducible representations.

Experimental Results

The framework was evaluated on the gold-standard benchmarks for molecular property prediction: MD17 (molecular dynamics) and QM9 (chemical properties).

MD17 & Revised MD17

On the task of force prediction—a critical component for accurate molecular simulations—$k$-DisGNNs achieved state-of-the-art (SOTA) performance. On average, they outperformed highly complex equivariant models such as NequIP and PaiNN, proving that high-order invariant features can be more effective than explicit coordinate-based equivariance.

QM9

In the QM9 dataset, which involves predicting 19 different chemical properties for over 130,000 molecules, the 2-F-DisGNN variant outperformed DimeNet on 11 out of 12 targets. Notable improvements included a 65% gain in dipole moment prediction and a 90% improvement in electronic spatial extent prediction.

Efficiency

Despite the theoretical complexity associated with $k$-WL algorithms ($O(n^k)$), the practical implementation of 2-F-DisGNN proved to be more time- and memory-efficient than specialized models like DimeNet and GemNet, making it a viable candidate for real-world applications.

Conclusion and Future Work

This research challenges the necessity of complex equivariant machinery in GDL. By showing that $k$-order distance-based GNNs are universal and highly performant, the authors bridge the gap between GRL and GDL.

However, scalability remains a challenge. The $O(n^k)$ complexity, while manageable for small molecules at $k=2$ or $3$, becomes prohibitive for large proteins or materials. Future work will likely focus on "sparse" versions of these GNNs, such as subgraph GNNs, to maintain high expressivity while scaling to larger geometric systems. Ultimately, this work suggests that the distance matrix, when paired with the right architecture, is indeed enough for geometric deep learning.

Summary updated

BibTeX
@inproceedings{li2023is,
  author = {Zian Li and Xiyuan Wang and Yinan Huang and Muhan Zhang},
  title = {{Is Distance Matrix Enough for Geometric Deep Learning?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=QwQ5HhhSNo},
}
Figure