betaFeedback

WorksComputer Science

MambaTG: Candidate-Aware State Space Modeling for Future Link Prediction on Temporal Graphs

Abstract

Future link prediction on temporal graphs involves both repeated interactions between previously connected node pairs and first-time interactions between pairs with no prior interaction. While repeated-edge prediction can exploit direct pairwise evidence, unseen-edge prediction must generalize beyond historical recurrence. Existing temporal graph models often exploit signals tied to recurring interactions or historical overlap, which are highly informative for repeated edges but become limited or unavailable for unseen edges, contributing to substantial performance degradation on unseen-edge prediction. Based on this observation, we identify two complementary signals for modeling sequential dynamics beyond historical recurrence: (1) historical-sequence evolution, which captures dependencies among the source node's chronologically ordered interactions, and (2) candidate–history compatibility, which captures how well a candidate fits the source node's evolving history. Based on the decomposition, we propose MambaTG, a candidate-aware Mamba-based framework that jointly models these two signals. Mamba provides a natural mechanism for this design: its selective recurrence captures the evolution of ordered interaction histories, while its input-dependent state transitions allow the history state to adapt to different candidate inputs. Extensive experiments on 13 temporal graph datasets against 13 representative baselines show that MambaTG achieves strong and consistent performance across both repeated and unseen edges while remaining computationally efficient.

Introduction

Temporal graphs represent entities as nodes and their interactions as time-stamped edges ([9]). They provide a natural framework for modeling evolving relationships in applications such as social networks ([1]) and recommender systems ((Yu et al., 2024)). A fundamental task in temporal graph learning is future link prediction, which predicts interactions at a future query time from historical interactions ([5]). Future interactions can be divided into two categories, (1) repeated edges, connecting previously interacting node pairs, and (2) unseen edges, connecting pairs with no prior interaction ((Yi et al., 2025b)). Both arise naturally in real-world systems: users on a social platform may repeatedly interact with existing connections while also forming new connections with previously unrelated users. Despite their coexistence, the two regimes present distinct predictive challenges. Repeated-edge prediction can directly exploit prior pairwise interactions, whereas unseen-edge prediction must infer future relationships from broader patterns in historical behaviors. A practical temporal graph model must therefore capture recurring relationships while also generalizing to new ones without prior pairwise interactions.

However, some existing temporal link prediction methods still rely heavily on signals associated with repeated interactions. The competitiveness of EdgeBank, a non-parametric baseline that predicts links by memorizing previously observed edges, shows that historical recurrence alone can provide a remarkably strong signal on conventional benchmarks [14]. This bias toward recurrence is reflected in representative temporal graph neural network (T-GNN) designs. Recent methods such as DyGFormer(Yu et al., 2023), FreeDyGTian et al., [18], DyG-MambaLi et al., [11], and DyGMambaDing et al., [4] explicitly encode source–destination historical overlap through neighbor co-occurrence or interaction-frequency features. Such signals are highly informative for repeated edges but may be sparse or unavailable for unseen edges, particularly in bipartite graphs. Consistent with this limitation, recent benchmarks report substantially lower performance on unseen edges than on repeated edges (Yi et al., 2025b). These observations suggest that effective future link prediction requires moving beyond recurrence-based evidence and learning historical patterns that can generalize to previously unseen interactions.

This raises a more fundamental question: What predictive information should a temporal graph model learn from historical interactions to generalize beyond direct pairwise recurrence? We argue that the answer lies in two complementary signals: historical-sequence evolution and candidate–history compatibility, as illustrated through Learner A’s historical course interactions in Figure 1. (1) Historical-sequence evolution (Figure 1(a)) captures how historical interactions evolve in temporal order. The same interactions can imply different future behavior when ordered differently, as later interactions may reflect intentions developed through earlier ones. Capturing this signal therefore requires modeling dependencies among historical interactions as an ordered sequence, such that later interactions are interpreted in the context of the preceding history. (2) Candidate–history compatibility (Figure 1(b)) captures how well a candidate fits the source node’s evolving history. Explicitly modeling this relationship allows predictions to adapt to each candidate. However, many T-GNNs construct source and candidate representations largely independently and combine them only at the prediction stage [10, 2], limiting direct modeling of the relationship between the candidate and the source history. CRAFT (Yi et al., 2025a) directly matches each candidate against the source node’s individual historical interactions, but does not explicitly model dependencies arising from the history’s sequential evolution before candidate matching. Overall, the two signals capture distinct but complementary aspects of future interaction prediction: historical-sequence evolution characterizes dependencies within the ordered interaction history, whereas candidate–history compatibility reflects how that evolving history informs the prediction of a candidate interaction.

Figure 1. Illustration of two complementary signals for predicting Learner A’s next course choice from previously taken courses in Python, Machine Learning, Computer Vision, and Robotics.

Jointly modeling these complementary signals poses a non-trivial design challenge: historical-sequence evolution is shared across candidates, whereas candidate–history compatibility is inherently candidate-specific. To address this challenge, we propose MambaTG, an SSM-based framework that uses Mamba [6] as its sequential encoder. Its Candidate-Aware Mamba Encoder (CAME) first encodes the source’s ordered historical interactions into a shared history state and then adapts this state to each candidate through Mamba’s input-dependent state transitions. This design evaluates each candidate in the context of the evolved history while avoiding repeated history encoding. In addition, interaction histories may contain predictive patterns at different temporal scales, from slowly evolving preferences to rapid behavioral shifts. When modeled directly, dominant patterns at one scale may obscure weaker but predictive dynamics at another. We therefore introduce Dual-Branch Representation Refinement (DRR) to adaptively refine historical and candidate representations, providing CAME with more informative inputs for sequential encoding.

The main contributions of this work are summarized as follows:

  • A unified view of sequential dynamics. We characterize sequential dynamics for future link prediction through two complementary signals: historical-sequence evolution and

candidate–history compatibility. Through empirical analysis, we show that both signals contribute to strong performance across repeated- and unseen-edge prediction.

  • An efficient candidate-aware Mamba-based framework. We propose MambaTG, which jointly captures these two signals through a Candidate-Aware Mamba Encoder and improves input representations through Dual-Branch Representation Refinement. By reusing the encoded historical state across candidates, MambaTG avoids repeated history encoding and enables efficient candidate evaluation.

  • Extensive empirical validation. We evaluate MambaTG on 13 future link prediction datasets. MambaTG achieves strong performance across repeated- and unseen-edge prediction and attains the best average rank among all baselines. Efficiency and ablation studies further demonstrate its scalability and validate its principal design choices.

Related Work

Temporal Graph Learning Methods for Future Link Prediction. Temporal graph models use diverse architectures to encode interaction histories, including memory-based methods such as JODIE [10], DyRep [19], and TGN [16], attention-based methods such as TGAT (Xu et al., 2020), TCL [20], DyGFormer (Yu et al., 2023), and SimpleDyG [22], and alternative encoders such as CAWN [21], GraphMixer [2], and FreeDyG [18]. From the perspective of sequential dynamics, these methods differ in how they capture historical-sequence evolution and candidate–history compatibility. Many methods encode the source history and candidate largely independently and combine their representations only at the prediction stage [10, 19, 16, 2, 22] (Xu et al. 2020), limiting direct candidate conditioning of the source history. Other approaches incorporate information from both endpoints through temporal motifs, cross-subgraph interactions, neighbor co-occurrence, or pairwise statistics (Wang et al., 2021b;a; Yu et al., 2023; Tian et al., 2024), but primarily characterize relationships between the source and destination histories rather than how a candidate relates to the source’s evolving history. CRAFT (Yi et al., 2025a) directly matches each candidate against the source node’s individual historical interactions, but does not explicitly model dependencies arising from the history’s sequential evolution before candidate matching. In contrast, MambaTG jointly models historical-sequence evolution and candidate–history compatibility by first encoding the ordered source history to model its evolution and then adapting the resulting state to each candidate.

Mamba-Based Models for Continuous-Time Dynamic Graphs. Mamba [6] is a selective state-space model that efficiently models long sequences through input-dependent state transitions with linear sequence-length complexity. Recent studies have adapted Mamba to continuous-time dynamic graphs. DyGMamba [4] uses node- and time-level Mamba to encode long histories and identify temporally relevant interactions, while DyG-Mamba [11] incorporates irregular inter-event times into state transitions for elapsed-time-aware forgetting and selective retention. These methods primarily focus on efficient long-history encoding and irregular temporal dynamics. In contrast, MambaTG uses candidate-aware continuation from the evolving source history to jointly model historical-sequence evolution and candidate–history compatibility, targeting effective prediction across both repeated and unseen edges.

Preliminaries

Temporal Graph and Future Link Prediction. A temporal graph is represented as G=(V,E)\mathcal{G} = (\mathcal{V}, \mathcal{E}), where V\mathcal{V} is the node set and E=((ui,vi,ti))i=1M\mathcal{E} = \left((u_i, v_i, t_i)\right)_{i=1}^{M} is a chronologically ordered stream of MM interactions. Here, ui∈Vu_i \in\mathcal{V} and vi∈Vv_i \in\mathcal{V} denote the source and destination nodes of the ii-th interaction, respectively, and tit_i denotes its timestamp, with t1≤t2≤⋯≤tMt_1 \leq t_2 \leq\cdots\leq t_M. At a query time tqt_q, the observed history is E<tq={(ui,vi,ti)∈E∣ti<tq}\mathcal{E}_{<t_q} = \{(u_i, v_i, t_i) \in\mathcal{E} \mid t_i < t_q\}. Given a source node uu and a candidate set Ctqu\mathcal{C}_{t_q}^{u}, future link prediction assigns each candidate destination ci∈Ctquc_i \in\mathcal{C}_{t_q}^{u} a score conditioned on E<tq\mathcal{E}_{<t_q} and ranks the true destination above negative candidates. A candidate edge (u,ci)(u, c_i) is repeated if the pair appears in E<tq\mathcal{E}_{<t_q}, and unseen otherwise (Yi et al., 2025b).

Discrete Fourier Transform. Let X=(xn)n=0N−1∈RN×d\mathbf{X} = (x_n)_{n=0}^{N-1} \in\mathbb{R}^{N \times d} be a sequence of dd-dimensional representations. The discrete Fourier transform (DFT) and its inverse (IDFT), applied along the temporal dimension, are defined as

x^m=∑n=0N−1xnexp⁡(−i2πmnN),xn=1N∑m=0N−1x^mexp⁡(i2πmnN)(1)\widehat{x}_m = \sum_{n=0}^{N-1} x_n \exp\left(-i\frac{2\pi mn}{N}\right), \qquad x_n = \frac{1}{N}\sum_{m=0}^{N-1}\widehat{x}_m \exp\left(i\frac{2\pi mn}{N}\right) \tag*{(1)}

