Papers
Topics
Authors
Recent
Search
2000 character limit reached

CLDG: Contrastive Learning on Dynamic Graphs

Updated 5 July 2026
  • CLDG is an unsupervised framework for dynamic graphs that uses contiguous timespan views as natural positive pairs, bypassing synthetic augmentations.
  • It enforces temporal translation invariance by ensuring node embeddings remain consistent across different time windows, which boosts node classification and anomaly detection performance.
  • CLDG++ augments local topology with diffusion-based global context, providing richer multi-scale representations while significantly reducing model parameters and training time.

Searching arXiv for the CLDG paper and closely related versions to ground the article in current metadata. CLDG, short for Contrastive Learning on Dynamic Graphs, is an unsupervised framework for dynamic graph representation learning that uses timespan views of an evolving graph as contrastive positives under a temporal translation invariance assumption. Rather than constructing self-supervision through stochastic edge or feature perturbations, CLDG treats different contiguous time windows of the same graph as semantically meaningful views and learns node embeddings that remain consistent across them. In later formulations, the framework is extended to CLDG++, which augments local topology with graph-diffusion global context and supports anomaly detection by measuring cross-timespan consistency (Xu et al., 2024, Xu et al., 26 May 2026).

1. Conceptual definition and problem setting

CLDG operates on dynamic graphs in either discrete-time or continuous-time form. In the continuous-time formulation, the graph is written as G=(V,E,T)G=(V,E,T), where VV is a fixed vertex set, E⊆V×VE\subseteq V\times V is the edge set, and T:V∪E→R+T:V\cup E\to\mathbb R^+ assigns timestamps. An equivalent view at time tt is Gt=(V,Et,Xt)G_t=(V,E_t,X_t), where EtE_t denotes the edges in a time window around tt and Xt∈R∣V∣×d0X_t\in\mathbb R^{|V|\times d_0} are the node features at that time (Xu et al., 2024).

The framework is motivated by a limitation of standard graph contrastive learning on dynamic data. Existing methods typically maximize mutual information between augmented views of a static graph, but in dynamic graphs the augmentation process can alter semantics and labels, which the CLDG paper identifies as a source of degraded downstream performance. CLDG therefore replaces synthetic augmentations with temporally grounded views sampled directly from the graph’s own evolution (Xu et al., 2024).

The resulting task formulation is unsupervised pretraining followed by downstream evaluation. In the node-classification protocol reported for CLDG, embeddings are first learned without labels, then frozen, and a linear classifier is trained on the train split only; final Accuracy and Weighted-F1 are reported on the test split (Xu et al., 2024). In the later formulation, the same learned representations are also used for dynamic graph anomaly detection by quantifying inconsistency across timespans (Xu et al., 26 May 2026).

2. Temporal translation invariance

The central inductive bias of CLDG is temporal translation invariance (TTI). The underlying empirical claim is that, in many real-world dynamic graphs, the semantic label or class of a node tends to remain stable as the observation window shifts forward or backward in time. The detailed exposition states that, if one trains separate encoders on different snapshots, the fraction of nodes whose predicted label changes from one snapshot to the next is very low, often below 20%20\% (Xu et al., 26 May 2026).

In CLDG, TTI is expressed at two levels. The local-level TTI condition states that for any node VV0 and two sampled timespans VV1, the projected embeddings of the same node should be close, so VV2 is small. The global-level TTI condition states that the embedding of VV3 in one timespan should also be close to a pooled representation of VV4’s neighborhood in another timespan, so VV5 is small (Xu et al., 2024).

This inductive bias gives CLDG its basic contrastive semantics: different times are treated as naturally occurring views of the same latent entity. The later formulation makes the same point in mutual-information language, describing the method as maximizing the mutual information between representations of the same node at different times without requiring manual data augmentation (Xu et al., 26 May 2026). A plausible implication is that CLDG is most appropriate when node identity, role, or community membership evolves smoothly rather than discontinuously.

3. Timespan-view sampling and contrastive objectives

