# 动态图学习

动态图学习是一种机器学习方法，它学习节点和边随时间变化的图的表示，生成具有时间感知能力的节点嵌入，用于演化网络上的链路预测和节点分类等任务。综述围绕两种图表示来组织这一领域：离散时间动态图（DTDG），即在等间隔时间采样得到的快照序列；以及连续时间动态图（CTDG），即一个静态初始图加上一个事件流，每个事件是事件类型、事件和时间戳构成的元组。<sup>[1](https://jmlr.org/papers/volume21/19-447/19-447.pdf)</sup> 为CTDG构建的模型可以应用于DTDG，但反过来未必成立，因为快照序列可能丢弃快照之间发生的事情。<sup>[1](https://jmlr.org/papers/volume21/19-447/19-447.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 两种形式体系 | 离散时间快照序列（DTDG）对连续时间事件流（CTDG），其中边事件为 \( \varepsilon_t = (i, j, t) \)<sup>[1](https://jmlr.org/papers/volume21/19-447/19-447.pdf)</sup><sup> • </sup><sup>[2](https://ar5iv.labs.arxiv.org/html/2405.00476)</sup> |
| 核心机制（CTDG） | 每个节点维护一个记忆向量 \( \mathbf{s}_i(t) \)，在每次事件后更新，压缩该节点的历史<sup>[3](https://doi.org/10.48550/arxiv.2006.10637)</sup> |
| TGN基准结果 | TGN-attn在Wikipedia上达到98.64% ± 0.1的平均精度，在Reddit上达到98.05% ± 0.1（直推式链路预测）<sup>[3](https://doi.org/10.48550/arxiv.2006.10637)</sup> |
| DyGFormer基准结果 | Wikipedia上99.03% ± 0.02 AP，Reddit上99.22% ± 0.01，Enron上92.47% ± 0.12<sup>[4](https://proceedings.neurips.cc/paper_files/paper/2023/file/d611019afba70d547bd595e8a4158f55-Paper-Conference.pdf)</sup> |
| TGB分数（TGN） | 测试MRR：tgbl-wiki-v2上68.93% ± 0.53，tgbl-review-v2上37.48% ± 0.23，tgbl-coin上58.30% ± 5.00，tgbl-comment上37.90% ± 2.10，tgbl-flight上70.60% ± 1.60<sup>[5](https://arxiv.org/html/2307.12510v3)</sup> |
| 时序随机游走 | 在所有嵌入方法和图上，CTDNE相较DeepWalk、node2vec和LINE等静态基线提升11.9% AUC<sup>[6](https://ryanrossi.com/pubs/CTDNE-extended.pdf)</sup> |
| 注意事项 | 简单启发式方法和EdgeBank记忆基线可在若干TGB和BenchTemp数据集上匹敌最先进模型<sup>[7](https://arxiv.org/html/2510.09416v2)</sup> |

## 工作原理

动态图学习通过节点表示的计算和更新方式来编码时间变化。赛义德·梅赫兰·卡泽米及其同事的综述将动态图模型组织在编码器-解码器框架中，解码器分为时间预测模型（预测某事何时发生）和时间条件模型（在给定时间下回答查询）。<sup>[1](https://jmlr.org/papers/volume21/19-447/19-447.pdf)</sup> 一篇教程区分了时间快照图（TSG），即静态快照序列 \( G_t = (t, V_t, E_t, X_t, W_t) \)，与时间变化图（TCG），即原子变化操作序列 \( (c_i, t_i) \)。<sup>[8](https://dl.acm.org/doi/10.1145/3771693)</sup>

时序图神经网络（TGNN）则分为模型演化和嵌入演化。在模型演化中，网络参数本身发生演化，\( \mathbf{\Theta}_t = f_{\mathrm{T}}(\mathbf{\Theta}_{t-1}, \ldots, \mathbf{\Theta}_{t-\tau}) \)；在嵌入演化中，表示是先前图表示的函数，大多数TGNN模型采用第二种形式。<sup>[8](https://dl.acm.org/doi/10.1145/3771693)</sup> 在连续时间家族中，埃马努埃莱·罗西及其同事于2020年在arXiv上提出的时序图网络（TGN）为每个节点维护一个记忆向量 \( \mathbf{s}_i(t) \)，在每次事件后更新，以压缩形式表示该节点的历史，新节点初始化为零向量。<sup>[3](https://doi.org/10.48550/arxiv.2006.10637)</sup> 嵌入模块结合了恒等分量、时间投影和时序图注意力；时间投影计算 \( \mathrm{emb}(i, t) = (1 + \Delta t \cdot \mathbf{w}) \circ \mathbf{s}_i(t) \)，其中 \( \Delta t \) 是自上次交互以来的时间，\( \mathbf{w} \) 是可学习的。<sup>[3](https://doi.org/10.48550/arxiv.2006.10637)</sup>

## 实现方式

实践者提供图快照序列或带时间戳的边流，可选地附带节点特征。预测问题包括节点分类、链路预测和图分类，处于插值（观测时间内）和外推（超出观测时间）两种设定下；链路预测训练使用负样本，即被认为不太可能出现在图中的边。<sup>[1](https://jmlr.org/papers/volume21/19-447/19-447.pdf)</sup> 时序节点分类分为直推式设定（观测节点的标签未知）和归纳式设定（训练中未见过的新节点）。<sup>[8](https://dl.acm.org/doi/10.1145/3771693)</sup>

训练必须防止信息泄漏。TGN在处理一个批次时，首先用存储在原始消息存储中的前序批次消息更新记忆，然后预测当前批次的交互。<sup>[3](https://doi.org/10.48550/arxiv.2006.10637)</sup> DyGLib库通过70%/15%/15%的时间顺序划分以及随机、历史和归纳式负采样策略在十三个数据集上标准化了这一工作流程。<sup>[4](https://proceedings.neurips.cc/paper_files/paper/2023/file/d611019afba70d547bd595e8a4158f55-Paper-Conference.pdf)</sup> 评估指标包括平均精度、AUC-ROC、[平均倒数排名](https://www.edgepedia.org/zh/mean-reciprocal-rank)（MRR）、平均平均排名和HITS@10。<sup>[9](https://par.nsf.gov/servlets/purl/10099025)</sup><sup> • </sup><sup>[4](https://proceedings.neurips.cc/paper_files/paper/2023/file/d611019afba70d547bd595e8a4158f55-Paper-Conference.pdf)</sup>

## 起源

快照嵌入这条线始于在不同时间步上复用静态嵌入机制的方法。帕拉什·戈亚尔、尼廷·卡姆拉、何欣然和刘燕（2018，arXiv）的DynGEM将深度嵌入适配到动态图，<sup>[10](https://doi.org/10.48550/arxiv.1805.11273)</sup> 帕拉什·戈亚尔、苏吉特·罗卡·切特里和阿基米德·卡内多（2018，arXiv）的dyngraph2vec利用动态图表示学习捕捉网络动态。<sup>[11](https://doi.org/10.48550/arxiv.1809.02657)</sup> 张子威及其同事（2017，arXiv）的TIMERS使用误差有界的SVD重启，<sup>[12](https://doi.org/10.48550/arxiv.1711.09541)</sup> 乌列尔·辛格、伊多·盖伊和基拉·拉丁斯基（2019，arXiv）的tNodeEmbed在时序图上嵌入节点。<sup>[13](https://doi.org/10.48550/arxiv.1903.08889)</sup> 在连续时间方面，CTDNE直接从连续边时间戳非递减的时序随机游走中学习嵌入，工作在最细时间粒度上。<sup>[6](https://ryanrossi.com/pubs/CTDNE-extended.pdf)</sup> 拉克希特·特里维迪、戴涵俊、王逸辰和宋乐（2017，arXiv）的Know-Evolve将深度时序推理应用于动态知识图谱，<sup>[14](https://doi.org/10.48550/arxiv.1705.05742)</sup> 随后是拉克希特·特里维迪、梅赫达德·法拉杰塔巴尔、普拉森吉特·比斯瓦尔和查宏远（2018，arXiv）的DyRep，它建模关联和通信过程，<sup>[15](https://doi.org/10.48550/arxiv.1803.04051)</sup> 以及斯里詹·库马尔、张熙坤和[尤雷·莱斯科韦茨](https://www.edgepedia.org/zh/jure-leskovec)（2019，arXiv）的JODIE，它预测动态嵌入轨迹。<sup>[16](https://doi.org/10.48550/arxiv.1908.01207)</sup> 徐达、阮传伟、埃夫伦·科尔佩奥卢、苏尚特·库马尔和坎南·阿昌（2020，arXiv）的TGAT引入了带有函数式时间编码的时序图注意力，<sup>[17](https://doi.org/10.48550/arxiv.2002.07962)</sup> 而TGN（2020）统一了这些设计，表明JODIE、TGAT和DyRep是其框架的具体实例。<sup>[3](https://doi.org/10.48550/arxiv.2006.10637)</sup>

## 变体

**快照侧模型**包括模型演化方法，即演化GNN参数而非嵌入，例如阿尔多·帕雷哈及其同事（2020，AAAI）的EvolveGCN，有两个版本：EvolveGCN-H，其中GCN参数是GRU的隐藏状态；EvolveGCN-O，其中它们是LSTM单元的输入/输出。<sup>[18](https://doi.org/10.1609/aaai.v34i04.5984)</sup><sup> • </sup><sup>[19](https://dl.acm.org/doi/10.1145/3483595)</sup> 此外还有循环嵌入演化方法，例如陈晋音、王雪珂和徐宣恒（2021，Applied Intelligence）的GC-LSTM，使用LSTM更新节点表示，<sup>[20](https://doi.org/10.1007/s10489-021-02518-9)</sup> 以及赵玲及其同事（2019，IEEE Transactions on Intelligent Transportation Systems）的T-GCN，将GCN特征传递给GRU用于交通预测。<sup>[21](https://doi.org/10.1109/tits.2019.2935152)</sup>

**基于记忆的连续时间模型**包括TGN，<sup>[3](https://doi.org/10.48550/arxiv.2006.10637)</sup> 王旭红及其同事（2020，arXiv）的APAN，一种异步传播注意力网络，<sup>[22](https://doi.org/10.48550/arxiv.2011.11545)</sup> 以及根据2024年综述的NAT、TIGER和PRES。<sup>[2](https://ar5iv.labs.arxiv.org/html/2405.00476)</sup> 基于序列的替代方案包括DyGFormer，它从历史一跳交互序列中学习，采用邻居共现编码和一种使计算复杂度在序列长度上保持恒定的分块技术，<sup>[4](https://proceedings.neurips.cc/paper_files/paper/2023/file/d611019afba70d547bd595e8a4158f55-Paper-Conference.pdf)</sup> 丛伟林及其同事（2023，arXiv）的GraphMixer，它质疑是否需要复杂架构，<sup>[23](https://doi.org/10.48550/arxiv.2302.11636)</sup> 以及TCL，一种基于Transformer的对比模型（2021，arXiv）。<sup>[24](https://doi.org/10.48550/arxiv.2105.07944)</sup> 王彦邦、张晏瑜、刘云宇、尤雷·莱斯科韦茨和李攀（2021，arXiv）的因果匿名游走（CAW）使用归纳式基于游走的编码，<sup>[25](https://doi.org/10.48550/arxiv.2101.05974)</sup> 而DyG-Mamba（NeurIPS 2025）应用连续状态空间建模，带有艾宾浩斯式遗忘机制 \( R = \exp(-t/S) \)。<sup>[26](https://proceedings.neurips.cc/paper_files/paper/2025/file/bbba680acd2826f23928c6675a19f0e7-Paper-Conference.pdf)</sup>

## 应用

已记录的应用领域包括社交网络中的时序交互图、电子商务中用于欺诈检测和推荐的实时交易图、交通流的时空图、时序知识图谱和时序引用图。<sup>[27](https://link.springer.com/article/10.1007/s11704-024-3853-2)</sup> 动态行为被分类为拓扑演化、特征演化和网络上的过程，支持动态链路预测、异常检测和扩散预测。<sup>[19](https://dl.acm.org/doi/10.1145/3483595)</sup> T-GCN专门为交通预测而构建。<sup>[21](https://doi.org/10.1109/tits.2019.2935152)</sup>

## 局限与替代方案

**评估脆弱性。** 时序链路预测的二分类表述被描述为数学上不适定，因为连续随机变量取特定离散值的概率为零；一种生成式表述（GTLP）已被提出作为替代。<sup>[8](https://dl.acm.org/doi/10.1145/3771693)</sup> 性能严重依赖负采样策略，有限负样本通过类别不平衡引入分类器偏差；<sup>[8](https://dl.acm.org/doi/10.1145/3771693)</sup> 负采样还导致报告的AUC高方差，可能改变模型的排名。<sup>[28](https://opus.lib.uts.edu.au/bitstream/10453/159694/2/A_Robust_Comparative_Analysis_of_Graph_Neural_Networks_on_Dynamic_Link_Prediction.pdf)</sup> 在采样边集上计算的基于排名的指标可能与全边集上的排名不一致。<sup>[7](https://arxiv.org/html/2510.09416v2)</sup>

**模型实际学到了什么。** 2025年的一篇批评发现，偏向流行或近期活跃节点的简单启发式方法可在若干TGB和BenchTemp数据集上超越最先进模型，而EdgeBank基线（当且仅当边在训练中见过时预测为正）在若干数据集上产生相似精度。<sup>[7](https://arxiv.org/html/2510.09416v2)</sup> 在DyGFormer、GraphMixer、DyRep、JODIE、TGN、TCL、TGAT和CAWN中，已见边的概率分数基本保持不变，无论它们最后被观测到的时间是何时，扰动时间戳通常对性能影响极小。<sup>[7](https://arxiv.org/html/2510.09416v2)</sup> 早期基准同样发现启发式方法优于GNN，尽管启发式方法无法利用节点特征或时序模式。<sup>[28](https://opus.lib.uts.edu.au/bitstream/10453/159694/2/A_Robust_Comparative_Analysis_of_Graph_Neural_Networks_on_Dynamic_Link_Prediction.pdf)</sup>

**记忆与规模。** 消融实验确认记忆很重要：TGN-attn比TGN-no-mem慢约3倍，但精度高近4%，其嵌入模块的存在是为了避免记忆陈旧，即节点在长时间无事件后记忆过时。<sup>[3](https://doi.org/10.48550/arxiv.2006.10637)</sup> 一项大规模系统研究发现，没有节点记忆时，具有大采样预算的模型仍不如带记忆的非常浅的模型，而深度或宽度邻域采样为微小精度提升增加运行时间。<sup>[29](https://www.vldb.org/pvldb/vol18/p956-yang.pdf)</sup> 对于十亿级图，TGL以平均每轮13倍加速和173倍更快的时间并行采样器实现相似或更好的精度。<sup>[30](https://doi.org/10.48550/arxiv.2203.14883)</sup><sup> • </sup><sup>[31](https://www.vldb.org/pvldb/vol15/p1572-zhou.pdf)</sup> 综述将可扩展性、异构信息和缺乏多样化数据集列为开放挑战。<sup>[2](https://ar5iv.labs.arxiv.org/html/2405.00476)</sup><sup> • </sup><sup>[27](https://link.springer.com/article/10.1007/s11704-024-3853-2)</sup>

**基准。** 在专用基准之前，不存在时序GNN的标准化基准，使得公平比较困难。<sup>[32](https://mlg-europe.github.io/2023/papers/215.pdf)</sup> 黄沈阳、法里玛·普尔萨法伊及其同事（2023，arXiv）的时序图基准（TGB）提供用MRR评估的数据集，<sup>[33](https://doi.org/10.48550/arxiv.2307.01026)</sup><sup> • </sup><sup>[34](https://tgb.complexdatalab.com/docs/linkprop/)</sup> BenchTemp（2023）为时序GNN提供通用基准，<sup>[35](https://doi.org/10.48550/arxiv.2308.16385)</sup> 尤佳璇、杜天宇和尤雷·莱斯科韦茨（2022，arXiv）的ROLAND是动态图的图学习框架，<sup>[36](https://doi.org/10.48550/arxiv.2208.07239)</sup> 而一些基线，包括DyRep、TGN、TCL和GraphMixer，在以DyGLib为骨干运行时优于其最初报告的TGB结果。<sup>[37](https://doi.org/10.48550/arxiv.2303.13047)</sup><sup> • </sup><sup>[5](https://arxiv.org/html/2307.12510v3)</sup>

## References

1. [Representation Learning for Dynamic Graphs: A Survey (Kazemi et al., JMLR 2020)](https://jmlr.org/papers/volume21/19-447/19-447.pdf)
2. [A Comprehensive Survey of Dynamic Graph Neural Networks: Models, Frameworks, Benchmarks, Experiments and Challenges (2024)](https://ar5iv.labs.arxiv.org/html/2405.00476)
3. [Rossi, Emanuele and colleagues (2020). Temporal Graph Networks for Deep Learning on Dynamic Graphs. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2006.10637)
4. [Towards Better Dynamic Graph Learning: New Architecture and Unified Library (DyGFormer and DyGLib, NeurIPS 2023)](https://proceedings.neurips.cc/paper_files/paper/2023/file/d611019afba70d547bd595e8a4158f55-Paper-Conference.pdf)
5. [An Empirical Evaluation of Temporal Graph Benchmark (DyGLib extended to TGB)](https://arxiv.org/html/2307.12510v3)
6. [Continuous-Time Dynamic Network Embeddings (extended version)](https://ryanrossi.com/pubs/CTDNE-extended.pdf)
7. [What Do Temporal Graph Learning Models Learn?](https://arxiv.org/html/2510.09416v2)
8. [A Primer on Temporal Graph Learning | ACM Computing Surveys](https://dl.acm.org/doi/10.1145/3771693)
9. [DyRep: Learning Representations over Dynamic Graphs (ICLR 2019)](https://par.nsf.gov/servlets/purl/10099025)
10. [Goyal, Palash and colleagues (2018). DynGEM: Deep Embedding Method for Dynamic Graphs. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1805.11273)
11. [Goyal, Palash, Chhetri, Sujit Rokka, Canedo, Arquimedes (2018). dyngraph2vec: Capturing Network Dynamics using Dynamic Graph Representation Learning. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1809.02657)
12. [Zhang, Ziwei and colleagues (2017). TIMERS: Error-Bounded SVD Restart on Dynamic Networks. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1711.09541)
13. [Singer, Uriel, Guy, Ido, Radinsky, Kira (2019). Node Embedding over Temporal Graphs. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1903.08889)
14. [Trivedi, Rakshit and colleagues (2017). Know-Evolve: Deep Temporal Reasoning for Dynamic Knowledge Graphs. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1705.05742)
15. [Trivedi, Rakshit and colleagues (2018). Representation Learning over Dynamic Graphs. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1803.04051)
16. [Kumar, Srijan, Zhang, Xikun, Leskovec, Jure (2019). Predicting Dynamic Embedding Trajectory in Temporal Interaction Networks. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1908.01207)
17. [Xu, Da and colleagues (2020). Inductive Representation Learning on Temporal Graphs. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2002.07962)
18. [Pareja, Aldo and colleagues (2020). EvolveGCN: Evolving Graph Convolutional Networks for Dynamic Graphs. AAAI Publications (The Association for the Advancement of Artificial Intelligence (AAAI)).](https://doi.org/10.1609/aaai.v34i04.5984)
19. [A Survey on Embedding Dynamic Graphs](https://dl.acm.org/doi/10.1145/3483595)
20. [Jinyin Chen, Xueke Wang, Xuanheng Xu (2021). GC-LSTM: graph convolution embedded LSTM for dynamic network link prediction. Applied Intelligence.](https://doi.org/10.1007/s10489-021-02518-9)
21. [Ling Zhao and colleagues (2019). T-GCN: A Temporal Graph Convolutional Network for Traffic Prediction. IEEE Transactions on Intelligent Transportation Systems.](https://doi.org/10.1109/tits.2019.2935152)
22. [Wang, Xuhong and colleagues (2020). APAN: Asynchronous Propagation Attention Network for Real-time Temporal Graph Embedding. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2011.11545)
23. [Cong, Weilin and colleagues (2023). Do We Really Need Complicated Model Architectures For Temporal Networks?. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2302.11636)
24. [Wang, Lu and colleagues (2021). TCL: Transformer-based Dynamic Graph Modelling via Contrastive Learning. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2105.07944)
25. [Wang, Yanbang and colleagues (2021). Inductive Representation Learning in Temporal Networks via Causal Anonymous Walks. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2101.05974)
26. [DyG-Mamba: Continuous State Space Modeling on Dynamic Graphs (NeurIPS 2025)](https://proceedings.neurips.cc/paper_files/paper/2025/file/bbba680acd2826f23928c6675a19f0e7-Paper-Conference.pdf)
27. [A survey of dynamic graph neural networks (Frontiers of Computer Science, 2024)](https://link.springer.com/article/10.1007/s11704-024-3853-2)
28. [A Robust Comparative Analysis of Graph Neural Networks on Dynamic Link Prediction (Skarding et al.)](https://opus.lib.uts.edu.au/bitstream/10453/159694/2/A_Robust_Comparative_Analysis_of_Graph_Neural_Networks_on_Dynamic_Link_Prediction.pdf)
29. [Evaluations and Conclusions after 10,000 GPU Hours (PVLDB vol. 18)](https://www.vldb.org/pvldb/vol18/p956-yang.pdf)
30. [Zhou, Hongkuan and colleagues (2022). TGL: A General Framework for Temporal GNN Training on Billion-Scale Graphs. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2203.14883)
31. [TGL: A General Framework for Temporal GNN Training on Billion-Scale Graphs (VLDB 2022)](https://www.vldb.org/pvldb/vol15/p1572-zhou.pdf)
32. [Graph Neural Networks for temporal graphs: State of the art, open challenges, and opportunities (MLG 2023)](https://mlg-europe.github.io/2023/papers/215.pdf)
33. [Huang, Shenyang and colleagues (2023). Temporal Graph Benchmark for Machine Learning on Temporal Graphs. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2307.01026)
34. [Dynamic Link Property Prediction, Temporal Graph Benchmark documentation](https://tgb.complexdatalab.com/docs/linkprop/)
35. [Huang, Qiang and colleagues (2023). BenchTemp: A General Benchmark for Evaluating Temporal Graph Neural Networks. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2308.16385)
36. [You, Jiaxuan, Du, Tianyu, Leskovec, Jure (2022). ROLAND: Graph Learning Framework for Dynamic Graphs. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2208.07239)
37. [Yu, Le and colleagues (2023). Towards Better Dynamic Graph Learning: New Architecture and Unified Library. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2303.13047)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Neural networks and deep learning › Neural network architectures › Graph neural network architectures

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/dynamic-graph-learning

English original: https://www.edgepedia.org/dynamic-graph-learning
