arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.08129cs.LGcs.SI
收藏

在线性与正弦之间:重新思考动态图学习中的时间编码器

Between Linear and Sinusoidal: Rethinking the Time Encoder in Dynamic Graph Learning

Hsing-Huan Chung, Shravan Chaudhari, Xing Han, Yoav Wald, Suchi Saria, Joydeep Ghosh

AI总结:

本文重新思考动态图学习中的时间编码器,提出线性时间编码器作为正弦编码的简化替代,通过自注意力有效捕获时间跨度,在六个数据集上提升TGAT和DyGFormer性能并大幅节省参数。

摘要:

动态图学习对于涉及时间网络的应用至关重要,并且需要有效建模时间关系。开创性的基于注意力的模型,如TGAT和DyGFormer,依赖正弦时间编码器来捕获边事件之间的时间依赖关系。先前的工作证明了正弦编码的合理性,因为其内积依赖于事件之间的时间跨度,而时间跨度是建模事件间关系的关键特征。然而,正弦编码因其多对一的本质而固有地丢失时间信息,因此需要高维度。在本文中,我们严格研究了一个更简单的替代方案:线性时间编码器,它避免了正弦函数造成的时间信息丢失,并减少了对高维时间编码器的需求。我们表明,自注意力机制可以有效地从线性时间编码中学习计算事件之间的时间跨度,并提取相关的时间模式。通过在六个动态图数据集上的大量实验,我们证明线性时间编码器在大多数情况下提升了TGAT和DyGFormer的性能。此外,线性时间编码器可以显著节省模型参数,同时性能损失极小。例如,与100维正弦时间编码器相比,使用2维线性时间编码器的TGAT节省了43%的参数,并在五个数据集上实现了更高的平均精度。虽然两种编码器可以同时使用,但我们的研究强调了在现代动态图模型中经常被忽视的线性时间特征的优势。这些发现可以对各种动态图学习架构的设计选择产生积极影响,并最终惠及推荐系统、通信网络和交通预测等时间网络应用。

英文摘要:

Dynamic graph learning is essential for applications involving temporal networks and requires effective modeling of temporal relationships. Seminal attention-based models like TGAT and DyGFormer rely on sinusoidal time encoders to capture temporal dependencies between edge events. Prior work justified sinusoidal encodings because their inner products depend on the time spans between events, which are crucial features for modeling inter-event relations. However, sinusoidal encodings inherently lose temporal information due to their many-to-one nature and therefore require high dimensions. In this paper, we rigorously study a simpler alternative: the linear time encoder, which avoids temporal information loss caused by sinusoidal functions and reduces the need for high-dimensional time encoders. We show that the self-attention mechanism can effectively learn to compute time spans between events from linear time encodings and extract relevant temporal patterns. Through extensive experiments on six dynamic graph datasets, we demonstrate that the linear time encoder improves the performance of TGAT and DyGFormer in most cases. Moreover, the linear time encoder can lead to significant savings in model parameters with minimal performance loss. For example, compared to a 100-dimensional sinusoidal time encoder, TGAT with a 2-dimensional linear time encoder saves 43% of parameters and achieves higher average precision on five datasets. While both encoders can be used simultaneously, our study highlights the often-overlooked advantages of linear time features in modern dynamic graph models. These findings can positively impact the design choices of various dynamic graph learning architectures and eventually benefit temporal network applications such as recommender systems, communication networks, and traffic forecasting.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