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

Yue Hou, Ruomei Liu, Yingke Su, Wu Junran, Ke XuNeurIPS 2026

TL;DR

Real-world graphs—like social networks or financial transactions—are constantly shifting, causing Graph Neural Networks (GNNs) to either fail on new data or catastrophically forget the past. Instead of burning GPU hours training generative AI models to hallucinate past "memories" for replay, this paper introduces Efficient Memory Crystallization (EMC), a math-driven approach that distills incoming graphs into tiny, ultra-compact summaries using a fast closed-form equation. The result? Better accuracy across shifting domains while slashing runtime by ~87% and GPU memory by ~92%.

What Problem Does This Paper Address?

Imagine deploying a GNN trained to spot illicit Bitcoin transactions in 2021, and letting it run continuously through 2026. You hit three walls immediately:

  1. Continual Distribution Shift: Fraud patterns, network topologies, and user behaviors drift non-stop over time.
  2. Test-Time Constraints: Due to privacy or storage limits, you often lose access to your original training data, and incoming live data doesn't come with neat ground-truth labels.
  3. Catastrophic Forgetting: If you aggressively update your GNN to handle today's graph, it forgets what it learned yesterday.

Existing solutions for Continual Test-Time Adaptation (CTTA) on graphs try to prevent forgetting via "replay." Because they can't store massive historical graphs, recent state-of-the-art methods train auxiliary generative models (like Variational Graph Autoencoders) on the fly to synthesize fake historical graphs. However, training a generator at test time is sluggish, memory-hungry, and ignores the fact that raw graphs are full of noisy, redundant connections.

Figure 1: A general paradigm of test-time adapta- tion under non-stationary distribution shifts. Com- pared 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 crys- tallizes each domain into a compact memory and explicitly considers these factors to maintain both generalizability and adaptability, thereby ensuring efficiency and effectiveness.

Methods

The authors propose EMC, arguing that you don't need to generate memories with neural networks—you can crystallize them directly using linear algebra.

Figure 3: The framework of EMC. (1) Multi-hop feature propagation on the input graph Gt. (2) A closed-form solution to the memory-oriented distribution-matching objective crystallizes the domain- specific memory ˜Gt. (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.

Here is how EMC adapts a pre-trained GNN as a sequence of unlabeled test graphs arrives:

  • 1. Structure-Aware Feature Propagation (Standard + Tweak): First, node features are smoothed across neighborhoods using non-parametric multi-hop propagation (no neural weights needed). Nodes are grouped into semantic sub-classes using the model's current predictions, weighting each node by prediction confidence so uncertain guesses don't poison the pool.
  • 2. Closed-Form Memory Crystallization (Novel): EMC shrinks the massive input graph into a tiny surrogate graph—just 1% of the original node count. It builds a sparse adjacency matrix via cosine similarity thresholding, then solves for the optimal compressed node features. By combining distribution matching with a smoothness constraint (Dirichlet energy), the authors derive an exact, closed-form matrix inversion to compute these features instantly—zero gradient descent or auxiliary model training required.
  • 3. State-Evolving Memories (Novel): Consecutive domains in the real world aren't independent; tomorrow's social network looks a lot like today's. EMC links memories across time by taking a convex combination (a weighted blend) of the previous step's memory representation and the current one.
  • 4. Memory-Driven Adaptation: Finally, the GNN updates its weights by minimizing prediction uncertainty (Shannon entropy) on the current graph, regularized by a Kullback–Leibler (KL) divergence penalty that prevents its predictions on past crystallized memories from drifting too far.

Datasets

Following established continual graph adaptation benchmarks, the authors evaluate EMC on four real-world node classification datasets across two types of drift (no new real-world benchmarks are introduced, though synthetic graphs are generated for scaling tests):

  • Regional Shifts: Facebook-100 and Twitch-Explicit (social networks where each region/university serves as a distinct domain).
  • Temporal Shifts: OGB-Arxiv (citation networks evolving over years) and Elliptic (Bitcoin transaction graphs spanning sequential time steps).

Key Insights and Ideas

  • Linear Algebra Beats Generative Replay: The core "aha!" moment is realizing that test-time memory construction doesn't require training a generative model. Because the target memory graph is tiny ($1\%$ of original nodes), solving a closed-form ridge-like regression with a graph Laplacian regularizer is practically instantaneous—taking just 0.71 seconds even on a 200,000-node graph.
  • Eliminating the Domain-Shift Penalty: Theoretically, the authors prove that adapting via state-evolving crystallized memories yields a strictly tighter generalization error bound than direct adaptation, effectively canceling out an explicit source-to-target divergence penalty.
  • Less Data, Better Signal: Raw graphs contain structural redundancy that distracts adaptation. T-SNE visualizations show that the $1\%$-sized crystallized graphs align remarkably well with the full graphs in embedding space, acting as denoised semantic anchors.

Key Results

Tested across four GNN backbones (GCN, GraphSAGE, GAT, GIN) and compared against 10 baselines, EMC consistently wins on both accuracy and efficiency:

  • Massive Speed & Memory Gains: Compared to the leading generative competitor (GCAL), EMC cuts average runtime by 87.4% and GPU memory consumption by 92.4%. On OGB-Arxiv (with GraphSAGE), runtime drops from 1,371.78s to 24.84s, and memory plunges from 21.84 GB to 0.38 GB.
  • Superior Scalability: When scaling synthetic graphs beyond 40,000 nodes, competing continual baselines crash with Out-Of-Memory (OOM) errors, whereas EMC scales smoothly up to 100,000+ nodes.
  • Stronger Retention and Generalization: EMC achieves top Average Performance (AP) and positive Average Forgetting (AF) scores across backbones (e.g., boosting AP on OGB-Arxiv with GAT from 25.10% to 38.69%), proving it adapts to new domains while actively reinforcing past knowledge.
Figure 2: Runtime and GPU memory cost compar- ison between baseline GCAL and EMC.

Limitations and Future Work

  • Covariate Shift Assumption: EMC's problem setup assumes covariate shift—meaning the graph structure and node features change ($P_S(G) \neq P_T(G)$), while the underlying relationship between inputs and labels stays constant ($P_S(Y|G) = P_T(Y|G)$). Extreme concept drift (where the definition of a class fundamentally flips) or newly emerging classes are not addressed here.
  • Fixed Mixing Weights: In the state-evolving memory step, the weights blending past and current memories ($w_{t-1}$ and $w_t$) are fixed hyperparameters chosen via grid search. Because their theoretical error bounds hold for any valid convex combination, the authors note that designing an adaptive weighting strategy is a natural direction for future work.
  • Hyperparameter Tuning: Parameter studies show that while EMC is fairly robust, its performance is noticeably sensitive to the replay weight $\beta$, requiring reasonable tuning for optimal results.

Summary updated

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.
BibTeX
@inproceedings{hou2026efficient,
  author = {Yue Hou and Ruomei Liu and Yingke Su and Wu Junran and Ke Xu},
  title = {{Efficient Memory Crystallization for Graph Learning under Non-Stationary Distribution Shifts}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=nG6LsRFiOk},
}
Figure