where x^m∈Cd\widehat{x}_m \in\mathbb{C}^d is the mm-th frequency component and i2=−1i^2=-1. For real-valued inputs, the real FFT (rFFT) and its inverse (irFFT) are commonly used [17].

State Space Models. State space models (SSMs) represent sequences through latent states that evolve over time. Given x(t)∈Rx(t) \in\mathbb{R}, an SSM produces y(t)∈Ry(t) \in\mathbb{R} from a latent state h(t)∈RNh(t) \in\mathbb{R}^N:

h′(t)=Ah(t)+Bx(t),y(t)=Ch(t).(2)h'(t) = Ah(t) + Bx(t), \qquad y(t) = Ch(t). \tag*{(2)}

Here, A∈RN×NA \in\mathbb{R}^{N \times N} is the state-transition matrix, B∈RN×1B \in\mathbb{R}^{N \times1} projects the input into the latent state, and C∈R1×NC \in\mathbb{R}^{1 \times N} maps the latent state to the output. To process a discrete sequence, the continuous system is discretized using a step size Δ\Delta:

ht=Aˉht−1+Bˉxt,yt=Cht.(3)h_t = \bar{A}h_{t-1} + \bar{B}x_t, \qquad y_t = Ch_t. \tag*{(3)}

Under zero-order-hold discretization, the discrete parameters are given by Aˉ=exp⁡(ΔA)\bar{A} = \exp(\Delta A) and Bˉ=(ΔA)−1(exp⁡(ΔA)−I)ΔB\bar{B} = (\Delta A)^{-1}(\exp(\Delta A)-I)\Delta B. Unlike conventional SSMs with input-independent parameters, Mamba uses input-dependent BB, CC, and Δ\Delta with a hardware-aware selective scan for efficient recurrence computation [6].

Method

The overall MambaTG framework is illustrated in Figure 2. Given a source node uu, a query timestamp tqt_q, and its chronologically ordered interaction history Hutq=((v1,t1),…,(vℓu,tℓu))H_u^{t_q} = ((v_1,t_1), \ldots, (v_{\ell_u},t_{\ell_u})), where ℓu≤Lmax⁡\ell_u \le L_{\max} and t1≤⋯≤tℓu<tqt_1 \le\cdots\le t_{\ell_u} < t_q, MambaTG assigns a link-prediction score to each candidate ci∈Cutqc_i \in C_u^{t_q}. It first combines node embeddings with query-relative time encodings to construct historical and candidate representations. Dual-Branch Representation Refinement then enhances these representations through separate historical and candidate refinement branches, after which Candidate-Aware Mamba Encoder recurrently encodes the refined history and incorporates each candidate through an additional state update. Finally, a link classifier maps each history-conditioned candidate representation to a prediction score.

Figure 2. Framework of the proposed MambaTG model.

Node and Time Encoding.

Node embedding. Following Yi et al. (2025a), we associate node v∈Vv \in\mathcal{V} with a trainable identifier embedding Emb⁡(v)∈Rde\operatorname{Emb}(v) \in\mathbb{R}^{d_e}. Given a query time tqt_q, let CutqC_u^{t_q} denote the set of q=∣Cutq∣q = |C_u^{t_q}| candidate destinations. We arrange the embeddings of the ℓu\ell_u historical neighbors and candidate destinations row-wise as EH=[Emb⁡(vi)]i=1ℓu∈Rℓu×deE_H = [\operatorname{Emb}(v_i)]_{i=1}^{\ell_u} \in\mathbb{R}^{\ell_u \times d_e} and ED=[Emb⁡(cj)]j=1q∈Rq×deE_D = [\operatorname{Emb}(c_j)]_{j=1}^{q} \in\mathbb{R}^{q \times d_e}, respectively.

Time encoding. To incorporate temporal information, we encode elapsed times relative to the query time tqt_q. For each historical interaction occurring at time tit_i, its elapsed time is ΔtiH=tq−ti\Delta t_i^H = t_q - t_i. For candidate cjc_j, we instead use its activity recency ΔtcjD=tq−tcjlast\Delta t_{c_j}^D = t_q - t_{c_j}^{\mathrm{last}}, where tcjlast<tqt_{c_j}^{\mathrm{last}} < t_q is its most recent interaction with any node in the global graph. For cold-start candidates with no prior interactions, we set ΔtcjD=0\Delta t_{c_j}^D = 0. Following Xu et al. (2020), each elapsed time is mapped to a dTd_T-dimensional representation using ϕ:R≥0→RdT\phi: \mathbb{R}_{\geq0} \to\mathbb{R}^{d_T}. The resulting historical and candidate time encodings are TH=[ϕ(ΔtiH)]i=1ℓu∈Rℓu×dT\mathbf{T}_H = [\phi(\Delta t_i^H)]_{i=1}^{\ell_u} \in\mathbb{R}^{\ell_u \times d_T} and TD=[ϕ(ΔtcjD)]j=1q∈Rq×dT\mathbf{T}_D = [\phi(\Delta t_{c_j}^D)]_{j=1}^{q} \in\mathbb{R}^{q \times d_T}, respectively.

Feature fusion. To jointly capture node identity and temporal context, we combine the node and time representations: ZH=Linear⁡([EH∥TH])∈Rℓu×d\mathbf{Z}_H = \operatorname{Linear}([\mathbf{E}_H \mathbin\Vert\mathbf{T}_H]) \in\mathbb{R}^{\ell_u \times d} and ZD=Linear⁡([ED∥TD])∈Rq×d\mathbf{Z}_D = \operatorname{Linear}([\mathbf{E}_D \mathbin\Vert\mathbf{T}_D]) \in\mathbb{R}^{q \times d}, where ∥\mathbin\Vert denotes feature-wise concatenation and Linear⁡(⋅)\operatorname{Linear}(\cdot) is a shared linear projection.

Dual-Branch Representation Refinement (DRR).

An interaction history may simultaneously contain slowly evolving trends, recurring behavior, and abrupt short-term changes. Without prior refinement, stronger patterns at one scale may obscure subtler yet predictive dynamics at other scales. We therefore introduce Dual-Branch Representation Refinement, comprising Historical Spectral Refinement (HSR) and Candidate Feature Refinement (CFR). HSR exposes and adaptively refines frequency components associated with these patterns, while CFR recalibrates candidate features for compatibility with the refined history.

Historical Spectral Refinement. We transform ZH\mathbf{Z}_H into the frequency domain along its temporal dimension, yielding Z^H=rFFT⁡Lmax⁡(ZH)∈C(⌊Lmax⁡/2⌋+1)×d\widehat{\mathbf{Z}}_H = \operatorname{rFFT}_{L_{\max}}(\mathbf{Z}_H) \in\mathbb{C}^{(\lfloor L_{\max}/2 \rfloor+1)\times d}, where Lmax⁡≥ℓuL_{\max} \geq\ell_u is the transform length and zero-padding is applied when ℓu<Lmax⁡\ell_u < L_{\max}. Inspired by spectral filtering in FreeDyG (Tian et al., [18]), HSR modulates each frequency component using learnable complex-valued weights:

Z^HHSR=Z^H⊙WH,WH∈C(⌊Lmax⁡/2⌋+1)×d(4)\widehat{\mathbf{Z}}_H^{\mathrm{HSR}} = \widehat{\mathbf{Z}}_H \odot\mathbf{W}_H,\quad\mathbf{W}_H \in\mathbb{C}^{(\lfloor L_{\max}/2 \rfloor+1)\times d} \tag*{(4)}

Here, ⊙\odot denotes element-wise multiplication. The complex-valued weights WH\mathbf{W}_H enable the model to selectively adjust the magnitude and phase of temporal patterns across different frequencies. Applying the inverse transform with output length Lmax⁡L_{\max} yields ZHHSR=[irFFT⁡Lmax⁡(Z^HHSR)]1:ℓu∈Rℓu×d\mathbf{Z}_H^{\mathrm{HSR}} = [\operatorname{irFFT}_{L_{\max}}(\widehat{\mathbf{Z}}_H^{\mathrm{HSR}})]_{1:\ell_u} \in\mathbb{R}^{\ell_u \times d}, where the first ℓu\ell_u positions corresponding to the original history are retained.

Candidate Feature Refinement. To promote alignment between candidate representations and the spectrally refined historical representations, CFR learnably rescales candidate features through a lightweight feature-wise transformation. Specifically, for each candidate representation zci=ZD[i]∈Rd\mathbf{z}_{c_i} = \mathbf{Z}_D[i] \in\mathbb{R}^d, we compute zciCFR=zci⊙wD\mathbf{z}_{c_i}^{\mathrm{CFR}} = \mathbf{z}_{c_i} \odot\mathbf{w}_D where wD∈Rd\mathbf{w}_D \in\mathbb{R}^d is a learnable vector shared across candidates.

Candidate-Aware Mamba Encoder (CAME).

Modeling sequential dynamics requires capturing both historical-sequence evolution and candidate–history compatibility. Mamba (Gu & Dao, [6]) is well suited to this objective because its selective recurrence summarizes ordered sequences into recurrent states while its input-dependent state transitions allow the same historical state to respond differently to different candidates. CAME stacks RR layers, each consisting of a Mamba block followed by a position-wise feed-forward network (FFN). Detailed formulations of these standard components are provided in Appendix § 10.§ 1.

Historical-sequence encoding. CAME first encodes the source node’s interaction history in chronological order to capture its sequential evolution. The refined historical representations ZHHSR∈Rℓu×d\mathbf{Z}_H^{\mathrm{HSR}} \in\mathbb{R}^{\ell_u \times d} are padded to Lmax⁡L_{\max} for batching. We initialize XH(0)=Pad⁡(ZHHSR,Lmax⁡)\mathbf{X}_H^{(0)} = \operatorname{Pad}(\mathbf{Z}_H^{\mathrm{HSR}}, L_{\max}). At each layer rr, CAME processes the complete historical sequence once and retains its terminal recurrent cache:

(MH(r),KH(r))=MambaBlock⁡(r)(XH(r−1)),X~H(r)=LN⁡1(r)(XH(r−1)+MH(r)),\left(\mathbf{M}_H^{(r)}, \mathcal{K}_H^{(r)}\right) = \operatorname{MambaBlock}^{(r)}\left(\mathbf{X}_H^{(r-1)}\right), \qquad\widetilde{\mathbf{X}}_H^{(r)} = \operatorname{LN}_1^{(r)}\left(\mathbf{X}_H^{(r-1)} + \mathbf{M}_H^{(r)}\right),
XH(r)=LN⁡2(r)(X~H(r)+FFN⁡(r)(X~H(r))),r=1,…,R.(5)\mathbf{X}_H^{(r)} = \operatorname{LN}_2^{(r)}\left(\widetilde{\mathbf{X}}_H^{(r)} + \operatorname{FFN}^{(r)}\left(\widetilde{\mathbf{X}}_H^{(r)}\right)\right), \qquad r = 1,\ldots,R. \tag*{(5)}

