Is Distance Matrix Enough for Geometric Deep Learning?

Zian Li, Xiyuan Wang, Yinan Huang, Muhan Zhang

Introduction

In Geometric Deep Learning (GDL), tasks such as predicting molecular energy or simulating physical dynamics require models to deeply understand 3D structures. A straightforward approach is to use a standard Message Passing Neural Network (MPNN) where edge weights are simply the Euclidean distances between nodes. However, these "Vanilla DisGNNs" are geometrically incomplete. They often fail to distinguish between distinct but highly symmetric 3D structures.

Symmetric 3D counterexamples that Vanilla DisGNNs fail to distinguish.

Because of this limitation, the field has largely pivoted toward building highly complex equivariant neural networks. These models manually bake in high-order geometric features like angles and dihedral angles, or they employ complex spherical harmonics. This paper challenges that prevailing assumption, asking a fundamental question: Is all this mathematical complexity truly necessary? Since a complete distance matrix mathematically contains all the structural information of a 3D graph, the authors propose that we can simply use a more expressive graph neural network to learn the geometry purely from distances.

Enter $k$-DisGNNs

To solve the expressivity problem, the authors introduce $k$-DisGNNs, a class of models based on the highly expressive $k$-Weisfeiler-Lehman ($k$-WL) graph isomorphism tests. Instead of passing messages between individual nodes, $k$-DisGNNs pass messages between $k$-tuples of nodes.

  • Initialization: The model initializes representations for $k$-tuples based purely on the distance matrix of the nodes within that specific tuple.
  • Message Passing: The network updates these tuple representations by aggregating information from neighboring tuples.
Higher-order geometric relationships captured by tuple-based message passing.

By operating on tuples, the model implicitly and automatically learns high-order geometric features—such as angles from 3-tuples and dihedral angles from 4-tuples—without requiring manual engineering. The authors propose three variants: the standard $k$-DisGNN, $k$-F-DisGNN (based on Folklore WL), and $k$-E-DisGNN (which explicitly incorporates the representation of the edge connecting two tuples to better capture spatial relationships).

Key Insights and Theoretical Universality

The core takeaway is that distance is actually enough. You do not need explicit 3D coordinates or complex equivariant mathematics if your GNN is sufficiently expressive.

Furthermore, the paper unifies existing models. Popular, heavily-engineered GDL architectures like DimeNet (which uses angles) and GemNet (which uses dihedral angles) are mathematically proven to be special, restricted cases of 2-DisGNN and 3-DisGNN, respectively.

The authors also mathematically prove that $k$-DisGNNs are universal function approximators. They can approximate any invariant scalar property (like molecular energy) when $k \ge 2$, and any equivariant vector property (like atomic forces) when $k \ge 3$. This successfully bridges traditional Graph Representation Learning (GRL) and 3D GDL, demonstrating that highly expressive models from GRL can be ported over to 3D tasks with massive success.

Experimental Results

The theoretical claims are backed by strong empirical performance across standard benchmarks:

  • State-of-the-Art on MD17: $k$-DisGNNs achieved SOTA or highly competitive results across the board on the MD17 and Revised MD17 datasets, particularly excelling at the difficult task of force prediction (ranking top 2 on average).
  • Beating Handcrafted Counterparts: 2-F-DisGNN and 3-E-DisGNN outperformed DimeNet and GemNet by significant margins (e.g., a 43.9% and 12.23% average improvement on MD17 force predictions, respectively). This proves that data-driven tuple learning can beat manually designed geometric features.
  • QM9 Success: On the QM9 dataset, 2-F-DisGNN outperformed DimeNet on 11 out of 12 targets, with an average improvement of 14.27%.
  • Efficiency: 2-F-DisGNN demonstrated significantly better training time, inference time, and memory efficiency compared to complex models like GemNet, largely because it relies on dense tensor calculations that are highly optimized for modern GPUs.

Limitations and Future Work

The primary limitation of $k$-DisGNNs is scalability. Because the model assumes a complete distance graph (where every node is connected to every other node) and operates on $k$-tuples, the computational complexity scales poorly for large graphs—specifically $O(n^3)$ time and $O(n^2)$ space for $k=2$. This makes it currently intractable for massive geometric graphs like large proteins.

For future work, the authors suggest balancing this theoretical universality with experimental tractability by using distance cutoffs (ignoring atoms that are very far apart) or by utilizing sparse but expressive subgraph GNNs.

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