NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Laplacian Canonization: A Minimalist Approach to Sign and Basis Invariant Spectral Embedding

Jiangyan Ma, Yifei Wang, Yisen Wang

Abstract

Spectral embedding is a powerful graph embedding technique that has received a lot of attention recently due to its effectiveness on Graph Transformers. However, from a theoretical perspective, the universal expressive power of spectral embedding comes at the price of losing two important invariance properties of graphs, sign and basis invariance, which also limits its effectiveness on graph data. To remedy this issue, many previous methods developed costly approaches to learn new invariants and suffer from high computation complexity. In this work, we explore a minimal approach that resolves the ambiguity issues by directly finding canonical directions for the eigenvectors, named Laplacian Canonization (LC). As a pure pre-processing method, LC is light-weighted and can be applied to any existing GNNs. We provide a thorough investigation, from theory to algorithm, on this approach, and discover an efficient algorithm named Maximal Axis Projection (MAP) that works for both sign and basis invariance and successfully canonizes more than 90% of all eigenvectors. Experiments on real-world benchmark datasets like ZINC, MOLTOX21, and MOLPCBA show that MAP consistently outperforms existing methods while bringing minimal computation overhead.

Introduction

To enhance the expressive power of Graph Neural Networks (GNNs) beyond the limitations of the 1-Weisfeiler-Lehman (1-WL) test, researchers frequently employ Spectral Embeddings (SE). By using the eigenvectors of a graph's Laplacian matrix as node features, GNNs and Graph Transformers can distinguish between complex structures that standard message-passing algorithms find identical. However, the utility of SE is hindered by two fundamental mathematical ambiguities:

  1. Sign Ambiguity: For any eigenvector $u$, $-u$ is also a valid eigenvector. A model may encounter one sign during training and another during inference, leading to inconsistent results.
  2. Basis Ambiguity: In cases where an eigenvalue has a multiplicity greater than one, any rotation of the eigenvectors within that subspace remains a valid solution.

Previous attempts to resolve these issues relied on either massive data augmentation (randomly flipping signs) or the development of specialized, computationally expensive invariant architectures like SignNet or BasisNet. This paper introduces Laplacian Canonization (LC), a minimalist pre-processing framework that resolves these ambiguities before the data ever reaches the model.

The Maximal Axis Projection (MAP) Algorithm

The core of the LC framework is the Maximal Axis Projection (MAP) algorithm. MAP seeks to find a unique, "canonical" direction for eigenvectors by leveraging the standard Euclidean axes ($e_1, e_2, \dots, e_n$) as stable reference points. Because these axes are permutation-equivariant, they provide a consistent coordinate system for the graph.

  • MAP-sign: This variant identifies the axis (or set of axes) where an eigenvector has its largest projection. It then forces the eigenvector to maintain a positive dot product with that axis, flipping the sign if necessary.
  • MAP-basis: For subspaces with multiple eigenvalues, the algorithm iteratively identifies the vector within the subspace closest to the "best" axis and then proceeds to the next axis in the orthogonal complement.

By fixing these directions during pre-processing, the model is relieved of the burden of "learning" invariance, allowing for a simpler and more efficient training process.

Reweighted Spectral Embedding (RSE)

In addition to canonization, the authors propose Reweighted Spectral Embedding (RSE). By scaling eigenvectors by the square root of their corresponding eigenvalues ($\sqrt{\lambda}$), the authors prove that SE, when combined with a simple set-based neural network (such as DeepSets), achieves universal expressive power. This theoretical guarantee ensures that the model can, in principle, distinguish any two non-isomorphic graphs.

Experimental Results

The effectiveness of MAP was evaluated across several standard benchmarks, including ZINC, OGBG-MOLTOX21, and OGBG-MOLPCBA, as well as synthetic datasets like EXP.

Performance and Accuracy

On the ZINC molecular regression dataset, a GatedGCN equipped with MAP achieved a state-of-the-art Mean Absolute Error (MAE) of 0.120. This performance surpassed more complex invariant models, demonstrating that a minimalist pre-processing approach can be more effective than architectural complexity.

Computational Efficiency

One of the primary advantages of LC is its speed. On the large-scale MOLPCBA dataset, the MAP-based model trained 41% faster than SignNet, saving approximately 44 hours of GPU time. The MAP algorithm itself adds negligible overhead, with a complexity of $O(n^2 \log n)$, which is significantly lower than the $O(n^3)$ cost of the initial eigendecomposition.

Expressivity

On the EXP dataset—specifically designed to test expressive power—standard GNNs typically achieve only 50% accuracy. In contrast, RSE-based models using MAP achieved near 100% accuracy, validating the theoretical claims regarding universal expressivity.

Conclusion

Laplacian Canonization represents a shift in how spectral information is handled in graph machine learning. By demonstrating that over 90% of eigenvectors in real-world datasets can be successfully canonized through simple projections, the authors show that complex invariant architectures are often unnecessary. MAP provides a plug-and-play solution that enhances the power of any GNN or Graph Transformer with minimal computational cost. While some highly symmetric graphs remain "uncanonizable," the LC framework provides a robust foundation for future research into efficient, universally expressive graph representations.

Summary updated

BibTeX
@inproceedings{ma2023laplacian,
  author = {Jiangyan Ma and Yifei Wang and Yisen Wang},
  title = {{Laplacian Canonization: A Minimalist Approach to Sign and Basis Invariant Spectral Embedding}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=1mAYtdoYw6},
}
Figure