Here, MH(r)M_H^{(r)} denotes the Mamba output representations for the historical sequence, while KH(r)K_H^{(r)} contains the terminal SSM and causal-convolution states required to continue the rr-th Mamba layer with one additional token. Through recurrent state propagation, historical representations incorporate information from earlier interactions, enabling CAME to capture historical-sequence evolution.

Candidate continuation. For candidate cic_i, we initialize xci(0)=zciCFRx_{c_i}^{(0)} = z_{c_i}^{\mathrm{CFR}}. At each layer, the candidate is processed as one additional input following the historical sequence by continuing from the corresponding terminal history cache:

mci(r)=MambaStep⁡(r)(xci(r−1);KH(r)),x~ci(r)=LN⁡1(r)(xci(r−1)+mci(r)),xci(r)=LN⁡2(r)(x~ci(r)+FFN⁡(r)(x~ci(r))),r=1,…,R.(6)\begin{aligned} m_{c_i}^{(r)} &= \operatorname{MambaStep}^{(r)}\left(x_{c_i}^{(r-1)};K_H^{(r)}\right), \qquad\widetilde{x}_{c_i}^{(r)} = \operatorname{LN}_1^{(r)}\left(x_{c_i}^{(r-1)} + m_{c_i}^{(r)}\right),\\ x_{c_i}^{(r)} &= \operatorname{LN}_2^{(r)}\left(\widetilde{x}_{c_i}^{(r)} + \operatorname{FFN}^{(r)}\left(\widetilde{x}_{c_i}^{(r)}\right)\right), \qquad r=1,\ldots,R. \tag*{(6)} \end{aligned}

Here, MambaStep⁡(r)\operatorname{MambaStep}^{(r)} shares its parameters with MambaBlock⁡(r)\operatorname{MambaBlock}^{(r)} and continues the recurrence for one additional input using KH(r)K_H^{(r)}. Since the selective state-space parameters depend on the candidate input xci(r−1)x_{c_i}^{(r-1)}, each candidate induces a different state update from the shared historical cache. The resulting representation is therefore conditioned jointly on the candidate and the evolved historical state, capturing candidate–history compatibility. By reusing the terminal history cache across candidates, MambaTG encodes the history only once, while each candidate requires only one additional recurrent update per layer, avoiding redundant history encoding. After RR layers, the history-conditioned candidate representation is hu,citq=xci(R)∈Rdh_{u,c_i}^{t_q}=x_{c_i}^{(R)}\in\mathbb{R}^{d}.

Link Classifier.

Following Yi et al. (2025a), we project the candidate’s activity recency, ΔtciD=tq−tcilast\Delta t_{c_i}^{D}=t_q-t_{c_i}^{\mathrm{last}}, and concatenate it with the candidate representation hu,citqh_{u,c_i}^{t_q}. Prediction score is computed as:

y^u,citq=MLP⁡([hu,citq∥Linear⁡Δ(ΔtciD)])(7)\hat{y}_{u,c_i}^{t_q}=\operatorname{MLP}\left([h_{u,c_i}^{t_q}\Vert\operatorname{Linear}_{\Delta}(\Delta t_{c_i}^{D})]\right) \tag*{(7)}

where ∥\Vert denotes feature-wise concatenation. For repeated-edge-dominant datasets, we use MambaTG-R, which additionally projects and concatenates the historical repetition frequency nu,citqn_{u,c_i}^{t_q}, defined as the number of interactions between uu and cic_i before tqt_q. Both variants are optimized using Bayesian Personalized Ranking (BPR) [15], which encourages observed destinations to receive higher scores than sampled negatives.

Time Complexity Analysis

We analyze the time complexity of future link prediction for a batch of source nodes and their candidate destinations. Let BB denote the number of source queries, qq the number of candidates per source, ℓ\ell the number of historical interactions considered per node, dd the feature dimension, and dˉ\bar{d} the average node degree. Table 1 summarizes the resulting complexities; detailed derivations and assumptions are provided in Appendix I.

MethodHistorical-Neighbor ExtractionEdge Likelihood Computation
TGNB(1+q)log⁡dˉB(1+q)\log\bar{d}B(1+q)ℓd2B(1+q)\ell d^2
TGATB(1+q)(1+ℓ)log⁡dˉB(1+q)(1+\ell)\log\bar{d}B(1+q)ℓ2d2B(1+q)\ell^2d^2
GraphMixerB(1+q)log⁡dˉB(1+q)\log\bar{d}B(1+q)ℓd2B(1+q)\ell d^2
DyGFormerB(1+q)log⁡dˉB(1+q)\log\bar{d}B(1+q)(ℓd2+ℓ2d)B(1+q)(\ell d^2+\ell^2d)
DyG-MambaB(1+q)log⁡dˉB(1+q)\log\bar{d}Bqℓd2Bq\ell d^2
DyGMambaB(1+q)log⁡dˉB(1+q)\log\bar{d}Bqℓd2Bq\ell d^2
CRAFTBlog⁡dˉB\log\bar{d}B(ℓ+q)d2+BqℓdB(\ell+q)d^2+Bq\ell d
MambaTGBlog⁡dˉB\log\bar{d}B(ℓ+q)d2+Bℓdlog⁡ℓB(\ell+q)d^2+B\ell d\log\ell

Table 1. Candidate-scoring time complexity. Entries omit O(⋅)O(\cdot) and fixed architectural constants.

MambaTG retrieves only the source history, requiring O(Blog⁡dˉ)O(B \log\bar{d}) time for temporal-index lookup. For edge likelihood computation, DRR refines each history in O(Bℓdlog⁡ℓ)O(B\ell d \log\ell) time, while CAME encodes it once and reuses its layer-wise terminal caches across candidates, costing O(B(ℓ+q)d2)O(B(\ell+ q)d^2). The total complexity is O(B(ℓ+q)d2+Bℓdlog⁡ℓ)O(B(\ell+ q)d^2 + B\ell d \log\ell). Unlike methods that encode both endpoints, MambaTG uses only the source history, avoiding candidate-dependent neighborhood retrieval. The separation of history encoding from candidate evaluation further avoids repeated processing across candidates and yields more favorable asymptotic scaling than CRAFT when q>log⁡ℓq > \log\ell, as in our evaluation, with q=101q = 101 and ℓ\ell up to 1000. Together, they enable scalable prediction over long histories and large candidate sets in applications such as recommendation and social-link prediction.

Experiments

Experimental Setup

Datasets. We evaluate MambaTG on 13 future link prediction datasets, including seven datasets from TGB-Seq (Yi et al. (2025b)) and six commonly used temporal graph datasets. Following Yi et al. (2025a), we categorize them as repeated-edge-dominant or unseen-edge-dominant according to the relative prevalence of repeated and unseen edges. Dataset details are provided in Appendix § 9.§ 2.

Baselines. We compare MambaTG with twelve representative temporal graph baselines: EdgeBank (Poursafaei et al. [14]), CRAFT (Yi et al. (2025a)), JODIE (Kumar et al. [10]), DyRep (Trivedi et al. [19]), TGAT (Xu et al. (2020)), TGN (Rossi et al. [16]), CAWN (Wang et al. [21]), GraphMixer (Cong et al. [2]), DyGFormer (Yu et al. (2023)), FreeDyG (Tian et al. [18]), DyG-Mamba (Li et al. [11]), and DyGMamba (Ding et al. [4]). Following Yi et al. (2025a), we additionally include SGNN-HN (Pan et al. [13]), a session-based recommendation method, as a sequential baseline. Together, these methods span non-parametric, memory-based, attention-based, walk-based, MLP-based, frequency-based, Mamba-based, and sequential recommendation architectures. Baseline details are provided in Appendix § 9.§ 3.

ModelML-20MTaobaoYelpGoogleLocalFlickrYouTubeWikiLinkAvg.Rk.
JODIE21.16±0.7348.36±2.1869.88±0.3141.86±1.4946.21±0.8341.67±2.8657.94±1.336.43 (7/7)
DyRep19.00±1.6940.03±2.4057.69±1.0537.73±1.3438.04±4.1935.12±4.1342.63±1.338.29 (7/7)
TGAT10.47±0.20−−19.78±0.2423.53±3.3543.56±2.53−10.75 (4/7)
TGN23.99±0.2060.28±0.5469.79±0.2454.13±1.9746.03±6.7855.16±5.8962.94±2.165.29 (7/7)
CAWN12.31±0.02−25.71±0.0918.26±0.0248.69±6.0847.55±1.08−9.00 (5/7)
GraphMixer21.97±0.1731.54±0.0233.96±0.1921.31±1.1445.01±0.0858.87±0.1248.57±0.026.86 (7/7)
DyGFormer−−21.68±0.2018.39±0.0249.58±2.8746.08±3.44−9.00 (4/7)
DyGMamba5.86±0.21−−17.64±0.0652.07±0.4354.09±1.68−9.25 (4/7)
DyG-Mamba−−−17.34±0.3655.86±0.1456.71±0.23−8.00 (3/7)
FreeDyG20.67±0.70−−20.49±0.1356.22±0.3360.35±0.21−5.00 (4/7)
SGNN-HN33.12±0.0168.58±0.2169.34±0.4462.88±0.5160.15±0.2059.64±0.2269.37±0.393.14 (7/7)
CRAFT35.91±0.6570.68±0.4272.69±0.6162.35±0.4662.34±0.8458.92±0.1675.48±0.842.29 (7/7)
MambaTG37.98±0.1173.06±0.2175.85±0.1764.62±0.4563.94±0.7259.81±0.7475.38±0.131.29 (7/7)

Table 2. Future link prediction performance on (a) unseen-edge-dominant and (b) repeated-edge-dominant datasets. Results are reported as MRR (%), averaged over three random seeds. The best, second-best, and third-best results are highlighted. Avg.Rk. denotes the average rank over datasets with reported results (lower is better); parentheses indicate coverage in (a).

