Abstract
Graph autoencoders (AE) and variational autoencoders (VAE) recently emerged as powerful node embedding methods. In particular, graph AE and VAE were successfully leveraged to tackle the challenging link prediction problem, aiming at figuring out whether some pairs of nodes from a graph are connected by unobserved edges. However, these models focus on undirected graphs and therefore ignore the potential direction of the link, which is limiting for numerous real-life applications. In this paper, we extend the graph AE and VAE frameworks to address link prediction in directed graphs. We present a new gravity-inspired decoder scheme that can effectively reconstruct directed graphs from a node embedding. We empirically evaluate our method on three different directed link prediction tasks, for which standard graph AE and VAE perform poorly. We achieve competitive results on three real-world graphs, outperforming several popular baselines.
Introduction
Graph Autoencoders (GAE) have become a standard tool for learning latent representations of nodes in a graph. By encoding nodes into a low-dimensional space and then attempting to reconstruct the graph's adjacency matrix, these models capture the underlying structural properties of the network. However, a significant limitation of traditional GAEs is their reliance on symmetric decoders, typically based on the inner product of node embeddings. While effective for undirected graphs, this approach is fundamentally ill-suited for directed graphs, where the existence of an edge from node $i$ to node $j$ does not necessarily imply an edge from $j$ to $i$.
In many real-world scenarios—such as citation networks, web graphs, or social media follow-graphs—directionality is the defining feature. To address this, we introduce a novel "gravity-inspired" decoder that models directed links by treating nodes as entities with both spatial coordinates and a "mass" representing their global importance.
The Gravity-Inspired Framework
The Encoder
The model utilizes a standard Graph Convolutional Network (GCN) as the encoder. For each node $i$, the GCN produces a $(d+1)$-dimensional representation. This representation is partitioned into two distinct components:
- Latent Coordinates ($z_i$): A $d$-dimensional vector representing the node's position in a latent space.
- Mass ($\tilde{m}_i$): A scalar value representing the node's "gravitational pull" or global popularity within the network.
The Gravity Decoder
The core innovation of this work is the decoder, which is inspired by Newton’s law of universal gravitation. In physics, the force between two objects is symmetric, but the acceleration experienced by an object is asymmetric, depending on the mass of the other body. We adapt this principle to define the probability of a directed link from source node $i$ to target node $j$:
$$\hat{A}_{ij} = \sigma(\tilde{m}_j - \lambda \log ||z_i - z_j||_2^2)$$
Here, $\sigma(\cdot)$ is the sigmoid function, and $\lambda$ is a tunable hyperparameter. This formula introduces asymmetry because the link probability depends on the mass of the target node $\tilde{m}_j$. A node with high mass (an "opinion leader" or a highly cited paper) will have a higher probability of attracting links from other nodes, regardless of its own outgoing connections.
Experimental Evaluation
Datasets and Tasks
We evaluated the model on three directed datasets: Cora, Citeseer, and Google. The performance was measured across three distinct tasks:
- General Link Prediction: Predicting missing edges in the graph.
- Biased Negative Samples: A specialized task where the model must distinguish between a true directed edge $i \to j$ and the non-existent reverse edge $j \to i$. This specifically tests the model's ability to handle asymmetry.
- Bidirectionality Prediction: Predicting whether a link is unidirectional or bidirectional.
Results
The Gravity-inspired VAE (Gravity-VAE) demonstrated significant improvements over standard symmetric GAEs. On the "Biased Negative Samples" task, where symmetric models are no better than random guessing (50% AUC), our model achieved between 76% and 88% AUC.
Furthermore, the model outperformed or remained competitive with established directed embedding baselines such as HOPE, node2vec, and APP. Notably, the model achieved these results while maintaining a single embedding space, avoiding the parameter doubling required by "source/target" vector models.
Discussion: Interpreting Mass and Distance
One of the most compelling aspects of the gravity-inspired model is the interpretability of its parameters. The learned "mass" $\tilde{m}_i$ correlates strongly with traditional graph centrality measures, such as In-degree and PageRank. This suggests that the model naturally learns to identify influential nodes as "massive" objects in the latent space.
The hyperparameter $\lambda$ allows for fine-tuning the balance between local proximity and global importance. In denser graphs like the Google web graph, a higher $\lambda$ (emphasizing proximity) proved beneficial, whereas tasks focusing on pure directionality benefited from a lower $\lambda$ (emphasizing mass).
Conclusion
By incorporating physical principles into the Graph Autoencoder framework, we have developed a method that effectively captures the inherent asymmetry of directed graphs. The gravity-inspired decoder provides a robust, interpretable, and efficient solution for directed link prediction, outperforming traditional symmetric models and specialized directed baselines. Future work will explore the integration of node features and the application of this latent space to directed node clustering.
Summary updated