Abstract
Dynamic graph representation learning is essential for modeling evolving systems such as social networks, financial transactions, and biological interactions. While Transformer-based architectures have become the standard for capturing temporal dependencies, their quadratic computational complexity limits scalability when processing long-range historical data. This paper introduces and evaluates three novel architectures: ST-TransformerG2G, DG-Mamba, and GDG-Mamba. By leveraging the selective State-Space Model (SSM) of Mamba, we demonstrate that Mamba-based approaches achieve superior performance in link prediction tasks while maintaining linear computational complexity. Our results across five diverse benchmarks indicate that GDG-Mamba particularly excels in capturing transient dynamics and edge-rich information, providing a robust and efficient alternative to traditional Transformer models.
Introduction
Dynamic graphs represent systems where nodes and edges evolve over time. To predict future states—such as link formation or node classification—models must generate dynamic embeddings that encapsulate both spatial structure and temporal evolution. Historically, researchers have relied on Recurrent Neural Networks (RNNs) or Long Short-Term Memory (LSTM) networks, which scale linearly but often suffer from vanishing gradients and "catastrophic forgetting."
The emergence of the Transformer architecture solved many temporal dependency issues through the self-attention mechanism, yet it introduced a quadratic computational bottleneck ($O(L^2)$). This study investigates the application of the Mamba architecture—a selective State-Space Model—to dynamic graphs. Mamba offers the performance benefits of Transformers with the linear efficiency ($O(L)$) of recurrent models, potentially overcoming the limitations of current state-of-the-art methods.
Methodology
Proposed Architectures
The study compares three distinct modeling approaches to evaluate the trade-offs between attention-based and SSM-based temporal processing:
- ST-TransformerG2G: An evolution of the Graph-to-Graph (G2G) framework that integrates Graph Convolutional Network (GCN) blocks with a Transformer. GCNs capture spatial relationships within individual snapshots, while the Transformer learns temporal patterns across the sequence of snapshots.
- DG-Mamba: This model replaces the Transformer block with a Mamba layer. It utilizes a "selective scan" mechanism to compress historical graph data into a hidden state, allowing for efficient processing of long sequences.
- GDG-Mamba: An enhanced Mamba model incorporating GINE (Graph Isomorphism Network Edge) convolutions. This architecture is designed to process node features and edge-specific attributes (e.g., transaction amounts or trust ratings) simultaneously, providing a richer input to the Mamba temporal layer.
Probabilistic Embeddings
Departing from traditional point-vector embeddings, these models represent each node as a multivariate Gaussian distribution. By outputting a mean and a variance, the models explicitly capture the uncertainty inherent in dynamic networks, which is particularly valuable in highly volatile environments.
Experimental Setup
Datasets
The models were benchmarked on five datasets representing different graph dynamics:
- Reality Mining: Human contact data (96 nodes, ~1M edges).
- UCI: Online student community messages characterized by transient dynamics.
- SBM (Stochastic Block Model): A synthetic dataset with stable community structures.
- Bitcoin-OTC: A trust-based network for Bitcoin traders.
- Slashdot: A large-scale social reply network (50,000+ nodes).
Key Results and Discussion
Performance in Link Prediction
GDG-Mamba emerged as the top performer across most benchmarks, measured by Mean Average Precision (MAP) and Mean Reciprocal Rank (MRR). On the Reality Mining dataset, GDG-Mamba achieved a MAP of 0.4968, significantly outperforming the ST-TransformerG2G baseline (0.2252). The model's success on the UCI and Bitcoin-OTC datasets suggests that Mamba’s selective scan is highly effective at filtering noise in transient systems.
Computational Efficiency
The empirical validation of Mamba’s linear scaling is a primary contribution of this work. As the lookback window (the number of historical snapshots) increased, Transformer-based models exhibited a steep quadratic increase in FLOPs and MACs. In contrast, Mamba-based models showed a near-linear growth rate, confirming their suitability for long-sequence modeling in large-scale dynamic graphs.
The Role of Edge Features
The performance gap between GDG-Mamba and DG-Mamba underscores the importance of edge features. In networks like Bitcoin-OTC, the weight or type of a connection is as critical as the connection itself. The GINE-based approach in GDG-Mamba successfully integrated this information into the temporal state.
Limitations
While Mamba models performed exceptionally on most datasets, they underperformed on the Slashdot dataset. The authors attribute this to the dataset's extreme sparsity and limited temporal depth (only 12 snapshots). In such scenarios, the complex selective mechanism of GDG-Mamba may lead to overfitting compared to the more rigid attention patterns of a Transformer.
Conclusion
This study demonstrates that Mamba-based architectures offer a compelling alternative to Transformers for dynamic graph embedding. By providing linear scalability without sacrificing the ability to capture long-range dependencies, models like GDG-Mamba pave the way for real-time analysis of massive, evolving networks. Future research will focus on hybrid SSM-Transformer architectures and the application of these models to real-time anomaly detection and community clustering.
Summary updated