ModelWikipediaRedditMOOCLastFMUCIFlightsAvg.Rk.
EdgeBank77.94±0.0077.88±0.009.76±0.0019.07±0.0039.43±0.0054.46±0.0011.50
JODIE76.48±1.7277.16±1.2719.91±3.0618.49±2.8751.43±1.7420.37±4.1811.83
DyRep67.42±4.2172.33±2.1417.71±1.2717.76±6.5614.00±2.7115.62±0.4713.67
TGAT72.72±1.5078.03±0.2531.55±4.1424.10±1.2631.50±0.4853.90±1.0711.17
TGN82.22±0.3979.25±0.2439.03±4.5325.59±4.4345.29±6.4364.24±2.119.25
CAWN86.07±0.0887.66±0.0427.02±0.5735.10±0.3466.96±0.4880.06±2.108.00
GraphMixer73.57±1.4870.87±0.3829.02±0.2826.76±1.4259.58±1.0042.26±0.4910.83
DyGFormer88.69±0.0488.70±0.0542.20±1.3146.50±0.5176.61±0.2684.13±3.464.83
DyGMamba89.10±0.1789.00±0.0347.17±1.4346.39±0.4976.98±0.4685.02±0.283.50
DyG-Mamba88.50±0.2188.77±0.1447.33±0.2353.42±0.1978.25±0.6081.47±0.044.00
FreeDyG90.18±0.1289.16±0.0544.51±0.3749.19±0.5574.55±1.1281.10±0.064.33
SGNN-HN82.22±0.3587.42±0.0457.25±0.1740.72±0.2657.23±0.3980.80±0.147.08
CRAFT-R88.25±0.2689.33±1.1162.32±0.3955.21±0.2375.11±0.0983.16±0.163.50
MambaTG-R88.99±0.0289.71±0.1064.77±0.2256.98±0.2479.31±0.2684.51±0.031.50

Table 2 (PDF p. 7). Future link prediction performance on (a) unseen-edge-dominant and (b) repeated-edge-dominant datasets. Results are reported as MRR (%), averaged over three random seeds. The best, second-best, and third-best results are highlighted. Avg.Rk. denotes the average rank over datasets with reported results (lower is better); parentheses indicate coverage in (a).

Evaluation Settings and Metrics. Following TGB-Seq (Yi et al., 2025b), we use Mean Reciprocal Rank (MRR) [3] as the evaluation metric and adopt official negative samples when available. Otherwise, we randomly sample 100 negative destinations per positive interaction. All datasets are split chronologically into 70%/15%/15%70\%/15\%/15\% for training, validation, and testing, respectively. We report the average performance over three random seeds. Further evaluation and implementation details are provided in Appendix § 9.§ 4.

Predictive Effectiveness and Computational Efficiency

Overall Predictive Performance. Table 2 reports MRR across all datasets. We use MambaTG for unseen-edge-dominant datasets and MambaTG-R for repeated-edge-dominant datasets, with the latter additionally incorporating source–candidate repetition frequency. EdgeBank, FreeDyG, DyGMamba, and DyGMamba results are from our experiments, while the remaining baseline results are taken from prior studies (Yi et al., 2025a;b). Missing entries indicate experiments exceeding the specified runtime or GPU memory budget. Further details are provided in Appendix § 9.§ 4.

MambaTG and MambaTG-R achieve the best performance on 9 of the 13 datasets, with strong performance across the remaining datasets, and attain the best average rank in both regimes: 1.29 on unseen-edge-dominant datasets and 1.50 on repeated-edge-dominant datasets. We attribute these gains primarily to two design choices: (i) CAME jointly captures historical-sequence evolution and candidate–history compatibility, supporting prediction across repeated and unseen edges, as validated in § 5.3 and Appendix § 14; and (ii) DRR refines historical patterns associated with different temporal scales while promoting compatibility between the refined history and candidate representations, as examined in § 5.4 and Appendix § 13. Moreover, layer-wise caching encodes each source history once and reuses its terminal states across candidates, enabling MambaTG to scale to large datasets on which several competing methods exceed the computational budget, as analyzed in Figure 4 and Appendix § 17.§ 1.

Figure 4. Performance versus efficiency on MOOC. Bubble size indicates model size.

Long-Sequence Effectiveness. To assess MambaTG’s ability to exploit long interaction histories, we evaluate it on LastFM, which benefits from longer historical sequences. We vary the maximum source-history length ℓ\ell and compare MambaTG-R with other representative baselines.2 As shown in Figure 3, MambaTG-R maintains strong performance as ℓ\ell increases, while CRAFT-R and DyGFormer degrade with longer histories. These results demonstrate MambaTG’s robustness to increasing history lengths and its ability to leverage extended temporal context effectively.

Figure 3. Long-sequence effectiveness on LastFM.

Performance–Efficiency Trade-off. Figure 4 illustrates the trade-off between predictive performance and computational efficiency on MOOC. MambaTG-R consistently achieves the highest test MRR while remaining competitive in parameter size and per-epoch training time. In particular, MambaTG-R achieves up to 8.9× faster per-epoch training and a 6.3× smaller parameter footprint than competing methods. Overall, MambaTG-R offers the most favorable trade-off between predictive performance and computational efficiency across the evaluated datasets. Results on UCI and LastFM in Appendix § 17.§ 2.

Validating Historical-Sequence Evolution and Candidate–History Compatibility

Our hypothesis is that MambaTG’s effectiveness arises from jointly modeling historical-sequence evolution and candidate–history compatibility. To validate this hypothesis, we examine whether performance decreases when (i) the chronological order of the source node’s interaction history is disrupted and (ii) candidate-conditioned state updating is replaced with separate history–candidate fusion.

For (i), following Kim et al. (2025), we adopt ShuffledTrain and ShuffledInference, which permute the source node’s interaction history only during training or evaluation, respectively. We additionally introduce ShuffledBoth, which shuffles histories during both training and evaluation. Table 3 shows lower macro-average MRR for all three variants in both dataset groups. In particular, the degradation under ShuffledBoth, which preserves neighbor identities while disrupting chronological order, shows that chronological order provides predictive information beyond neighbor identity. Degradation under ShuffledInference indicates that MambaTG’s predictions depend on the chronological ordering of historical interactions. Together, these results show that MambaTG leverages historical-sequence evolution rather than treating the history as an unordered set.

VariantRepeatedUnseen
ShuffledTrain-8.23-1.56
ShuffledInference-27.21-3.53
ShuffledBoth-4.22-1.78
LateFusion-2.88-3.98

Table 3. Macro-average MRR change (pp) relative to full MambaTG under signal ablations.

For (ii), we introduce LateFusion, which retains the original history encoder but replaces the candidate-conditioned Mamba continuation with MLP-based fusion of the separately encoded history and candidate representations, a common prediction design in T-GNNs. The resulting degradation indicates that late-stage fusion does not fully recover the benefit of candidate continuation from the evolved historical state. The larger degradation on GoogleLocal and YouTube further suggests that candidate–history compatibility is particularly important for unseen-edge prediction. Overall, these findings support our hypothesis that jointly modeling historical-sequence evolution and candidate–history compatibility yields MambaTG’s strongest performance. Detailed settings and per-dataset results are provided in Appendix § 11.

Ablation Study

We ablate five components of MambaTG: (1) Historical Spectral Refinement (HSR) and (2) Candidate Feature Refinement (CFR) within DRR, (3) Query-relative time encoding, (4) Candidate activity recency, and (5) Historical repetition frequency. Table 4 reports the macro-average MRR (%) reduction across two repeated-edge-dominant (UCI, MOOC) and two unseen-edge-dominant (GoogleLocal, Flickr) datasets. Variant definitions and per-dataset results are provided in Appendix § 12.

Removed componentRepeatedUnseen
HSR-0.21-1.74
CFR-0.57-1.28
Query-relative time encoding-2.87-1.77
Candidate activity recency-2.35-1.03
Historical repetition freq.-5.67N/A

Table 4. Macro-average MRR change (pp) under component ablations. Repetition frequency applies only to repeated-edge-dominant datasets.

Overall, all components contribute to MambaTG, but their importance differs across prediction regimes. Query-relative time encoding, candidate activity recency, and historical repetition frequency contribute more strongly to repeated-edge prediction, where the timing and frequency of previous source–candidate interactions provide direct evidence of recurrence. In contrast, HSR and CFR show more significant contributions to unseen-edge prediction, where prediction relies more heavily on patterns extracted from the source history and informative candidate representations.

Conclusion

In this paper, we identified historical-sequence evolution and candidate–history compatibility as complementary sources of predictive information beyond direct pairwise recurrence. We proposed MambaTG, a candidate-aware Mamba-based framework that jointly models these signals to capture how ordered interaction histories evolve and relate to each candidate. Across 13 temporal graph datasets, MambaTG achieves strong performance in repeated-edge-dominant and unseen-edge-dominant settings while efficiently handling long histories and large candidate sets.

AI USE STATEMENT

We used generative AI tools to assist with code implementation, provide writing feedback, identify relevant literature, and provide feedback on experimental methodology. We reviewed the AI-assisted work and take responsibility for the final content.

Abbreviations

TermMeaning
CAMECandidate-Aware Mamba Encoder
DRRDual-Branch Representation Refinement
HSRHistorical Spectral Refinement
CFRCandidate Feature Refinement
MRRMean Reciprocal Rank
-RSuffix indicating historical repetition frequency
w/oWithout the specified component
ppPercentage points
OOMExceeds the memory budget
OOTExceeds the time budget

Table 5. Key abbreviations and shorthand.

Experimental Details

Hardware and Software Environment

All experiments were conducted on NVIDIA RTX PRO 6000 Blackwell GPUs with 96GB of memory. Our implementation uses Python 3.11, PyTorch 2.7.1, and CUDA 12.8, together with mamba-ssm 2.3.1 and causal-conv1d 1.6.2.

Dataset Details

Our main evaluation includes 13 future link prediction datasets. Seven are from TGB-Seq (Yi et al. (2025b)): ML-20M, Taobao, Yelp, GoogleLocal, Flickr, YouTube, and WikiLink. The remaining six are commonly used temporal graph datasets: Wikipedia, Reddit, MOOC, LastFM, UCI, and Flights. We additionally evaluate MambaTG on three datasets from TGB (Huang et al. [7]): tgbl-comment, tgbl-coin, and tgbl-flight. These additional results are reported in Appendix § 17.§ 3.

Following Yi et al. (2025a), we classify datasets as unseen-edge-dominant if most target interactions are previously unseen edges, and as repeated-edge-dominant if most are repeated edges. The datasets are obtained from the TGB-Seq collection, the TGB repository, and the public Zenodo archive. Table 6 summarizes their statistics; for bipartite datasets, the two node counts correspond to the source and destination node types.