The first operational component of CLDG is a timespan view sampling layer. Let VV6 denote the total temporal span of the graph. Two hyperparameters are used: VV7 controls the length of each sampled window, which is VV8, and VV9 controls the number of windows sampled per minibatch. For sampled centers E⊆V×VE\subseteq V\times V0, each graph view is constructed as a contiguous temporal subgraph containing exactly the edges and node features occurring in the interval E⊆V×VE\subseteq V\times V1 (Xu et al., 2024).

Four sampling strategies are specified. Sequential uses non-overlapping windows whose centers differ by integer multiples of E⊆V×VE\subseteq V\times V2. High-overlap enforces E⊆V×VE\subseteq V\times V3 overlap, with adjacent centers separated by E⊆V×VE\subseteq V\times V4. Low-overlap enforces E⊆V×VE\subseteq V\times V5 overlap, with adjacent centers separated by E⊆V×VE\subseteq V\times V6. Random samples centers uniformly in E⊆V×VE\subseteq V\times V7 (Xu et al., 2024).

Once views are sampled, each snapshot is encoded independently. In the standard formulation, if E⊆V×VE\subseteq V\times V8 denotes the projected representation of node E⊆V×VE\subseteq V\times V9 in view T:V∪E→R+T:V\cup E\to\mathbb R^+0, then the local contrastive term between views T:V∪E→R+T:V\cup E\to\mathbb R^+1 and T:V∪E→R+T:V\cup E\to\mathbb R^+2 is

T:V∪E→R+T:V\cup E\to\mathbb R^+3

where T:V∪E→R+T:V\cup E\to\mathbb R^+4 is a temperature. The total CLDG loss sums this term over all nodes and view pairs (Xu et al., 26 May 2026).

The 2024 formulation presents the same idea as two parallel InfoNCE objectives. For node-level invariance,

T:V∪E→R+T:V\cup E\to\mathbb R^+5

For graph-level invariance, if T:V∪E→R+T:V\cup E\to\mathbb R^+6 is a pooled neighbor embedding, then

T:V∪E→R+T:V\cup E\to\mathbb R^+7

Training may use either local TTI, global TTI, or a weighted sum such as T:V∪E→R+T:V\cup E\to\mathbb R^+8 (Xu et al., 2024).

4. CLDG++, multi-scale contrasts, and anomaly detection

A subsequent development introduces CLDG++, which supplements the local adjacency view with a diffusion-based global view. For each timespan T:V∪E→R+T:V\cup E\to\mathbb R^+9, CLDG++ computes a similarity matrix tt0 using either PPR diffusion

tt1

or the heat-kernel diffusion

tt2

where tt3 is the degree matrix and tt4 and tt5 are hyperparameters (Xu et al., 26 May 2026).

CLDG++ then applies two encoders with separate weights, producing local and global features

tt6

which are projected into a contrastive space. The extension introduces a multi-scale contrastive learning objective composed of local-local, global-global, and local-global terms. The paper gives the practical form

tt7

This extension is presented as a way to capture multi-scale topology and obtain richer embeddings (Xu et al., 26 May 2026).

The same cross-timespan consistency mechanism is used for anomaly detection. After training, one samples tt8 sequential views, computes projected node embeddings tt9, and measures pairwise cosine distance

Gt=(V,Et,Xt)G_t=(V,E_t,X_t)0

For node Gt=(V,Et,Xt)G_t=(V,E_t,X_t)1, the mean distance and its standard deviation are

Gt=(V,Et,Xt)G_t=(V,E_t,X_t)2

and

Gt=(V,Et,Xt)G_t=(V,E_t,X_t)3

The anomaly score is then

Gt=(V,Et,Xt)G_t=(V,E_t,X_t)4

Nodes with large scores are flagged as anomalous. The paper states that no threshold is trained; one ranks nodes or evaluates by ROC-AUC (Xu et al., 26 May 2026).

5. Architectures, complexity, and efficiency profile

The default encoder in CLDG is a 2-layer GCN with

Gt=(V,Et,Xt)G_t=(V,E_t,X_t)5

