arXiv:2610.27558cs.LGOct 2026

Manuscript Offprint

arXiv:2610.27558

AnchorRM: Parallel Intra-Batch State Reconstruction with Anchor-Based Residual Memory for Temporal Graph Neural Networks

Haroon Gharwi, Kai Shu, Yue Dai

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Memory-based temporal graph neural networks (TGN) rely on recurrent node memories to capture evolving interaction histories. However, temporal mini-batching introduces a trade-off between computational efficiency and temporal fidelity: when a node appears multiple times within the same batch, later interactions are evaluated using stale pre-batch memory because the intermediate memory updates have not yet been committed. This problem becomes more severe as temporal batch size increases. To overcome this challenge, We propose AnchorRM, an anchor-based residual memory mechanism that reconstructs event-specific intra-batch node states without executing sequential recurrent updates. AnchorRM treats the last committed node memory at the beginning of each batch as a pre-batch fixed anchor and uses causally preceding same-batch interactions to infer the missing state evolution relative to that anchor. The learned residual then calibrates the anchor to reconstruct an event-specific node memory for each interaction. Because each event-specific residual is predicted directly from the fixed anchor and its causal history, reconstructed states do not depend on previously reconstructed states and can therefore be computed in parallel within the batch while preserving temporal causality. Experiments across four temporal graph datasets and three memory-based backbones demonstrate that AnchorRM achieves an average 6.16×6.16\times training speedup (up to 10.05×10.05\times) and 28.67×28.67\times batch scaling (up to 40×40\times). These results demonstrate that AnchorRM substantially improves the scalability and training efficiency of memory-based temporal graph learning while maintaining competitive predictive performance.

1 Introduction

Temporal graphs model systems in which interactions, relationships, and node states evolve over time, with applications ranging from social and communication networks to recommender systems and financial transactions [6]. Unlike static graph representations, temporal graph models must account for both the structure of interactions and their temporal ordering. A prominent class of temporal graph neural networks (TGN) therefore maintains evolving node representations that summarize interaction history [7, 10, 8]. In particular, memory-based architectures such as Temporal Graph Networks (TGN) associate each node with a persistent memory that is updated as new interactions are observed, providing an explicit mechanism for carrying historical information through the event stream [8].

The recurrent nature of node memory, however, creates a tension between temporal fidelity and efficient batch-parallel execution. Ideally, if a node u participates in a sequence of interactions e1,e2,…,eke_{1}, e_{2}, \ldots, e_{k}, the memory used at eke_{k} should reflect the effects of all causally preceding interactions involving u. Such sequential state propagation preserves the temporal dependency of the event stream, but it restricts parallel execution. Large temporal mini-batches are attractive for improving computational throughput, and scalable TGN systems have consequently developed increasingly optimized batching, sampling, memory-management, and distributed-training mechanisms [13, 14].

Batch-parallel processing introduces a particular difficulty for memory-based TGNs when the same node occurs multiple times within a batch. Consider a node u that participates in several interactions at different positions of the same temporal batch. When these interactions are processed in parallel, a later occurrence may be evaluated before the state changes induced by its earlier same-batch interactions have been incorporated into persistent memory. Consequently, multiple interactions can rely on the same pre-batch memory even though they occur at different points in the temporal sequence. This loss of intra-batch temporal dependency has been identified as temporal discontinuity and becomes increasingly consequential as temporal batch size grows [9]. Recent work further shows that intra-batch information loss and outdated memory states can substantially affect the accuracy of memory-based TGNs under batch-parallel training [3].

We formulate this issue as a problem of missing intra-batch state evolution. At the beginning of a temporal batch, the last committed memory of node u provides a reliable representation of its history up to the batch boundary. We refer to this state as the node's pre-batch anchor. For a later occurrence of u within the same batch, however, the memory required to represent the node at that event should additionally reflect its causally preceding same-batch interactions. The difference between this event-specific state and the available pre-batch anchor therefore corresponds to state evolution that has occurred in the temporal sequence but has not yet been materialized by the persistent recurrent memory.

Several recent approaches attempt to alleviate this tension between memory dependency and scalable execution. TGL and DistTGL improve the systems infrastructure for large-scale and distributed temporal graph training [13, 14]. PRES explicitly addresses temporal discontinuity through an iterative prediction-correction procedure together with memory-coherence learning [9]. RBT measures intra-batch information loss more finely and combines batch refinement with memory compensation [3], while Cascade uses dependency-aware information to adapt temporal batch boundaries and determine how many revisits can be tolerated before memory inconsistency becomes harmful [2]. These approaches motivate a complementary question: instead of primarily restricting, partitioning, or iteratively correcting intra-batch dependencies, can the missing state required at each interaction be reconstructed directly from the causal information already available within the batch?

To address this question, we propose AnchorRM, an anchor-based residual memory mechanism for event-specific intra-batch state reconstruction. AnchorRM treats the last committed node memory at the beginning of each batch as a pre-batch anchor. For an interaction at position k, it uses the node's causally preceding same-batch interactions to infer the missing change in memory since that anchor. This missing evolution is represented by a learned residual memory, which calibrates the pre-batch anchor to reconstruct the node state required at the current interaction. Thus, rather than predicting an event-specific state from scratch, AnchorRM estimates only the state change that has not yet been captured by persistent memory.

A key property of AnchorRM is that these event-specific states are not reconstructed recursively. For event k, the residual is inferred directly from the fixed pre-batch anchor and interactions occurring before k in the batch; it does not depend on the reconstructed state of event k - 1. Consequently, once causal same-batch histories have been identified, the residual corrections for different event positions can be evaluated in parallel. AnchorRM therefore preserves the causal information boundary of each interaction while removing the recurrent computational dependency among the reconstructed intra-batch states.

The resulting architecture operates at two complementary temporal scales. Persistent node memory captures committed evolution across temporal batches, whereas residual memory reconstructs the event-specific evolution that is temporarily missing inside the current batch. The reconstructed endpoint states are used for interaction prediction and are also incorporated into the messages that subsequently update persistent memory. AnchorRM therefore augments, rather than replaces, the underlying recurrent TGN memory mechanism.

Experiments across four temporal graph datasets and three memory-based backbones demonstrate the effectiveness of AnchorRM in large-batch temporal graph learning. under a relative validation-AP tolerance of ϵ=0.01\epsilon = 0.01, AnchorRM achieves an average 28.67×28.67 \times temporal batch scaling (up to 40×40 \times) and 6.16×6.16 \times training speedup (up to 10.05×10.05 \times) relative to the original backbones. It maintains competitive predictive performance, achieving an average test AP of 87.43%, compared with 86.84% for the original backbones and 86.97% for PRES. These findings suggest that causal intra-batch state reconstruction enables more aggressive temporal batching while mitigating predictive degradation.

Our main contributions are as follows:

  • We formulate the stale-memory problem in batch-parallel memory-based TGNs as an event-specific missing-state problem, where the unavailable intra-batch evolution is represented relative to the last committed pre-batch memory.

• We introduce AnchorRM, an anchor-based residual memory mechanism that uses causally preceding same-batch interactions to infer the missing state change and reconstruct the node memory required at each interaction.

  • We develop a causal parallel formulation in which each event-specific residual is inferred directly from a shared pre-batch anchor and its corresponding causal history, eliminating recurrent dependencies among reconstructed states within a temporal batch.

  • We conduct extensive experiments across four datasets and three memory-based backbones, demonstrating substantial improvements in accuracy-tolerant batch scaling and training efficiency. Ablation studies further investigate the effects of causal history capacity, residual reconstruction, and model dimensions.