DatasetNodesEdgesTimestampsRepeat Ratio (%)Density (%)BipartiteDomainRegime
ML-20M100,785/9,64614,494,3259,993,25001.49×1001.49 \times10^{0}YesMovie ratingUnseen
Taobao760,617/863,01618,853,792139,17116.582.87×10−32.87 \times10^{-3}YesE-commerce interactionUnseen
Yelp1,338,688/405,08119,760,29314,646,73425.183.64×10−33.64 \times10^{-3}YesBusiness reviewUnseen
GoogleLocal206,244/267,3361,913,9671,771,06003.47×10−33.47 \times10^{-3}YesBusiness reviewUnseen
Flickr233,8367,223,55913401.32×10−21.32 \times10^{-2}NoWho-to-followUnseen
YouTube402,4223,288,02820302.03×10−32.03 \times10^{-3}NoWho-to-followUnseen
WikiLink1,361,97234,163,7742,19801.84×10−31.84 \times10^{-3}NoWeb linkUnseen
Wikipedia8,227/1,000157,474152,75788.411.91×1001.91 \times10^{0}YesInteractionRepeated
Reddit10,000/984672,447669,06588.326.83×1006.83 \times10^{0}YesSocialRepeated
MOOC7,047/97411,749345,60056.666.02×1016.02 \times10^{1}YesInteractionRepeated
LastFM980/1,0001,293,1031,283,61488.011.32×1021.32 \times10^{2}YesInteractionRepeated
UCI1,89959,83558,91166.061.66×1001.66 \times10^{0}NoSocialRepeated
Flights13,1691,927,14512279.501.11×1001.11 \times10^{0}NoTransportRepeated
tgbl-comment994,79044,314,50730,998,03019.814.48×10−34.48 \times10^{-3}NoSocialUnseen
tgbl-coin638,48622,809,4861,295,72082.935.60×10−35.60 \times10^{-3}NoTransactionRepeated
tgbl-flight18,14367,169,5701,38596.482.04×1012.04 \times10^{1}NoTransportRepeated

Table 6. Statistics of the 16 datasets used in our experiments. Regime indicates whether a dataset is unseen-edge-dominant (Unseen) or repeated-edge-dominant (Repeated).

Baseline Details

We compare MambaTG with established temporal graph models, recent Mamba-based architectures, a sequential recommendation method, and a candidate-aware future link predictor. Their main designs are summarized below:

EdgeBank. EdgeBank (Poursafaei et al. [14]) is a non-parametric baseline that stores previously observed edges and scores candidate links according to whether they have appeared in the interaction history. It captures edge recurrence without learning node representations or model parameters. Given its explicit focus on edge recurrence, we report EdgeBank only on repeated-edge-dominant datasets.

JODIE. JODIE (Kumar et al. [10]) maintains dynamic source and destination embeddings using two coupled recurrent neural networks. After each interaction, it jointly updates the embeddings of both endpoints and projects the source embedding forward to the query time for future interaction prediction.

DyRep. DyRep [19] models communication and association events as two interacting temporal processes. It updates persistent node representations using temporally attentive neighborhood information and parameterizes event occurrence through a temporal point process.

TGAT. TGAT (Xu et al., 2020) computes time-dependent node representations by applying self-attention over sampled temporal neighborhoods. It uses a functional time encoding to represent the elapsed time of historical interactions and supports inductive inference without maintaining persistent node memories.

TGN. TGN [16] maintains a persistent memory for each node. Incoming interactions generate messages that are aggregated and used to update the endpoint memories, after which a graph-based embedding module combines the memories with temporal-neighborhood information for prediction.

CAWN. CAWN [21] samples causal temporal walks from the two endpoints of a query edge. It anonymizes node identities through walk-based occurrence patterns and encodes the resulting walks to capture temporal motifs and structural relationships relevant to the queried pair.

GraphMixer. GraphMixer [2] uses an MLP-Mixer-based link encoder to summarize recent temporal interactions, a mean-pooling node encoder to aggregate node features, and an MLP classifier for link prediction. It provides a memory-free alternative to recurrent and attention-based temporal graph models.

DyGFormer. DyGFormer (Yu et al., 2023) extracts the first-hop interaction histories of both endpoints and uses neighbor co-occurrence encoding to represent correlations between them. The histories are divided into patches and processed by a Transformer to capture long-range temporal dependencies efficiently.

FreeDyG. FreeDyG [18] is a frequency-enhanced continuous-time dynamic graph model for link prediction. It introduces node interaction frequency encoding to explicitly capture the proportion of common neighbors and the interaction frequency of each node pair. By modeling interaction patterns in the frequency domain, FreeDyG aims to capture periodic behavior and temporal shifts in node interactions.

DyGMamba. DyGMamba [4] employs two state-space components. A node-level SSM encodes historical node interactions, while a time-level SSM captures temporal patterns and dynamically selects relevant information from the extended interaction history.

DyG-Mamba. DyG-Mamba [11] formulates dynamic graph learning using a continuous state-space architecture inspired by Mamba. It uses irregular time intervals as control signals for the state transitions, allowing the model to adjust how historical information is retained or forgotten.

SGNN-HN. SGNN-HN [13] was originally proposed for session-based recommendation. It represents an ordered interaction sequence as a star graph, allowing the star node to exchange information with all items in the sequence. A highway network combines item representations before and after graph propagation, and an attention mechanism aggregates them into a sequence representation for candidate prediction.

SASRec. SASRec [8] is a self-attention-based sequential recommendation model that encodes a user’s ordered item-interaction history to predict the next item, capturing dependencies among past interactions.

Mamba4Rec. Mamba4Rec (Liu et al., 2024) is a Mamba-based sequential recommendation model that encodes a user’s ordered item-interaction history for next-item prediction through selective state-space updates.

CRAFT. CRAFT (Yi et al., 2025a) represents nodes using trainable identifier embeddings and applies cross-attention from each candidate destination to the source node’s recent interactions. It therefore performs direct candidate-to-history matching without maintaining persistent node memories or aggregating the candidate’s temporal neighborhood. Following its original design, the repetition-enhanced CRAFT-R variant additionally supplies historical repetition frequency to the predictor on repeated-edge-dominant datasets.

Evaluation and Implementation Details

Following TGB-Seq (Yi et al., 2025b) and DyGLib (Yu et al., 2023), we use the Adam optimizer with a learning rate of 10−410^{-4} and a batch size of 200, which is increased to 400 for large datasets. Models are trained for up to 100 epochs with early stopping using a patience of 20 epochs. We impose a computational budget of 1.5 hours per epoch and 32 GB of GPU memory; exceeding these limits is denoted as out of time (OOT) and out of memory (OOM), respectively. We use official negative samples whenever available. TGB [7] provides either 20 or 100 negative destinations per positive edge, depending on the dataset, while TGB-Seq provides 100 randomly sampled negative destinations. For datasets without official negative samples, we follow TGB-Seq and randomly sample 100 negative destinations per positive edge. For small datasets, we additionally follow CRAFT (Yi et al., 2025a) and perform collision checks to exclude positive edges from the sampled negatives. To ensure fair comparison, we use published baseline results when they follow the same evaluation protocol and closely matched training settings; otherwise, we reproduce the methods using our unified pipeline.

Hyperparameter Settings

Baseline configurations. For each baseline we reproduce, we use the best configuration reported for the corresponding baseline–dataset pair in the original paper or benchmark study, including TGB-Seq (Yi et al., 2025b), CRAFT (Yi et al., 2025a), or DyGLib (Yu et al., 2023). When no dataset-specific configuration is reported, we use the default configuration recommended by the baseline’s official implementation.

MambaTG configurations. We select MambaTG hyperparameters according to validation MRR. Specifically, we tune the maximum history length Lmax⁡L_{\max}, number of CAME layers RR, hidden-layer dropout rate php_h, and node-embedding dropout rate pep_e using the search space in Table 7. Across all datasets, we fix the Mamba state dimension dstate=32d_{\mathrm{state}} = 32, the expansion factor to 2, and the causal-convolution width to 4. Table 8 reports the selected configurations, where ded_e denotes the node-embedding dimension and BB the training batch size. Following Yi et al. (2025a), we adopt the same dataset-specific settings for the node-embedding dimension ded_e and training batch size BB to ensure a fair comparison.

HyperparameterSearch space
Maximum history length, Lmax⁡L_{\max}{30,60,90,120,250}\{30, 60, 90, 120, 250\}
Number of CAME layers, RR{1,2}\{1, 2\}
Hidden-layer dropout, php_{\mathrm{h}}{0.1,0.2}\{0.1, 0.2\}
Node-embedding dropout, pep_{\mathrm{e}}{0.1,0.2}\{0.1, 0.2\}

Table 7. Hyperparameter search space for MambaTG.

DatasetLmax⁡L_{\max}RRphp_{\mathrm{h}}pep_{\mathrm{e}}ded_{\mathrm{e}}BB
UCI3010.10.164200
Wikipedia9020.20.264200
Reddit12010.10.164200
MOOC3020.10.164200
Flights25010.10.164200
LastFM25020.10.164200
GoogleLocal25020.10.2128200
Flickr9010.10.1128400
YouTube12020.10.1128400
Taobao6020.10.1128400
Yelp6020.10.1128400
ML-20M6010.10.1128400
WikiLink25010.10.1128400
tgbl-comment3010.10.1128200
tgbl-coin25010.10.1128200
tgbl-flight9010.10.1128200

Table 8. Selected MambaTG hyperparameters for each dataset.

Method Details

Mamba Block and Feed-Forward Network

Mamba block. Each Mamba block takes an input sequence X∈Rm×d\mathbf{X} \in\mathbb{R}^{m \times d}. Following Gu & Dao [6], it applies an input projection and a causal one-dimensional convolution, processes the resulting sequence with a selective SSM, and gates the SSM output:

U=SiLU⁡(Conv1D⁡(Linear⁡in(X))),Y=SSM⁡Aˉ,Bˉ,C(U),\mathbf{U} = \operatorname{SiLU}(\operatorname{Conv1D}(\operatorname{Linear}_{\mathrm{in}}(\mathbf{X}))), \qquad\mathbf{Y} = \operatorname{SSM}_{\bar{A},\bar{B},C}(\mathbf{U}),
MambaBlock⁡(X)=Linear⁡out(Y⊙SiLU⁡(Linear⁡gate(X))).(8)\operatorname{MambaBlock}(\mathbf{X}) = \operatorname{Linear}_{\mathrm{out}}(\mathbf{Y} \odot\operatorname{SiLU}(\operatorname{Linear}_{\mathrm{gate}}(\mathbf{X}))). \tag*{(8)}

The selective SSM processes U\mathbf{U} recurrently. At position tt, it maps ut\mathbf{u}_t to yt\mathbf{y}_t through the hidden state ht\mathbf{h}_t:

ht=Aˉtht−1+Bˉtut,yt=Ctht.(9)\mathbf{h}_t = \bar{A}_t\mathbf{h}_{t-1} + \bar{B}_t\mathbf{u}_t,\qquad\mathbf{y}_t = C_t\mathbf{h}_t. \tag*{(9)}

Here, Aˉt\bar{A}_t controls how the preceding state is retained, Bˉt\bar{B}_t determines how the current input updates the state, and CtC_t maps the hidden state to the output. Mamba derives Bˉt\bar{B}_t, CtC_t, and the discretization step Δt\Delta_t from the current input:

Bˉt=utWB,Ct=utWC,Δt=softplus⁡(Broadcast⁡dinner(utWΔ)+bΔ).(10)\bar{B}_t = \mathbf{u}_t W_B,\qquad C_t = \mathbf{u}_t W_C,\qquad\Delta_t = \operatorname{softplus}(\operatorname{Broadcast}_{d_{\mathrm{inner}}}(\mathbf{u}_t W_{\Delta}) + b_{\Delta}). \tag*{(10)}

Under zero-order-hold discretization, the shared continuous state-transition parameter A\mathbf{A} and input-dependent parameter Bt\mathbf{B}_t are converted into their discrete forms:

Aˉt=exp⁡(ΔtA),Bˉt=(ΔtA)−1[exp⁡(ΔtA)−I]ΔtBt.(11)\bar{A}_t = \exp(\Delta_t\mathbf{A}),\qquad\bar{B}_t = (\Delta_t\mathbf{A})^{-1}[\exp(\Delta_t\mathbf{A})-\mathbf{I}]\Delta_t\mathbf{B}_t. \tag*{(11)}

Feed-forward network. Each Mamba block is followed by a position-wise FFN:

FFN⁡(X)=GELU⁡(XW1+b1)W2+b2,(12)\operatorname{FFN}(\mathbf{X}) = \operatorname{GELU}(\mathbf{X}W_1 + b_1)W_2 + b_2, \tag*{(12)}

where W1∈Rd×4dW_1 \in\mathbb{R}^{d \times4d} and W2∈R4d×dW_2 \in\mathbb{R}^{4d \times d}.

CAME implementation.

At a given query time, CAME encodes each source history once and retains its layer-wise terminal recurrent caches KH(r)K_H^{(r)} for candidate continuation during both training and inference. Each candidate then continues independently from the same terminal history caches, so candidates share the encoded history without affecting one another.

For training, however, the terminal SSM state returned by the standard mamba-ssm selective-scan interface does not support gradient propagation. To allow the BPR objective to propagate gradients through candidate continuation to the history encoder, we extend each history scan from length Lmax⁡L_{\max} to Lmax⁡+dstateL_{\max}+d_{\mathrm{state}}, and append dstated_{\mathrm{state}} auxiliary positions to expose the terminal SSM state through the scan outputs. For each auxiliary position t=Lmax⁡+jt=L_{\max}+j, we set ut=0\mathbf{u}_t=\mathbf{0}, Bt=0\mathbf{B}_t=\mathbf{0}, and Δ~t=Δoff1\widetilde{\Delta}_t=\Delta_{\mathrm{off}}\mathbf{1}, where Δoff\Delta_{\mathrm{off}} is chosen such that Δ~t+bΔ\widetilde{\Delta}_t+b_{\Delta} is componentwise sufficiently negative. Thus, Δt=softplus⁡(Δ~t+bΔ)≈0\Delta_t=\operatorname{softplus}(\widetilde{\Delta}_t+b_{\Delta})\approx\mathbf{0}, giving A‾t=exp⁡(ΔtA)≈I\overline{\mathbf{A}}_t=\exp(\Delta_t\mathbf{A})\approx\mathbf{I} and B‾tut=0\overline{\mathbf{B}}_t\mathbf{u}_t=\mathbf{0}, and hence hLmax⁡+j≈hLmax⁡\mathbf{h}_{L_{\max}+j}\approx\mathbf{h}_{L_{\max}}. Although the softplus parameterization keeps Δt>0\Delta_t>0, the sufficiently negative Δoff\Delta_{\mathrm{off}} makes the resulting state decay numerically negligible. We then read out the terminal state from the auxiliary outputs by setting CLmax⁡+j=ejT\mathbf{C}_{L_{\max}+j}=\mathbf{e}_j^{\mathsf{T}} at auxiliary position t=Lmax⁡+jt=L_{\max}+j, where ej∈Rdstate\mathbf{e}_j\in\mathbb{R}^{d_{\mathrm{state}}} is the jj-th standard basis vector. Since uLmax⁡+j=0\mathbf{u}_{L_{\max}+j}=\mathbf{0} and hLmax⁡+j≈hLmax⁡\mathbf{h}_{L_{\max}+j}\approx\mathbf{h}_{L_{\max}}:

yLmax⁡+j=CLmax⁡+jhLmax⁡+j≈ejThLmax⁡(13)\mathbf{y}_{L_{\max}+j}=\mathbf{C}_{L_{\max}+j}\mathbf{h}_{L_{\max}+j}\approx\mathbf{e}_j^{\mathsf{T}}\mathbf{h}_{L_{\max}} \tag*{(13)}

The dstated_{\mathrm{state}} auxiliary outputs therefore jointly recover the terminal SSM state through the standard selective-scan interface, without modifying its CUDA kernel. The SiLU gate is applied only to the original history outputs y1:Lmax⁡\mathbf{y}_{1:L_{\max}}, while the auxiliary outputs are used directly for state readout.

For batched histories with different true lengths, each history is right-padded to Lmax⁡L_{\max}. At padded positions, we set ut=0\mathbf{u}_t=\mathbf{0}, Bt=0\mathbf{B}_t=\mathbf{0}, and Δ~t=Δoff1\widetilde{\Delta}_t=\Delta_{\mathrm{off}}\mathbf{1}, following the approximate-identity construction above. Consequently, the scan can operate on the common length Lmax⁡L_{\max} without introducing state decay after the last valid interaction. The terminal causal-convolution state is gathered from the last valid positions of each history rather than from the padded positions.

Additional Details and Results for Signal Ablations

We provide the experimental settings for ShuffledTrain, ShuffledInference, ShuffledBoth, and LateFusion, which examine historical-sequence evolution and candidate–history compatibility. Unless otherwise stated, all experiments follow the same data splits, historical sampling strategy, negative samples, model configuration, optimization settings, and evaluation protocol as MambaTG.

ShuffledTrain

ShuffledTrain examines how disrupting chronological order during training affects predictive performance. We randomly permute the source node’s historical interactions for every training query. Each permutation is generated once before training and remains fixed across epochs, preventing repeated shuffling from acting as stochastic data augmentation. All attributes associated with an interaction, including its timestamp, are permuted together, while the candidate remains the final input token. The model is trained from scratch on these shuffled histories and evaluated using the original chronologically ordered test histories. This variant probes the role of learning from ordered interactions in capturing historical-sequence evolution.

ShuffledInference

ShuffledInference examines whether the trained model relies on chronological ordering when making predictions. We train MambaTG normally and randomly permute the source histories only during test-time inference, without retraining or modifying its parameters. As in ShuffledTrain, all attributes associated with each interaction are permuted together, and the candidate remains the final token. A performance reduction relative to standard chronological inference indicates that the model’s predictions are sensitive to historical order.

ShuffledBoth

ShuffledBoth examines the benefit of chronological ordering under matched training and evaluation ordering conditions. Since ShuffledTrain and ShuffledInference use different ordering conditions during training and evaluation, their performance changes may also reflect sensitivity to this mismatch. To address this, ShuffledBoth uses shuffled histories during both training and evaluation.

The model is trained from scratch following the ShuffledTrain procedure and evaluated on shuffled test histories. This comparison tests whether the chronological order of a source node’s interaction history provides predictive information for future link prediction beyond historical-neighbor identities.

LateFusion

LateFusion examines whether candidate–history compatibility is better captured by incorporating the candidate into the state transition rather than combining independently encoded representations at the prediction stage. In MambaTG, the complete history encoder processes the historical sequence Hu(t)H_u(t) and retains the layer-wise history caches. The candidate then continues through all RR CAME layers using these caches, following (6):

(hH,KH)=HistoryEncoder⁡(Hu(t)),hc=CandidateContinuation⁡(zH,cCFR;KH),y^u,c=MLP⁡(hc).(14)(\mathbf{h}_H, \mathcal{K}_H) = \operatorname{HistoryEncoder}(H_u(t)), \\ \mathbf{h}_c = \operatorname{CandidateContinuation}(\mathbf{z}^{\mathrm{CFR}}_{H,c}; \mathcal{K}_H), \\ \hat{y}_{u,c} = \operatorname{MLP}(\mathbf{h}_c). \tag*{(14)}

Here, hH\mathbf{h}_H denotes the final history representation, KH\mathcal{K}_H contains the recurrent and convolutional states retained at each layer, and zH,cCFR\mathbf{z}^{\mathrm{CFR}}_{H,c} denotes the refined candidate representation.

LateFusion removes this candidate continuation while keeping the complete chronological history encoder unchanged. Instead, it independently refines the candidate with a residual MLP and combines it with the history representation only at the prediction stage:

hH=HistoryEncoder⁡(Hu(t)),z~H,cCFR=ResMLP⁡(zH,cCFR),y^u,c=MLP⁡([hH∥z~H,cCFR]).(15)\mathbf{h}_H = \operatorname{HistoryEncoder}(H_u(t)), \\ \tilde{\mathbf{z}}^{\mathrm{CFR}}_{H,c} = \operatorname{ResMLP}(\mathbf{z}^{\mathrm{CFR}}_{H,c}), \\ \hat{y}_{u,c} = \operatorname{MLP}([\mathbf{h}_H \parallel\tilde{\mathbf{z}}^{\mathrm{CFR}}_{H,c}]). \tag*{(15)}

For LateFusion, only the history representation is used at the prediction stage, and the history caches are not used for candidate processing. The residual MLP is sized to approximately match the parameter count of one CAME layer. MambaTG reuses its history-encoder parameters for candidate continuation, while LateFusion adds a separate residual MLP and uses a wider prediction head. As a result, LateFusion has more total trainable parameters. Thus, the comparison evaluates candidate-conditioned continuation against late fusion with a larger parameter budget, ensuring that any advantage of MambaTG cannot be attributed simply to a higher total parameter count. LateFusion is trained from scratch using the same training and evaluation settings as MambaTG. The explicit features used by the MambaTG link classifier are retained but omitted from both equations for clarity.

Per-Dataset Results

Figure 5 reports the per-dataset results for all four signal ablations.

Figure 5. Per-dataset signal-ablation results on the repeated-edge-dominant datasets (MOOC and LastFM) and the unseen-edge-dominant datasets (GoogleLocal and YouTube). Results are reported as MRR (%), averaged over three random seeds.

Ablation Study Details

We conduct an ablation study on four datasets to evaluate the contributions of MambaTG’s key components. Specifically, we consider five variants: (1) w/o HSR, which removes the Historical Spectral Refinement (HSR) applied to the source node’s historical interaction sequence; (2) w/o CFR, which removes Candidate Feature Refinement (CFR), preventing the candidate representations from being adaptively aligned with the refined historical representation space; (3) w/o query-rel, which removes the query-relative time encoding from the input representations; (4) w/o recency, which removes the candidate activity recency feature concatenated at the prediction layer; and (5) w/o repeat, which removes the candidate repetition-frequency feature from the predictor layer. The repetition-frequency feature is evaluated only on repeated-edge datasets. Figure 6 presents the complete per-dataset results.