The framework is described as plug-and-play: GAT and GraphSAGE can also be used. The readout is average, sum, or max over neighbors, and the projection head is a 2-layer MLP + LeakyReLU + Gt=(V,Et,Xt)G_t=(V,E_t,X_t)6 normalization (Xu et al., 2024).

A recurrent theme in the CLDG literature is that the method avoids explicit temporal sequence modeling. The later exposition states that CLDG and CLDG++ rely only on graph convolutions and use no RNNs and no self-attention, which makes them lighter than LSTM-, GRU-, or Transformer-based dynamic-graph models. With Gt=(V,Et,Xt)G_t=(V,E_t,X_t)7, Gt=(V,Et,Xt)G_t=(V,E_t,X_t)8, Gt=(V,Et,Xt)G_t=(V,E_t,X_t)9 the number of GCN layers, and EtE_t0 the hidden dimension, the time complexity per epoch is

EtE_t1

and the space complexity in trainable parameters is

EtE_t2

The same source reports that, on seven real-world dynamic graphs with up to EtE_t3 nodes and EtE_t4 edges, CLDG trains in minutes with a few EtE_t5’s MB of parameters, whereas sequence-based methods can run out of GPU memory or take orders of magnitude longer (Xu et al., 26 May 2026).

The 2024 CLDG paper quantifies this efficiency directly. Across seven datasets, the total parameter count of CLDG is approximately 0.05 M, compared with 8–156 M for CAW, 7–155 M for TGAT, 0.10 M for DySAT, and 2–42 M for MNCI. It reports that, compared with existing dynamic-graph methods, the number of model parameters and training time are reduced by an average of 2,001.86 times and 130.31 times on seven datasets, respectively (Xu et al., 2024).

6. Empirical results, scope, and terminological distinction

The principal evaluation protocol for CLDG uses seven datasets—DBLP, BitcoinOTC, TAX, BITotc, BITalpha, TAX51, Reddit—split 1:1:8 into train/validation/test on nodes. Training is unsupervised with Adam; the encoder and projection head use learning rate EtE_t6 and weight decay EtE_t7, while the linear classifier uses learning rate EtE_t8 and weight decay EtE_t9. Other settings include batch size tt0, hidden dimension tt1, output dimension tt2, up to tt3 epochs, temperature tt4 tuned in tt5, and timespan hyperparameters often set to tt6, tt7 (Xu et al., 2024).

On node classification, CLDG_node is reported to achieve state-of-the-art among all unsupervised methods on 11 out of 14 metrics, and to outperform some supervised baselines on BitcoinOTC, BITotc, BITalpha, and Reddit. On average, CLDG_node beats the best prior unsupervised GraphSAGE by +1.47% in Accuracy (Xu et al., 2024). The later formulation states more generally that CLDG and CLDG++ both exhibit desirable performance on downstream tasks including node classification and dynamic graph anomaly detection (Xu et al., 26 May 2026).

Ablation results further clarify the framework’s operating regime. Sequential and Random sampling yield the best performance, while High-overlap (75%) is worst because the task becomes too easy and generalization degrades. Increasing the number of views from tt8 to tt9 gives diminishing but positive gains of about 0.4–0.8% average, and replacing GCN with GAT or GraphSAGE produces results within 0.5%, which the paper interprets as evidence of encoder-agnostic behavior (Xu et al., 2024).

The acronym requires one terminological qualification. In software engineering, ClDG can also denote the Class Dependence Graph, a source-level representation of control and data dependencies within a class, augmented in one bug-localization method by an object-state annotation function Xt∈R∣V∣×d0X_t\in\mathbb R^{|V|\times d_0}0. That usage is unrelated to dynamic graph contrastive learning and belongs to a different research lineage centered on program dependence analysis and fault localization (Ray, 2011).

Taken in its graph-learning sense, CLDG denotes a family of methods built on a simple principle: dynamic graphs provide their own temporally grounded positive pairs. The combination of timespan sampling, TTI-based contrastive learning, and lightweight graph encoders yields an unsupervised representation framework whose empirical profile emphasizes both competitive downstream performance and substantial reductions in parameters and training time (Xu et al., 2024).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to CLDG.