Diversity Curves for Graph Representation Learning: Size-robust graph embeddings combining coarsening and structural diversity
Published by Nadja Häusermann, Katharina Limbeck
Our work on “Diversity Curves for Graph Representation Learning” has been accepted to NeurIPS 2026. Before hopefully meeting some of you in Paris, we will already give you a brief glimpse into our main motivation and results.
What are graph representations?
Our work focuses on unsupervised graph representations. These are important tools to explore and characterise graphs and graph datasets when there are no labels present. In particular, the goal for a useful graph representation or graph embedding is to find a vectorisation of a graph in such a way that some intrinsic properties of the graphs are being preserved.
Current methods struggle when they need to simultaneously handle graphs of varying cardinality. This is an issue, as often we are dealing with datasets in which graphs sharing the same general properties can have very different sizes. For example, it has been shown that graph neural networks struggle with generalising across molecular graphs of varying resolutions.
Similarly, unsupervised graph embeddings that summarise the spectrum of graphs are not able to cluster graphs well when size and density varies. Geometric methods that use graph filtrations, such as persistent homology, also often depend in some way on the size of the input graph.
The focus of our work lies on tackling this problem and finding a novel unsupervised graph representation method that captures the coarse geometry of a graph in such a way that it can be used for applications where graphs have different sizes.
How can we improve size-robustness of graph representations?
To address the issue of graph representation methods that generalise well to graphs of different cardinalities, we propose diversity curves, novel graph level representations that aim to capture the coarse geometry and structure of graphs while being robust to their size. How we are able to achieve this, is by neatly combining graph coarsening together with a structural descriptor that is the graphs’ diversity.
Let’s look at how we obtain the diversity curve for some example graphs.
First, for each graph we construct a sequence of coarsened graphs of some specified cardinalities. Specifically, to make graphs smaller, we use edge contraction pooling1 in our work because it allows us to control the cardinality in each step, can be applied iteratively, preserves the structure of the graph2 and has been shown to improve expressivity. If needed, we can also make graphs larger by upsampling nodes in the graph.
Second, we now use a structural descriptor, the diversity of the graph, which we measure by its metric space spread. At each cardinality, we evaluate the diversity of the graph and thus obtain a curve, which we term diversity curve that tracks this structural diversity across different coarsening levels. Let’s briefly dive into the world of diversity measures and our choice of using the spread. The study of diversity has its roots in the problem of characterising biological diversity in a community. This question has started a thorough mathematical analysis, where we denote a diversity measure as an invariant of a metric space that characterises how diverse its points are with respect to the metric. The magnitude and spread of a metric space are two closely related examples of such diversity measures 3. They capture the “effective number of points” and have been studied through various theoretical work. Recently, magnitude has been applied to a growing range of applications, such as in predicting protein flexibility or in our own work on using magnitude to evaluate diversity of latent representation 4.
Note that in order to compute the diversity of a graph, we need to view the graph as a metric space. Our default choice is to use the shortest-path metric, but other options are possible as we will touch upon in the applications and we discuss further in the paper.
Finally, the diversity curve gives us a multiscale summary of the graph, describing its coarse geometry. We can use the vectorisation of diversity curves directly for downstream tasks. The unique interplay between the structural diversity and the coarsening ensures that diversity curves are robust to size, interpretable, and expressive graph representations that perform well in various applications to unsupervised tasks for structured data, as we will see next.
How do diversity curves perform?
In our work we investigate the abilities of diversity curves across different applications and in theoretical settings. Below, we present a selection of the results that can be found in the paper.
Diversity curves are expressive graph representations
First, we find that using coarsening together with diversity does not only help in achieving size-robustness, but also increases expressivity compared to the diversity alone. Figure 2 shows two graphs that have the same diversity but their diversity curves5 differ already when contracting one edge, as can be seen in the plot on the right.
Furthermore, the two graphs in Figure 2 are also 1-WL indistinguishable. We test whether diversity curves can distinguish 1-WL graphs on a larger scale experiment on pairs of graphs from the BREC dataset, and find that indeed this holds true more generally with the performance of diversity curves being comparable to the best unsupervised graph representation baselines we tested.
Diversity curves distinguish graph distributions
To validate how robust diversity curves are with respect to different graph sizes, we first test on simulated graph datasets. We generate graphs from four different random graph models of varying size and try to distinguish the graphs based on the distribution they are sampled from. Our findings show that diversity curves are able to cluster these graphs well. Accuracies from k-NN classification are comparable to the best baseline methods and the clustering quality measured in terms of the silhouette score clearly outperforms the baselines. This supports our claim that we are robust to different graph sizes and are able to intrinsically cluster graphs in an unsupervised way. Figure 3 shows a PCA plot of the diversity curves from the graphs of the different graph distributions.
We further modify the experiment and try to characterise and distinguish between graphs drawn from the same underlying random graph model when varying the parameters. Here, we investigate whether diversity curves also pick up on these differences in parameter choices. Supporting our earlier results, accuracies and silhouette scores indicate that the diversity curves perform well at this task. Figure 4 shows the table of the k-NN classification accuracies for diversity curves against the baselines.
Diversity curves distinguish trajectory or cluster structures in single-cell graphs
Having evaluated our method on simulated graph datasets, we expand to a real-world setting. We present the application to single-cell data, where it is of importance for downstream analysis to distinguish the structure of single-cell graphs into cluster- or trajectory-like. We test the ability of diversity curves at this geometric task on an annotated dataset. Since single-cell graphs also contain node features, we leverage the flexibility of our pipeline and compute diversity curves based on the shortest-path distance in the graphs and on the Euclidean distance between features and combining the curves together to obtain one representation per graph. We find that cluster-like graphs have on average higher diversity across the coarsening and we are able to separate well between the different structures. Diversity curves outperform previously proposed geometric evaluation scores for this task. Figure 5 shows the PCA of diversity curves for the single-cell graphs.
Diversity curves characterise geometric shapes
As a last study, we focus on a purely geometric task that also lets us demonstrate the flexibility of our method to adapt to different experimental settings. We use a dataset of triangulations of 2-manifolds from the MANTRA dataset. The task is to distinguish the triangulations according to their homeomorphism type. We first use diversity curves only on the 1-skeleton graphs, that is, we only consider the vertices and edges of the triangulation, where we achieve the best possible accuracy an optimal classifier can have6. Exploiting the higher-order structure, we use the higher-order heat kernel distance between faces of the triangulations to compute the spread. With this approach, diversity curves essentially solve the task, reaching an accuracy of 99%. The PCA in Figure 6 shows that the diversity curves with this choice of metric separate the classes well.
As an additional test, we also evaluate the performance of diversity curves when training our classifier on the original dataset and evaluating on triangulations where barycentric subdivision is performed to increase the number of nodes. We find that diversity curves still outperform the best previously reported baseline on this task, supporting the robustness of diversity curves with respect to number of nodes and their ability to encode the intrinsic geometry of data.
Closing remarks
We successfully exploit the combination of a coarsening together with the diversity, measured by the spread, to obtain diversity curves, novel unsupervised graph representations. Diversity curves use a coarsening sequence that transforms all graphs to the same cardinalities across which we can then evaluate the structural diversity at each level. We find that diversity curves are robust to graphs of different sizes and give expressive representations that perform well on a variety of tasks on inherently geometric and real-world molecular graphs.
If you are interested in learning more about our methods, check out our paper. There are more experiments to discover: we show how diversity curves behave under perturbations of the graphs, use them to perform statistical tests between different graph datasets, and give further theoretical background and details. If you would like to try out using diversity curves yourself, the accompanying code is published here.
This was a joint work between the following authors, thanks everyone!
Katharina Limbeck, (soon to be finished) PhD student at Helmholtz Munich and Technical University of Munich
Nadja Häusermann, PhD student at University of Fribourg
Martin Carrasco, PhD student at University of Fribourg
Guy Wolf †, Full Professor at University of Montréal and Core Academic Member at Mila - Quebec AI Institute
Bastian Grossenbacher-Rieck †, Full Professor at University of Fribourg
† These authors jointly supervised the work.
References
R. Ballester, E. Röell, D. B. Schmid, M. Alain, S. Escalera, C. Casacuberta, and B. Rieck. MANTRA: The manifold triangulations assemblage. In International Conference on Learning Representations, 2025.
W. Bi, H. Feng, J. Wu, J. Li, G Wei. Topological magnitude for protein flexibility analysis. Royal Society Open Science, 12(12):251599, 2025.
V. Lachi, A. Moallemy-Oureh, A. Roth, and P. Welke. Expressive pooling for graph neural networks. Transactions on Machine Learning Research, 2025
M. Tantardini, F. Ieva, L. Tajoli, and C. Piccardi. Comparing methods for comparing networks. Scientific reports, 9(1):17557, 2019
T. Leinster. Entropy and Diversity: The Axiomatic Approach. Cambridge University Press, 2021.
H. S. Lim and P. Qiu. Quantifying the clusterness and trajectoriness of single-cell RNA-seq data. PLoS Computational Biology, 20(2):e1011866, 2024.
K. Limbeck, R. Andreeva, R. Sarkar, and B. Rieck. Metric space magnitude for evaluating the diversity of latent representations. In Advances in Neural Information Processing Systems, volume 37, 2024.
Y. Wang and M. Zhang. An empirical study of realized GNN expressiveness. In Proceedings of the 41st International Conference on Machine Learning, volume 235, pages 52134–52155. PMLR, 2024.
S. Willerton. Spread: a measure of the size of metric spaces. International Journal of Computational Geometry & Applications, 25(03):207–225, 2015.
-
There is a choice involved here in how we select the edge contraction sequence. We have investigated different methods in our paper and found that for our experiments repeating the coarsening over three randomly generated edge sequences works well while being computationally efficient. ↩︎
-
Check out our previous work using magnitude based edge contraction pooling in the respective blog post or the paper. ↩︎
-
We decided to use the spread of a metric space for this work because it is well-defined for any metric space and faster to compute than magnitude. ↩︎
-
For further references, there exists a bibliography of magnitude. ↩︎
-
We have to be a bit careful with this statement, because one graph technically can have different diversity curves depending on what edges we contract. Here we use the average diversity curve over all possible ways to contract edges in the graph. ↩︎
-
Certain shapes in the dataset (the Klein bottle and Torus) cannot be distinguished by their 1-skeleton alone. This is why we compare against an optimal classifier that can distinguish the homeomorphism types of the 1-skeleta where theoretically possible, and misclassifies everything that is not distinguishable by the 1-skeleton in a consistent manner. ↩︎