SPAN: Subgraph Prediction Attention Network for Dynamic Graphs

Yuan Li, Chuanchang Chen, Yubo Tao, Hai Lin · DOI

Abstract

This paper proposes a novel model for predicting subgraphs in dynamic graphs, an extension of traditional link prediction. This proposed end-to-end model learns a mapping from the subgraph structures in the current snapshot to the subgraph structures in the next snapshot directly, i.e., edge existence among multiple nodes in the subgraph. A new mechanism named cross-attention with a twin-tower module is designed to integrate node attribute information and topology information collaboratively for learning subgraph evolution. We compare our model with several state-of-the-art methods for subgraph prediction and subgraph pattern prediction in multiple real-world homogeneous and heterogeneous dynamic graphs, respectively. Experimental results demonstrate that our model outperforms other models in these two tasks, with a gain increase from 5.02% to 10.88%.

Introduction

Most network analysis research has traditionally focused on link prediction—the task of determining whether a single edge will form between two nodes. However, real-world interactions rarely occur in isolation; they are embedded within complex subgraphs or groups of nodes. Predicting how these higher-order structures evolve over time is critical for applications ranging from social network analysis to citation tracking.

Traditional approaches to subgraph evolution often suffer from three major limitations. First, they rely on human-defined "global thresholds" to determine edge existence, which fails to adapt to diverse local contexts. Second, they often assume edge independence, ignoring the higher-order dependencies where the formation of one edge is contingent on its neighbors. Finally, many models treat node attributes (what a node is) and topological structure (how it is connected) as separate entities, missing the collaborative relationship between the two. To address these issues, researchers from Zhejiang University have introduced SPAN (Subgraph Prediction Attention Network).

Methodology

The SPAN framework consists of two primary components: a Bayesian Subgraph Sampling strategy and the core SPAN neural architecture.

Bayesian Subgraph Sampling

To train the model effectively, the authors developed a sampling algorithm based on Bayesian network theory. This algorithm selects nodes based on transfer probabilities, ensuring that nodes with significant influence over the subgraph's evolution are prioritized. This process generates "evolution pairs," which are snapshots of a subgraph at time $t$ and its corresponding state at time $t+1$.

The SPAN Architecture

The core of SPAN is a Twin-Tower Module designed to process different information streams collaboratively:

  • Tower 1 (Attributes): This tower processes node attribute information ($Y$) through a series of A-Blocks (Attention Blocks).
  • Tower 2 (Topology): This tower processes the topological context ($C$), which is generated via a Bayesian attention layer to capture structural dependencies.
  • Cross-Attention Mechanism: Instead of processing these towers in parallel, SPAN utilizes cross-attention. This allows attribute information to guide the extraction of topological features and vice versa. For instance, a specific node attribute might indicate that a certain topological structure is likely to evolve more rapidly.
  • Joint Prediction: SPAN predicts the entire adjacency matrix of the subgraph at once. This end-to-end approach accounts for edge dependencies and avoids the biases inherent in manual thresholding.
The SPAN architecture featuring the twin-tower module and cross-attention mechanism for subgraph evolution prediction.

For complex networks with multiple node and edge types, the authors introduced SPAN-H, a variant optimized for heterogeneous networks (e.g., author-venue-topic networks).

Experimental Evaluation

The model was evaluated on two distinct tasks: subgraph prediction in homogeneous graphs and pattern prediction in heterogeneous graphs.

Datasets

The evaluation utilized several real-world datasets, ranging from social interactions to technical Q&A exchanges. The homogeneous datasets, summarized below, include large-scale networks like wiki-talk, which contains over one million nodes.

Summary of the five real-world homogeneous dynamic graph datasets used for evaluation.

For heterogeneous tasks, the authors used datasets such as email-eu, DBLP, and mathoverflow, which involve multi-typed relationships like authors publishing on specific topics at specific venues.

Key Results and Insights

Performance Gains

SPAN consistently outperformed state-of-the-art dynamic embedding methods, including EvolveGCN and Dyngraph2vec. In homogeneous subgraph prediction, SPAN achieved an AUC (Area Under Curve) improvement ranging from 5.02% to 10.56%. For heterogeneous pattern prediction, the SPAN-H variant showed gains between 6.09% and 7.42% over established models like HAN and HGT.