Figure 6. Per-dataset component-ablation results on the repeated-edge-dominant datasets (UCI and MOOC) and the unseen-edge-dominant datasets (GoogleLocal and Flickr). MambaTG-R denotes MambaTG augmented with historical repetition frequency. Each ablation variant removes one component from the corresponding complete model. Results are reported as MRR (%), averaged over three random seeds.

Effectiveness and Transferability of Dual-Branch Representation Refinement (DRR)

DRR improves the inputs to candidate-aware temporal modeling through two complementary branches: HSR refines historical patterns at different temporal scales, while CFR recalibrates candidate features to promote compatibility with the refined history. To examine whether its benefits extend beyond MambaTG, we incorporate DRR into CRAFT and compare the resulting CRAFT-DRR with the original CRAFT. Specifically, we construct CRAFT-DRR by applying HSR to the history embeddings after positional encoding and CFR to the candidate embeddings, with the resulting representations passed to CRAFT’s cross-attention module. We also compare MambaTG with MambaTG without DRR to isolate the contribution of DRR within MambaTG. We conduct these comparisons on UCI and GoogleLocal, representing repeated- and unseen-edge-dominant settings, respectively. Within each framework, the variants with and without DRR use the same model configuration and training settings, differing only in the inclusion of DRR. On UCI, all variants additionally use historical repetition frequency and are denoted by the suffix “-R.” The CRAFT results in this analysis are obtained from our own experiments and may therefore differ from the originally reported results presented in Table 2.

Results. Figure 7 shows that DRR improves both CRAFT and MambaTG on both datasets, indicating that its benefits are not specific to either architecture. Comparing the two frameworks without DRR, MambaTG consistently outperforms CRAFT, showing that its candidate-aware sequential modeling provides an advantage independently of DRR. This advantage is retained when both frameworks use DRR, with MambaTG still outperforming CRAFT-DRR on both datasets. Thus, the gains from MambaTG cannot be attributed solely to representation refinement. Instead, the results support complementary contributions from DRR and MambaTG’s joint modeling of historical-sequence evolution and candidate–history compatibility. The consistent improvement of CRAFT with DRR further suggests that the refined representations are independently useful for candidate–history compatibility, particularly when predicting unseen edges where the source and candidate have no previous direct interaction.

Figure 7. Impact of DRR on CRAFT and MambaTG on UCI (repeated-edge-dominant) and GoogleLocal (unseen-edge-dominant) datasets. Results are reported as MRR (%), averaged over three random seeds.

Effectiveness of Candidate-Aware Mamba Encoder (CAME)

CAME jointly models historical-sequence evolution and candidate–history compatibility by treating each candidate as a continuation of the source node’s interaction sequence. To assess the role of Mamba-based sequence modeling within CAME, we compare MambaTG with GRUTG. GRUTG replaces each Mamba block with a Gated Recurrent Unit (GRU) of the same hidden dimension while retaining all other model components, training settings, and the candidate-continuation procedure. We evaluate both models on UCI and GoogleLocal, representing repeated-edge-dominant and unseen-edge-dominant settings, respectively. On UCI, both models additionally use historical repetition frequency and are denoted as GRUTG-R and MambaTG-R.

Results. As shown in Figure 8, MambaTG consistently outperforms GRUTG on both datasets, indicating that Mamba provides a more effective sequential backbone for CAME. This advantage may stem from Mamba’s structured SSM state and selective recurrence, which capture different aspects of the interaction history over different timescales and selectively retain informative events. The larger gain on the unseen-edge-dominant GoogleLocal dataset further suggests that Mamba is particularly useful when direct source–candidate evidence is limited and prediction relies more heavily on patterns in the source history. Overall, these results support the use of Mamba as the sequential encoder for jointly modeling historical-sequence evolution and candidate–history compatibility in CAME.

Effect of CAME on the repeated-edge-dominant UCI dataset and the unseen-edge-dominant GoogleLocal dataset

Figure 8. Effect of CAME on the repeated-edge-dominant UCI dataset and the unseen-edge-dominant GoogleLocal dataset. MambaTG is compared with GRUTG. Results are reported as MRR (%), averaged over three random seeds.

Comparison with Recommendation Models

MambaTG targets future link prediction on temporal graphs, a general task arising in diverse applications such as recommendation, social networks, communication systems, and transportation networks. It supports both bipartite and non-bipartite graphs and covers both repeated and unseen future edges. Recommendation can be viewed as a specific application of this task, where temporal interactions typically occur between users and items in a bipartite graph.

To further examine the effectiveness of MambaTG, we compare it with two representative sequential recommendation models: the Transformer-based SASRec [8] and the

Mamba-based Mamba4Rec [12]. The comparison covers MOOC and GoogleLocal, representing repeated-edge-dominant and unseen-edge-dominant settings, respectively. As shown in Figure 9, MambaTG or MambaTG-R consistently outperforms both recommendation models across both datasets. These results suggest that models designed specifically for sequential user–item recommendation may not fully capture the broader characteristics of future link prediction, particularly the distinction between repeated and unseen edges.

Figure 9. Comparison with sequential recommendation models on MOOC (repeated-edge-dominant) and GoogleLocal (unseen-edge-dominant) datasets. Results are reported as MRR (%), averaged over three random seeds.

Time Complexity Analysis

We analyze a batch of BB source nodes, each evaluated against qq candidate destinations. Let ℓ\ell denote the number of historical interactions per node, dd the feature dimension, and dˉ\bar{d} the average node degree. We report only dominant terms and treat architectural hyperparameters, including the number of layers and attention heads, as well as the Mamba expansion factors and state dimensions, as constants. For TGAT, however, we explicitly account for its two-layer neighborhood expansion, which introduces two-hop histories and changes the dependence on ℓ\ell.

Historical-neighbor extraction. We use neighbor extraction to refer to the temporal-index lookup operations required to locate the relevant histories in node adjacency lists. Following the common implementation in DyGLib (Yu et al., 2023), retrieving the most recent historical interactions before the query time requires O(log⁡dˉ)O(\log\bar{d}) per node. TGN [16], GraphMixer [2], DyGFormer, DyG-Mamba [11], and DyGMamba [4] retrieve histories. tories for both the source and all candidate destinations, resulting in O(B(1+q)log⁡dˉ)O(B(1+q)\log\bar{d}). TGAT (Xu et al., 2020) additionally performs temporal-index lookups for up to ℓ\ell first-hop neighbors in its two-layer architecture. Thus, it performs O(B(1+q)(1+ℓ))O(B(1+q)(1+\ell)) lookup operations, each costing O(log⁡dˉ)O(\log\bar{d}), resulting in a neighbor-extraction cost of O(B(1+q)(1+ℓ)log⁡dˉ)O(B(1+q)(1+\ell)\log\bar{d}). In contrast, CRAFT (Yi et al., 2025a) and MambaTG retrieve only the source history, reducing the cost to O(Blog⁡dˉ)O(B\log\bar{d}).

Edge-likelihood computation. TGN and GraphMixer process the ℓ\ell historical interactions of both the source and every candidate destination, resulting in O(B(1+q)ℓd2)O(B(1+q)\ell d^2). TGAT aggregates two-hop histories with two graph-attention layers, where ℓ\ell is the sampling size at each hop, requiring O(B(1+q)ℓ2d2)O(B(1+q)\ell^2d^2). DyGFormer applies feature projection and self-attention to each endpoint, with costs of O(ℓd2)O(\ell d^2) and O(ℓ2d)O(\ell^2d), respectively. Its total complexity is therefore O(B(1+q)(ℓd2+ℓ2d))O(B(1+q)(\ell d^2+\ell^2d)). DyG-Mamba and DyGMamba process the full history for every source–candidate pair using state-space models, resulting in O(Bqℓd2)O(Bq\ell d^2). CRAFT projects the source history and candidates in O(B(ℓ+q)d2)O(B(\ell+q)d^2), followed by candidate-to-history attention with complexity O(Bqℓd)O(Bq\ell d). Its total cost is thus O(B(ℓ+q)d2+Bqℓd)O(B(\ell+q)d^2+Bq\ell d). MambaTG incurs O(Bℓdlog⁡ℓ)O(B\ell d\log\ell) time for DRR, whose dominant cost arises from frequency-domain refinement of each source history. It then encodes each history once in O(Bℓd2)O(B\ell d^2) and evaluates all candidates using the cached states in O(Bqd2)O(Bqd^2). Therefore, its total edge-likelihood computation is O(Bℓdlog⁡ℓ+B(ℓ+q)d2)O(B\ell d\log\ell+B(\ell+q)d^2).

Additional Experimental Results

long sequence efficiency

We evaluate the scalability of MambaTG as the source-node history length increases on LastFM, measuring per-epoch training time, inference time, and peak GPU memory usage. Training time measures the wall-clock time of one training epoch, excluding validation and data loading before the epoch. Inference time measures the wall-clock time of the 100-negative test pass, including the operations required for each method to produce predictions. Peak GPU memory is measured as the maximum allocated GPU memory over the full run, including training and evaluation.

Results are shown in Figure 10. (1) Training efficiency. MambaTG scales efficiently with increasing history length and remains among the faster methods. At ℓ=750\ell=750, it achieves up to 12.91×12.91\times speedup over DyG-Mamba while remaining competitive with CRAFT and JODIE. (2) Inference efficiency. Although inference time scales near-linearly with ℓ\ell in theory, it remains nearly constant empirically because candidate evaluation dominates wall-clock time. MambaTG caches historical states and reuses them across candidates, avoiding repeated history encoding. At ℓ=1000\ell=1000, it achieves up to 104.54×104.54\times speedup over the compared baselines. (3) Memory efficiency. MambaTG exhibits approximately linear memory growth with history length and remains substantially more memory-efficient than several baselines. Although JODIE becomes more memory-efficient for longer histories due to its fixed-size node states, MambaTG maintains a competitive memory footprint across the evaluated sequence lengths. Overall, these results demonstrate that MambaTG can effectively scale to long source histories while maintaining low computational overhead, making it well suited to large-scale recommendation scenarios where a user’s extensive interaction history must be evaluated against many candidate items.

Figure 10. Computational efficiency on LastFM Dataset as the maximum source-history length ℓ\ell increases. Training time per epoch, inference time, and peak GPU memory usage.

Performance–Efficiency Trade-off

We additionally evaluate the performance–efficiency trade-off on LastFM and UCI. Figure 11 plots test MRR against per-epoch training time, with bubble size representing parameter footprint.

Figure 11. Performance–efficiency trade-off on (a) LastFM and (b) UCI. Test MRR is plotted against per-epoch training time, with bubble size representing parameter footprint.

Additional results on other datasets

