From Community to Role-based Graph Embeddings

Ryan A. Rossi, Di Jin, Sungchul Kim, Nesreen K. Ahmed, Danai Koutra, John Boaz Lee · DOI

Abstract: Structural roles define sets of structurally similar nodes that are more similar to nodes inside the set than outside, whereas communities define sets of nodes with more connections inside the set than outside. Roles based on structural similarity and communities based on proximity are fundamentally different but important complementary notions. Recently, the notion of structural roles has become increasingly important and has gained a lot of attention due to the proliferation of work on learning representations (node/edge embeddings) from graphs that preserve the notion of roles. Unfortunately, recent work has sometimes confused the notion of structural roles and communities (based on proximity) leading to misleading or incorrect claims about the capabilities of network embedding methods. As such, this paper seeks to clarify the misconceptions and key differences between structural roles and communities, and formalize the general mechanisms (e.g., random walks, feature diffusion) that give rise to community or role-based structural embeddings. We theoretically prove that embedding methods based on these mechanisms result in either community or role-based structural embeddings. These mechanisms are typically easy to identify and can help researchers quickly determine whether a method preserves community or role-based embeddings. Furthermore, they also serve as a basis for developing new and improved methods for community or role-based structural embeddings. Finally, we analyze and discuss applications and data characteristics where community or role-based embeddings are most appropriate.

Introduction

In the rapidly expanding field of graph representation learning, a fundamental conceptual confusion has taken root: the conflation of communities and structural roles. While both involve clustering nodes, they rely on entirely different mathematical foundations. Communities are defined by proximity—nodes that are densely connected to one another. In contrast, roles are defined by structural similarity—nodes that perform similar functions or exhibit similar local topologies, regardless of their distance in the graph.

This paper clarifies these misconceptions by formalizing the mechanisms that drive different embedding methods. Understanding these differences is critical; applying a proximity-based embedding to a task requiring structural roles (such as identifying functional protein similarities across different species) will inevitably lead to model failure.

Defining the Dichotomy: Roles vs. Communities

To distinguish between these two concepts, we must look at how they form and what they represent.

Visualizing the difference between roles (structural similarity) and communities (proximity).
  • Communities are proximity-based. Nodes in a community are "close" in terms of graph distance and density. For example, a group of friends in a social network forms a community because they are all directly or nearly directly connected.
  • Roles are similarity-based. Nodes share a role if they have similar local structural properties, such as being a "hub" or a "bridge." Two hubs in different cities share the same role even if they are thousands of miles apart and have no direct connection.

Mechanisms of Embedding

The paper identifies specific mathematical mechanisms that bias an algorithm toward either community or role discovery:

1. Community-based Mechanisms

  • Random Walks: Algorithms like DeepWalk and node2vec rely on sequences of node IDs. Because random walks are mathematically more likely to stay within dense clusters (low conductance), they inherently capture proximity rather than structural function.
  • Feature Diffusion/Propagation: Standard Graph Neural Networks (GNNs) like GCN and GraphSAGE smooth features over neighborhoods. The authors provide a convergence proof (Theorem 4.1) showing that repeated diffusion causes node features within a connected component to become identical, effectively erasing structural nuances in favor of proximity.

2. Role-based Mechanisms

  • Graphlets/Motifs: Counting small induced subgraphs (e.g., triangles, stars) captures the local "shape" of a node's environment.
  • Feature-based Walks: Instead of walking through node IDs, these methods walk through structural feature types, allowing the model to learn that two distant nodes are similar because they both anchor similar patterns.
  • Feature-based Matrix Factorization: Methods like rolX factorize matrices of structural features (like degree or clustering coefficients) rather than raw adjacency matrices.

A Taxonomy of Embedding Methods

By analyzing these mechanisms, we can categorize popular embedding algorithms into a clear taxonomy. This helps researchers select the appropriate tool for their specific data characteristics and application needs.

Taxonomy of embedding methods categorized by type, mechanism, and specific algorithms.

Key Insights and Applications

One of the most significant findings is the "Proximity Trap": most modern GNNs act as sophisticated smoothing filters. While excellent for homophilic graphs (where neighbors are similar), they can fail in heterophilic graphs where structural roles are more important than proximity.

Furthermore, role-based embeddings offer superior generalization. Because a "hub" looks like a "hub" regardless of the specific network, these embeddings can be transferred across different graphs. Community embeddings, which are tied to specific node IDs, cannot generalize in this way.

Application Guidelines:

  • Use Community-based embeddings for semi-supervised learning on homophilic graphs, short-range link prediction, and large-scale cluster visualization.
  • Use Role-based embeddings for across-network transfer learning, identifying functional anomalies, and link prediction in heterophilic graphs.

Conclusion

While proximity-based methods currently dominate the literature, they are not a universal solution. The distinction between roles and communities is not merely semantic but mathematical. Future work must address the computational expense of role discovery and explore hybrid approaches that can balance proximity and structural function without one washing out the other.

Summary updated

BibTeX
@article{rossi2019from,
  author = {Ryan A. Rossi and Di Jin and Sungchul Kim and Nesreen K. Ahmed and Danai Koutra and John Boaz Lee},
  title = {{From Community to Role-based Graph Embeddings}},
  journal = {ACM Trans. Knowl. Discov. Data},
  year = {2019},
  url = {https://openreview.net/forum?id=SSBrpBeXu1c},
}
Figure