Scalability and Efficiency

One of SPAN's most significant advantages is its scalability. By learning from sampled subgraphs rather than the entire global adjacency matrix, it is highly memory-efficient. While baseline models frequently encountered "Out of Memory" (OOM) errors on the wiki-talk dataset, SPAN processed it successfully. Furthermore, its runtime increases almost linearly with the subgraph size, making it suitable for large-scale dynamic graphs.

Synergy of "What" and "Where"

The success of the cross-attention mechanism highlights that topology and attributes are inseparable in dynamic networks. A node's role in evolution is a product of both its position (centrality) and its specific traits. By capturing this "collaborative limitation," SPAN provides a more holistic view of network dynamics.

Conclusion and Future Work

SPAN represents a significant step forward in moving beyond simple link prediction toward comprehensive subgraph evolution modeling. By utilizing an end-to-end learning mechanism, it removes the need for manual parameter tuning and adaptively learns local thresholds.

Future research directions include:

  • Variable Subgraph Sizes: While SPAN can handle arbitrary sizes, the quadratic growth of the adjacency matrix ($k^2$) remains a computational challenge for very large subgraphs.
  • Temporal Depth: Future iterations could integrate longer temporal sequences—multiple past snapshots—to capture long-term evolution trends more effectively.
  • Sampling Optimization: As the model's performance is tied to the Bayesian Subgraph Sampling, further refining the sampler to ensure it captures all critical nodes is a priority.

Summary updated

Abstract

This paper proposes a novel model for predicting subgraphs in dynamic graphs, an extension of traditional link prediction. This proposed end-to-end model learns a mapping from the subgraph structures in the current snapshot to the subgraph structures in the next snapshot directly, i.e., edge existence among multiple nodes in the subgraph. A new mechanism named cross-attention with a twin-tower module is designed to integrate node attribute information and topology information collaboratively for learning subgraph evolution. We compare our model with several state-of-the-art methods for subgraph prediction and subgraph pattern prediction in multiple real-world homogeneous and heterogeneous dynamic graphs, respectively. Experimental results demonstrate that our model outperforms other models in these two tasks, with a gain increase from 5.02% to 10.88%.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Email-EuSPAN-HAUC0.941+0.06 vs baselinesplit: test · b=6 · embedding-dim=128
Source quote
L200: email-eu │ 0.872 │ 0.859 │ 0.876 │ 0.885 │ 0.941 │ 7.42%
DBLPSPAN-HAUC0.889+0.05 vs baselinesplit: test · b=6 · embedding-dim=128
Source quote
L201: DBLP │ 0.838 │ 0.816 │ 0.834 │ 0.861 │ 0.889 │ 6.09%
MathOverflowSPAN-HAUC0.915+0.06 vs baselinesplit: test · b=6 · embedding-dim=128
Source quote
L202: mathoverflow │ 0.855 │ 0.831 │ 0.840 │ 0.877 │ 0.915 │ 7.01%
Reported baseline / comparator measurements (3)
BenchmarkMethodMetricScoreProtocol / Evidence
Email-EuHGT baselineAUC0.876split: test · b=6 · embedding-dim=128
Source quote
L200: email-eu │ 0.872 │ 0.859 │ 0.876 │ 0.885 │ 0.941 │ 7.42%
DBLPSPNN baselineAUC0.838split: test · b=6 · embedding-dim=128
Source quote
L201: DBLP │ 0.838 │ 0.816 │ 0.834 │ 0.861 │ 0.889 │ 6.09%
MathOverflowSPNN baselineAUC0.855split: test · b=6 · embedding-dim=128
Source quote
L202: mathoverflow │ 0.855 │ 0.831 │ 0.840 │ 0.877 │ 0.915 │ 7.01%
BibTeX
@misc{li2021span,
  author = {Yuan Li and Chuanchang Chen and Yubo Tao and Hai Lin},
  title = {{SPAN: Subgraph Prediction Attention Network for Dynamic Graphs}},
  year = {2021},
  eprint = {2108.07776},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.07776},
}
Figure