We further evaluate MambaTG on three datasets from the Temporal Graph Benchmark (TGB) (Huang et al., [7]): tgbl-comment, tgbl-coin, and tgbl-flight. We compare against DyGFormer (Yu et al., 2023), SGNN-HN (Pan et al., [13]), and CRAFT (Yi et al., 2025a). The DyGFormer results are taken from Yu (2023), whereas the SGNN-HN and CRAFT results are obtained from our experiments. The two prior Mamba-based baselines, DyGMamba and DyG-Mamba, are not reported because they exceed the available computational budget on all three datasets. As shown in Table 9, MambaTG achieves superior performance across all three datasets. These results further demonstrate the effectiveness and generalization of MambaTG across diverse temporal graph datasets.

Unseen-edge-dominantRepeated-edge-dominant
Modeltgbl-commentModeltgbl-cointgbl-flight
DyGFormer67.03 ±0.14\pm0.14DyGFormer75.17 ±0.38\pm0.38–
SGNN-HN40.38 ±0.18\pm0.18SGNN-HN66.25 ±0.41\pm0.4181.86 ±0.07\pm0.07
CRAFT75.69 ±0.75\pm0.75CRAFT-R74.43 ±0.30\pm0.3086.42 ±0.05\pm0.05
MambaTG75.93 ±0.21\pm0.21MambaTG-R75.74 ±0.28\pm0.2886.53 ±0.08\pm0.08

Table 9. Future link prediction results on three additional TGB datasets. Results are reported as MRR (%), averaged over three random seeds. The best and second-best results in each column are highlighted. Missing entries indicate experiments that exceeded computational budget.

Discussion

Limitations and Future Work

Although this work focuses on future link prediction, we have not examined whether the two signals modeled by MambaTG generalize to other temporal-graph prediction tasks. Extending MambaTG to tasks such as temporal edge classification and temporal anomaly detection, while investigating the roles of historical-sequence evolution and candidate–history compatibility in these settings, is a promising direction for future work.

References

  1. [1]Unai Alvarez-Rodriguez, Federico Battiston, Guilherme Ferraz De Arruda, Yamir Moreno, Matjaž Perc, and Vito Latora. Evolutionary dynamics of higher-order interactions in social networks. Nature Human Behaviour, 5(5):586–595, January 2021. ISSN 2397-3374. doi: 10.1038/s41562-020-01024-1. URL https://www.nature.com/articles/s41562-020-01024-1.
  2. [2]Weilin Cong, Si Zhang, Jian Kang, Baichuan Yuan, Hao Wu, Xin Zhou, Hanghang Tong, and Mehrdad Mahdavi. Do We Really Need Complicated Model Architectures For Temporal Networks? 2023. URL https://openreview.net/forum?id=ayPPc0SyLv1.arxiv.org/abs/2302.11636
  3. [3]Nick Craswell. Mean Reciprocal Rank. In Ling Liu and M. Tamer Özsu (eds.), Encyclopedia of Database Systems, pp. 1703–1703. Springer US, Boston, MA, 2009. ISBN 978-0-387-35544-3 978-0-387-39940-9. doi: 10.1007/978-0-387-39940-9_488. URL http://link.springer.com/10.1007/978-0-387-39940-9_488.DOI
  4. [4]Zifeng Ding, Yifeng Li, Yuan He, Antonio Norelli, Jingcheng Wu, Volker Tresp, Michael M. Bronstein, and Yunpu Ma. DyGamba: Efficiently Modeling Long-Term Temporal Dependency on Continuous-Time Dynamic Graphs with State Space Models. Transactions on Machine Learning Research, February 2025. ISSN 2835-8856. URL https://openreview.net/forum?id=sq5AJvVuha.arxiv.org/abs/2408.04713
  5. [5]Aswathy Divakaran and Anuraj Mohan. Temporal Link Prediction: A Survey. New Generation Computing, 38(1):213–258, March 2020. ISSN 0288-3635, 1882-7055. doi: 10.1007/s00354-019-00065-z. URL https://link.springer.com/10.1007/s00354-019-00065-z.DOI
  6. [6]Albert Gu and Tri Dao. Mamba: Linear-Time Sequence Modeling with Selective State Spaces. 2024. URL https://openreview.net/forum?id=tEYskw1VY2.arxiv.org/abs/2312.00752
  7. [7]Shenyang Huang, Farimah Poursafaei, Jacob Danovitch, Matthias Fey, Weihua Hu, Emanuele Rossi, Jure Leskovec, Michael Bronstein, Guillaume Rabusseau, and Reihaneh Rabbany. Temporal Graph Benchmark for Machine Learning on Temporal Graphs. In Advances in Neural Information Processing Systems 36, pp. 2056–2073, New Orleans, Louisiana, USA, 2023. Neural Information Processing Systems Foundation, Inc. (NeurIPS). ISBN 978-1-7138-9911-2. doi: 10.52202/075280-0099. URL http://www.proceedings.com/075280-0099.html.DOI
  8. [8]Wang-Cheng Kang and Julian McAuley. Self-Attentive Sequential Recommendation. 2018 IEEE International Conference on Data Mining (ICDM), pp. 197–206, November 2018. doi: 10.1109/ICDM.2018.00035. URL https://ieeexplore.ieee.org/document/8594844/. Conference Name: 2018 IEEE International Conference on Data Mining (ICDM) ISBN: 9781538691595.DOI
  9. [9]Seyed Mehran Kazemi, Rishab Goel, Kshitij Jain, Ivan Kobzyev, Akshay Sethi, Peter Forsyth, and Pascal Poupart. Representation Learning for Dynamic Graphs: A Survey. Journal of Machine Learning Research, 21(70):1–73, 2020. ISSN 1533-7928. URL http://jmlr.org/papers/v21/19-447.html.
  10. [10]Srijian Kumar, Xikun Zhang, and Jure Leskovec. Predicting Dynamic Embedding Trajectory in Temporal Interaction Networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1269–1278, Anchorage AK USA, July 2019. ACM. ISBN 978-1-4503-6201-6. doi: 10.1145/3292500.3330895. URL https://dl.acm.org/doi/10.1145/3292500.3330895.DOI
  11. [11]Dongyuan Li, Shiyin Tan, Ying Zhang, Ming Jin, Shirui Pan, Manabu Okumura, and Renhe Jiang. DyG-Mamba: Continuous State Space Modeling on Dynamic Graphs. In Advances in Neural Information Processing Systems 38, pp. 143195–143224, San Diego, California, USA and Mexico City, Mexico, 2025. Neural Information Processing Systems Foundation, Inc. (NeurIPS). ISBN 979-8-3313-3827-5. doi: 10.52202/085713-4299. URL http://www.proceedings.com/085713-4299.html.DOI
  12. [12]Chengkai Liu, Jianghao Lin, Jianling Wang, Hanzhou Liu, and James Caverlee. Mamba4Rec: Towards Efficient Sequential Recommendation with Selective State Space Models, June 2024. URL http://arxiv.org/abs/2403.03900. arXiv:2403.03900 [cs.IR].
  13. [13]Zhiqiang Pan, Fei Cai, Wanyu Chen, Honghui Chen, and Maarten De Rijke. Star Graph Neural Networks for Session-based Recommendation. In Proceedings of the 29th ACM International Conference on Information & Knowledge Management, pp. 1195–1204, Virtual Event Ireland, October 2020. ACM. ISBN 978-1-4503-6859-9. doi: 10.1145/3340531.3412014. URL https://dl.acm.org/doi/10.1145/3340531.3412014.DOI
  14. [14]Farimah Poursafaei, Andy Huang, Kellin Pelrine, and Reihaneh Rabbany. Towards Better Evaluation for Dynamic Link Prediction. June 2022. URL https://openreview.net/forum?id=1GVpwr2Tfdg.arxiv.org/abs/2207.10128
  15. [15]Steffen Rendle, Christoph Freudenthaler, Zeno Gantner, and Lars Schmidt-Thieme. BPR: Bayesian personalized ranking from implicit feedback. In Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence, UAI ’09, pp. 452–461, Arlington, Virginia, USA, June 2009. AUAI Press. ISBN 978-0-9749039-5-8. URL https://dl.acm.org/doi/10.5555/1795114.1795167.
  16. [16]Emanuele Rossi, Ben Chamberlain, Fabrizio Frasca, Davide Eynard, Federico Monti, and Michael Bronstein. Temporal Graph Networks for Deep Learning on Dynamic Graphs, October 2020. URL http://arxiv.org/abs/2006.10637. arXiv:2006.10637 [cs.LG].
  17. [17]H. Sorensen, D. Jones, M. Heideman, and C. Burrus. Real-valued fast Fourier transform algorithms. IEEE Transactions on Acoustics, Speech, and Signal Processing, 35(6):849–863, June 1987. ISSN 0096-3518. doi: 10.1109/TASSP.1987.1165220. URL http://ieeexplore.ieee.org/document/1165220/.DOI
  18. [18]Yuxing Tian, Yiyan Qi, and Fan Guo. FreeDyG: Frequency Enhanced Continuous-Time Dynamic Graph Model for Link Prediction. 2024. URL https://openreview.net/forum?id=82Mc5iInM.
  19. [19]Rakshit Trivedi, Mehrdad Farajtabar, Prasenjeet Biswal, and Hongyuan Zha. DyRep: Learning Representations over Dynamic Graphs. 2019. URL https://openreview.net/forum?id=HyePrhR5KX.
  20. [20]Lu Wang, Xiaofu Chang, Shuang Li, Yunfei Chu, Hui Li, Wei Zhang, Xiaofeng He, Le Song, Jingren Zhou, and Hongxia Yang. TCL: Transformer-based Dynamic Graph Modelling via Contrastive Learning. ArXiv, May 2021a. URL https://www.semanticscholar.org/paper/TCL%3A-Transformer-based-Dynamic-Graph-Modelling-via-Wang-Chang/d37a8e9cea2f1e1b45b4912d243eee1b9dd5f756.arxiv.org/abs/2105.07944
  21. [21]Yanbang Wang, Yen-Yu Chang, Yunyue Liu, Jure Leskovec, and Pan Li. Inductive Representation Learning in Temporal Networks via Causal Anonymous Walks. 2021b. URL https://openreview.net/forum?id=KYPz4YsCPj.arxiv.org/abs/2101.05974
  22. [22]Yuxia Wu, Yuan Fang, and Lizi Liao. On the Feasibility of Simple Transformer for Dynamic Graph Modeling. In Proceedings of the ACM Web Conference 2024, pp. 870–880, Singapore Singapore, May 2024. ACM. ISBN 979-8-4007-0171-9. doi: 10.1145/3589334.3645622. URL https://dl.acm.org/doi/10.1145/3589334.3645622.DOI

Paper details

vlnc:W_md7hyz8y
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 10

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

generative AI tools

View statement
Looking for related papers…
Contents