Anonymous Walk Embeddings

Sergey Ivanov, Evgeny Burnaev

Abstract

The task of representing entire graphs has seen a surge of prominent results, mainly due to learning convolutional neural networks (CNNs) on graph-structured data. While CNNs demonstrate state-of-the-art performance in graph classification tasks, such methods are supervised and therefore steer away from the original problem of network representation in a task-agnostic manner. Here, we coherently propose an approach for embedding entire graphs and show that our feature representations with an SVM classifier increase the classification accuracy of CNN algorithms and traditional graph kernels. For this, we describe a recently discovered graph object, the anonymous walk, on which we design task-independent algorithms for learning graph representations in explicit and distributed ways. Overall, our work represents a new scalable unsupervised learning of state-of-the-art representations of entire graphs.

Introduction

To apply standard machine learning algorithms to networks, researchers must first convert complex graph structures into numerical vectors—a process known as graph embedding. Currently, the most successful methods for embedding entire graphs, such as Graph Convolutional Networks, are supervised. These models learn representations tailored to a single task, which limits their utility as general, task-agnostic descriptors of a network.

Conversely, existing unsupervised methods like traditional graph kernels often rely on engineered features that produce sparse representations. These representations frequently suffer from "diagonal dominance," where a graph's vector is only similar to itself and orthogonal to others. This paper introduces Anonymous Walk Embeddings (AWE), a scalable, unsupervised algorithm that learns dense, distributed representations of entire graphs while preserving their underlying topological similarities.

Methodology

The core innovation of this work is the anonymous walk. In a standard random walk, one records the global IDs of the nodes visited (e.g., Node A $\rightarrow$ Node B $\rightarrow$ Node A). In an anonymous walk, states are recorded by the index of their first occurrence; the previous walk becomes $1 \rightarrow 2 \rightarrow 1$. This captures the structural motif of the walk without requiring global node labels, making the representation robust across different graphs.

Transformation from a graph to anonymous walks.

The authors propose two methods for utilizing these walks:

  1. Feature-Based AWE (AWE-FB): A graph is represented by the probability distribution of all possible anonymous walks of a certain length $l$. Due to the exponential growth of possible walks, a mathematically bounded sampling technique is used for efficient approximation.
  2. Data-Driven AWE (AWE-DD): This approach adapts the Paragraph Vector (Doc2Vec) model. Anonymous walks are treated as "words," and the entire graph is treated as a "document." A neural network learns dense vector representations by predicting a target walk based on its surrounding context walks and the graph's overall vector.
The data-driven AWE model architecture.

Key Results and Scalability

The authors evaluated AWE on 10 benchmark datasets across social and biological domains. AWE approaches consistently ranked in the top-2 across all social network datasets. For instance, on REDDIT-BINARY, AWE-DD achieved 87.89% accuracy, outperforming the supervised state-of-the-art PSCN (86.30%). On IMDB-BINARY, AWE-DD reached 74.45% compared to PSCN's 71.00%.

Beyond accuracy, the model scales exceptionally well. Mapping graphs with tens of thousands of nodes and edges to a 128-dimensional vector takes only a few seconds. The embeddings perform best when paired with non-linear SVM kernels (RBF or Polynomial), indicating they successfully capture complex, non-linear structural relationships.

Limitations and Future Work

A primary limitation is the exponential growth of possible anonymous walks as the walk length $l$ increases (e.g., over 4 million possible walks at length 12). This currently limits the practical length of sampled walks. However, the AWE framework is highly adaptable; future work could swap the "graph vector" for "node" or "subgraph" vectors to learn localized representations for node-level or edge-level prediction tasks.

Summary updated

BibTeX
@inproceedings{ivanov2018anonymous,
  author = {Sergey Ivanov and Evgeny Burnaev},
  title = {{Anonymous Walk Embeddings}},
  booktitle = {International Conference on Machine Learning},
  year = {2018},
}
Figure