arXiv:2610.02795cs.LGOct 2026

Manuscript Offprint

arXiv:2610.02795

Efficient Memory Crystallization for Graph Learning under Non-Stationary Distribution Shifts

Yue Hou, Ruomei Liu, Yingke Su, Junran Wu, Ke Xu

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

Abstract

Deep graph learning models deployed in real-world systems often need to cope with non-stationary environments, where the underlying graph distribution drifts continually over time. Prevailing solutions rely on training auxiliary generative modules to synthesize memory graphs for cross-domain adaptation, which incurs substantial computational overhead and scales poorly under prolonged distribution shifts. We argue that a more economical path exists: rather than generating memory, one can crystallize it. To this end, we propose Efficient Memory Crystallization (EMC), a training-free test-time framework that distills each incoming graph domain into a compact, semantically faithful memory through a closed-form solution to a memory-oriented distribution-matching objective, thereby eliminating redundant domain information under continual covariate shifts. To preserve both generalizability and adaptability as the model traverses a long sequence of target domains, EMC further models inter-domain dependencies through state-evolving memories and admits a theoretically grounded, tighter generalization error bound than direct adaptation. Extensive experiments demonstrate the superior performance of EMC over state-of-the-art baselines on graphs under non-stationary distribution shifts, while reducing average runtime by 87.4% and GPU memory consumption by 92.4% relative to the recent competitor, making continual graph adaptation practical at scale.

1 Introduction

Graph-structured data is ubiquitous in real-world applications such as social network analysis, recommender systems, and epidemiological modeling. To effectively learn from such data, Graph Neural Networks (GNNs) [12, 37] have emerged as powerful models that integrate node features and structural information through neighborhood aggregation. While GNNs have demonstrated impressive performance under the assumption that training and testing data follow the same distribution, this assumption is often violated in practice due to distribution shift, that is, a mismatch between the training (source) and testing (target) distributions which poses a major challenge to the generalization ability of deep models. To bridge this gap, Graph Domain Adaptation (GDA) methods aim to transfer knowledge from the source domain to the target domain by mitigating the distributional discrepancy.

In real-world scenarios, the source data is often inaccessible during test time due to privacy or business constraints, making the adaptation problem more challenging. Moreover, the GNN model frequently operates in non-stationary environments, where the target graph distribution drifts continually over time. Transferring knowledge from the source domain to entirely unseen target domains can introduce inductive bias, which exacerbates catastrophic forgetting and degrades the model's generalization ability to future domains, especially when distribution shifts arrive in a continual stream rather than a

∗^{*}Corresponding author

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

single jump, as illustrated in Figure 1. This necessitates addressing the problem of graph learning under non-stationary distribution shifts at test time.

Recently, there has been a growing research trend focusing on single-step domain adaptation, typically employing techniques such as Maximum Mean Discrepancy [6] and adversarial learning [3, 25, 38]. However, these approaches inevitably fall short when the model is exposed to distribution shifts that arrive continually across time or domains. As graph data evolves, models encounter new domains that require ongoing adaptation, while simultaneously losing the ability to perform well on previously seen graphs, which leads to catastrophic forgetting. To mitigate catastrophic forgetting, Continual Learning [30, 31, 39–41] has emerged as a promising direction. These methods typically adopt replay mechanisms, where the model periodically revisits selected or generated historical data to reinforce prior knowledge. Such strategies help balance training cost with long-term knowledge retention. However, most existing approaches rely on labeled data to guide mem-

Figure

Figure 1: A general paradigm of test-time adaptation under non-stationary distribution shifts. Compared with the first row, which directly adapts the model on the test data without modeling inter-domain relations or intra-domain redundancy, the second row illustrates our EMC, which crystallizes each domain into a compact memory and explicitly considers these factors to maintain both generalizability and adaptability, thereby ensuring efficiency and effectiveness.

ory selection and replay, making them ill-suited for the test-time setting where labels are unavailable. Although GCAL [24] attempts to improve cross-domain adaptation by training an auxiliary generative module to synthesize memory graphs, its dependence on a separately trained generator introduces substantial computational overhead and limits its practicality under prolonged drift. Furthermore, as shown in Figure 1, current methods under test-time settings with continual drift often ignore the inter-domain relationships and the redundancy within each domain that is irrelevant to the underlying semantic information. We summarize that a desirable framework for adapting graph models under non-stationary distribution shifts at test time should pursue three core objectives: ensuring the model's generalizability, maintaining its adaptability to novel domains, and mitigating forgetting throughout the continual adaptation process, all in a memory- and computation-efficient manner.

In this paper, we argue that a more economical path exists: rather than generating memory through a separately trained module, one can crystallize it directly from each incoming graph in closed form. We instantiate this idea as EMC (Efficient Memory Crystallization), a test-time framework for graph learning under non-stationary distribution shifts. Specifically, we introduce a memory- and computation-efficient

Figure

Figure 2: Runtime and GPU memory cost comparison between baseline GCAL and EMC.

procedure that crystallizes each incoming graph domain into a compact, semantically faithful memory through a closed-form solution to a memory-oriented distribution-matching objective, eliminating redundant domain information under continual covariate shifts. To preserve both generalizability and adaptability as the model traverses a long sequence of target domains, we further model inter-domain dependencies through state-evolving memories. We theoretically establish that the generalization error bounds with crystallized memories (from source to target domain) and with state-evolving memories (during continual adaptation on target domains) are both tighter than directly adapting the model on the target domain without such mechanisms, ensuring effectiveness. Extensive experiments on real-world datasets demonstrate the superiority of EMC over state-of-the-art (SOTA) baselines. A comparison of runtime and GPU memory cost between EMC and the recent baseline GCAL [24] across four benchmarks under continual drift is shown in Figure 2. Notably, EMC achieves substantial efficiency gains, requiring on average 87.4% less runtime and 92.4% less GPU memory across all datasets. The contributions of this work are as follows:

• We propose an efficient and effective framework, EMC, for graph learning under non-stationary distribution shifts at test time. To the best of our knowledge, this is the first approach to integrate

Figure

Figure 3: The framework of EMC. (1) Multi-hop feature propagation on the input graph GtG^t. (2) A closed-form solution to the memory-oriented distribution-matching objective crystallizes the domain-specific memory G~t\tilde{G}^t. (3) The state evolving field models the correlation across consecutive domains. (4) Tighter generalization error upper bounds guarantee effectiveness. (5) The adaptation loss updates the parameters Θt−1→Θt\Theta_{t-1} \to \Theta_t.

closed-form memory crystallization with state-evolving adaptation without requiring any additional model training at test time.

• We introduce a memory-oriented distribution-matching objective with a closed-form solution for memory construction. We further model inter-domain dependencies through state-evolving memories and derive tighter generalization error bounds.

• Extensive experiments validate the effectiveness and efficiency of EMC, showing superior performance compared to existing SOTA methods, while reducing average runtime by 87.4% and GPU memory consumption by 92.4% relative to the recent competitor.

References (42)