<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kelvin Jose on Medium]]></title>
        <description><![CDATA[Stories by Kelvin Jose on Medium]]></description>
        <link>https://medium.com/@kelvinjose?source=rss-47f3a41adda4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ea-DiOi1zeQcf4ZALrBsFA.jpeg</url>
            <title>Stories by Kelvin Jose on Medium</title>
            <link>https://medium.com/@kelvinjose?source=rss-47f3a41adda4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 16:58:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kelvinjose/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[TempME: Towards the Explainability of Temporal Graph Neural Networks via Motif Discovery]]></title>
            <link>https://kelvinjose.medium.com/tempme-towards-the-explainability-of-temporal-graph-neural-networks-via-motif-discovery-6b0c606b2194?source=rss-47f3a41adda4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b0c606b2194</guid>
            <category><![CDATA[explainable-ai]]></category>
            <category><![CDATA[graph-neural-networks]]></category>
            <category><![CDATA[graph-theory]]></category>
            <category><![CDATA[graph-machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Kelvin Jose]]></dc:creator>
            <pubDate>Tue, 23 Sep 2025 11:48:38 GMT</pubDate>
            <atom:updated>2025-09-23T11:48:38.668Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This is a review of the paper titled <a href="https://arxiv.org/pdf/2310.19324">TempME: Towards the Explainability of Temporal Graph Neural Networks via Motif Discovery</a> which proposes a new architecture called TempME that tries to identify the set of key temporal motifs that influences the prediction of a TGNN</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2yjESg2fP6o1cuJ3vbslAQ.png" /></figure><h4>Introduction</h4><p>In this series, we have explored several <strong>Temporal Graph Neural Network </strong>(TGNN) architectures that learn node and edge embeddings to capture both the structural and temporal patterns of dynamic networks. We also looked at the paper <em>“</em><a href="https://kelvinjose.medium.com/explaining-temporal-graph-models-through-an-explorer-navigator-framework-41c8f50c269c"><em>Explaining Temporal Graph Models Through an Explorer-Navigator Framework</em></a><em>”</em>, which was one of the first attempts to tackle explainability in this space. The common challenge these works address is the <strong><em>lack of interpretability</em></strong> in TGNNs — understanding <em>why</em> a model makes certain predictions.</p><p>This paper makes three key contributions:</p><ol><li>It is the first to use <em>temporal motifs</em> for explaining TGNNs, offering more insightful and interpretable explanations.</li><li>It incorporates the <em>null model</em> within the information bottleneck principle, specifically tailored for temporal explanation tasks.</li><li>The discovered temporal motifs not only explain TGNN predictions but also <em>improve link prediction performance</em>, showing practical benefits beyond interpretability.</li></ol><p>Together, these contributions position <em>TempME</em> as a meaningful step forward in making temporal graph models not only more accurate but also more transparent and trustworthy - an essential factor as these models move closer to real-world applications.</p><h4>Temporal Motifs Explainer (TempME)</h4><p>Temporal Graph Neural Networks are primarily designed to capture the temporal and spatial information contained in <em>Continuous Time Dynamic Networks</em> or <em>temporal networks</em>. These models showcase unprecedented performance in detecting dependencies between interactions over time. <em>Link prediction</em> between two nodes is the key technique used by TGNNs to measure their generalizability and efficiency on various datasets. Given two nodes <em>u</em> and <em>v</em> at time <em>t</em>, TGNNs first generate their embedding representations coupled with time using multiple <em>Message Passing</em> layers and then predict the probability of a potential interaction between the nodes in the future, at time <em>t + 1</em>.</p><p>Authors observe that the dynamics of a temporal network is governed by a set of recurring sub-structures known as <strong>temporal motifs</strong>. They are statistically sound and over-represented patterns or sub-graphs within a network. We can consider motifs as the fundamental building blocks that shed light onto relevant insights explaining local and global evolutionary processes. It is always possible for experts to derive statistically significant motifs that are responsible for different types of interactions from domain specific networks. <a href="https://www.cell.com/pb/assets/raw/journals/research/snapshots/PIIS0092867410011360-1422647817677.pdf">Here</a> is a poster illustrating various motifs that are often seen in cell interaction networks.</p><p>Even though TGNNs are good at learning time-aware representations and predicting a future link between two nodes, they lack transparency. We do not know which events were responsible for a certain prediction. To make a model and its predictions transparent, one of the techniques is to provide the rationale behind the decision in human understandable format. So, improving explainability is key in enhancing the trustworthiness of TGNNs and this is the exact kind of problem TempME is trying to solve. The authors are proposing to fix the explainability problem in TGGNs by identifying a set of temporal motifs (events in other words) that influenced their predictions. So for each prediction, there will be a set of temporal motifs or events that explains why this decision was made. These important events should be temporally proximate and spatially adjacent, so it will be easier for someone to cross-verify and understand them better.</p><p>TempME is based on Information Bottleneck (IB) which finds the best trade-off between accuracy and compression, means there could be a long list of events that influenced the prediction with different importance, some of them could be highly important where as other could be less important. So, IB helps in picking up the most relevant set of events without loosing much accuracy. To use IB in temporal networks or to estimate the statistical significance of the important temporal motifs, a null model is used. Temporal motifs could exist with varying frequencies, any pattern that is different from a null model would be useful and important, that is the base idea.</p><h4>The Framework</h4><p>The TempME framework is a five step pipeline given a temporal graph and a future link prediction between nodes <em>u</em> and <em>v</em>. TempME first samples temporal motif instances that agree with some temporal and spatial conditions from the surroundings of both nodes. Then a <em>temporal motif encoder</em> is used to generate embeddings corresponding to each motif instance and this process involves three sub-tasks namely, <em>event anonymization, message passing</em> and <em>pooling</em>. The importance score of each motif will be calculated using a <em>scoring function</em> which will then be used to generate cohesive explanations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ABL9eo_aZiidhQ9D.png" /><figcaption>TempME framework</figcaption></figure><h4>Temporal Motif Extraction</h4><p>The first step is to extract candidate temporal motifs from the surrounding of a given node. Each candidate motif should be of,</p><ul><li><em>n</em> nodes</li><li><em>l</em> length</li><li><em>δ</em> duration</li></ul><p>We can represent each candidate as a sequence of event that are ordered in the revere order of time, i.e. {(<em>u₁</em>, <em>v₁</em>, <em>t₁</em>), (<em>u₂</em>, <em>v₂</em>, <em>t₂</em>),⋯, (<em>uₗ</em>, <em>vₗ</em>, <em>tₗ</em>)} where <em>t₀</em> &gt;<em> t₁</em> &gt; <em>t₂</em> ⋯ &gt; <em>tₗ</em> and <em>t₀</em> − <em>tₗ</em> ≤ <em>δ. Also, two temporal motifs are considered to be equivalent if they have the same topology and their events occur in the same order. </em>Extracting motifs is a computationally challenging problem and the authors stick to a variant of <a href="https://www.encodeproject.org/software/mfinder/">MFinder</a> motif mining algorithm. Given a temporal graph and a node of interest, this algorithm tries to extract utmost <em>C</em> temporal motifs with the above three conditions.</p><h4>Motif Embedding Generation</h4><p>The goal of this stage is to generate embeddings corresponding to the <em>C</em> temporal motifs extracted from the surrounding of each node. To maintain the inductiveness, authors create structural features to <em>anatomize</em> event identities by counting the appearance at certain positions:</p><p><em>h(eᵢ, u, v)[j]</em> = |<em>{ I</em> |<em> I</em> ∈ <em>Mᵤ</em> ∪ <em>Mᵥ</em>, <em>I[j]</em> = (<em>uᵢ, vᵢ, t</em>); <em>∀t</em> }|, for <em>i</em> ∈ {<em>1, 2,⋯, l</em>}</p><p><em>h(eᵢ, u, v)</em> (abbreviated as <em>h(eᵢ)</em> for simplicity) is a <em>l</em>-dimensional structural feature of <em>eᵢ</em> where the <em>j</em>-th element denotes the number of interactions between <em>uᵢ</em> and <em>vᵢ</em> at the <em>j</em>-th sampling position in <em>Mᵤ</em> ∪ <em>Mᵥ </em>(<em>Mᵤ</em> and <em>Mᵥ </em>are the sets of <em>C</em> temporal motifs extracted from nodes u and v respectively). <em>h(eᵢ)</em> essentially encodes both spatial and temporal roles of event <em>eᵢ</em>.</p><p>Given the temporal motifs and their structural — node features, a <em>Message Passing</em> scheme is utilized to update embeddings of each node within the motif. A global pooling operation is then performed to summarize theses updated node features into a single embedding which serves as the motif embedding.</p><h4>Sampling and Explanation</h4><p>A Multi Layer Perceptron (MLP) is used to calculate the importance score of a temporal motif embedding which tells its significance given a prediction (query) to be explained. The score of each motif is calculated and used as a screening proxy to select a subset of most important motifs from a set of <em>2*C</em> candidates. We can limit the prediction of the MLP to binary value and use a threshold to filter only the important ones out. The explanation sub-graph of the prediction will then be the set of all those important motifs left out.</p><h4>Experiments</h4><p>The authors put TempME to the test across six real-world temporal graph datasets — ranging from interaction-heavy platforms like Wikipedia and Reddit, to social networks like Enron and UCI, and political networks such as Can.Parl. and US Legis. These datasets offer a broad mix of attributes and structures, making them ideal for evaluating how well TempME explains predictions in different contexts. To do this, they pair TempME with three leading temporal graph neural networks (<a href="https://arxiv.org/abs/2002.07962">TGAT</a>, <a href="https://arxiv.org/abs/2006.10637">TGN</a>, and <a href="https://arxiv.org/abs/2302.11636">GraphMixer</a>), each known for strong performance in modeling dynamic relationships. The task is framed as predicting whether events would occur (a binary classification problem), using inductive training to simulate real-world scenarios where future data is unseen. For baselines, TempME is compared against a variety of explanation methods — from straightforward attention and gradient-based techniques, to more advanced models like <a href="https://arxiv.org/abs/1903.03894">GNNExplainer</a>, <a href="https://arxiv.org/abs/2011.04573">PGExplainer</a>, and <a href="https://openreview.net/forum?id=BR_ZhvcYbGJ">TGNNExplainer</a>, the current standard for temporal graphs. To keep evaluations consistent, the team apply fixed dataset splits and used small temporal motifs (up to three nodes and events), supported by the GINE architecture for message passing and mean-pooling for summarization.</p><h4>Evaluation</h4><p>To evaluate explanation quality, the authors focus on three metrics: <strong><em>Fidelity</em></strong>, which measures how faithfully an explanation reflects the model’s decision; <strong><em>Sparsity</em></strong>, which rewards concise explanations; and <strong><em>ACC-AUC</em></strong>, which evaluates how well explanations align with the base model’s predictions across varying sparsity levels. The results show that TempME consistently outperforms baseline methods across different datasets and base models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Wtcp7D80ODRARJWx.png" /><figcaption>ACC-AUC of TempME and baselines over six datasets and three base models</figcaption></figure><p>Notably, when combined with TGN, TempME achieves state-of-the-art performance with ACC-AUC scores exceeding 90% on all six datasets. Unlike attention — or gradient-based methods that only perform well on datasets with rich attributes (like Wikipedia or Reddit) but falter on unattributed graphs, TempME maintains strong and stable results regardless of dataset type. Further analysis reveal differences in how base models process historical events — TGAT relies on a smaller, more selective set of past events, while TGN and GraphMixer draw from a broader historical context. Beyond accuracy, TempME also excel in generating <strong>cohesive explanations</strong>. By leveraging self-connected motifs, it is able to produce explanations that are not only faithful and compact but also coherent and temporally consistent — surpassing both self-interpretable and learning-based baselines.</p><h4>Conclusion</h4><p>In conclusion, the authors introduce <strong>TempME</strong>, a new framework designed to explain predictions made by Temporal Graph Neural Networks (TGNNs). By combining temporal motifs with the information bottleneck principle, TempME can pinpoint which past events matter most to a model’s decision, filling a key gap in explainability research for temporal graphs. Beyond achieving strong performance, this work opens new directions — such as using TempME to better understand how different TGNNs behave, identify models that capture meaningful patterns, or strengthen the reliability of online predictive services. The broader implications are significant: with clearer and more trustworthy explanations, TGNNs could be safely applied in high-stakes areas like healthcare, finance, and social platforms. Still, the researchers caution that fairness, transparency, and privacy must remain central, ensuring that explanations are not only useful but also ethical and responsible.</p><p>It was again a phenomenal read. I appreciate all you efforts if you read all the way through here. Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b0c606b2194" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Explaining Temporal Graph Models Through An Explorer-Navigator Framework]]></title>
            <link>https://kelvinjose.medium.com/explaining-temporal-graph-models-through-an-explorer-navigator-framework-41c8f50c269c?source=rss-47f3a41adda4------2</link>
            <guid isPermaLink="false">https://medium.com/p/41c8f50c269c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[graph-neural-networks]]></category>
            <category><![CDATA[explainable-ai]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Kelvin Jose]]></dc:creator>
            <pubDate>Mon, 28 Jul 2025 09:08:21 GMT</pubDate>
            <atom:updated>2025-07-28T09:08:21.499Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Explainable AI is quite promising and progressing area of work with great impact. It focuses on creating AI systems that can reason about the decisions and actions it take.</blockquote><blockquote>This is a holistic review of the ICLR 2023 paper titled <a href="https://openreview.net/pdf?id=BR_ZhvcYbGJ">Explaining Temporal Graph Models Through An Explorer-Navigator Framework</a> which proposes a framework named T-GNNExplainer to generate the explanations of predictions made by Temporal Neural Networks using an Explorer - Navigator setup.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YijoIsS00v0hVw6Zm-PJ6g.png" /></figure><h4>Introduction</h4><p>We have been looking into some of the intrinsic details of applying Machine Learning techniques on temporal networks to generate embeddings for nodes and edges. Generally we call this technique, temporal graph representation learning, where the primary goal is to learn representations from topological and temporal information along with inherent features, for a variety of down-stream tasks such as node classification, link prediction and clustering.</p><ol><li><a href="https://medium.com/@kelvinjose/towards-better-dynamic-graph-learning-21af63408ac9">Towards Better Dynamic Graph Learning</a></li><li><a href="https://medium.com/@kelvinjose/dyrep-learning-representations-on-dynamic-graphs-d157c052a304">DyREP: Learning Dynamic Representations on Dynamic Graphs</a></li></ol><p>Even though we have strong models to generate these embeddings, nobody has been able to explain why certain decisions were taken by a model during its inference phase, for example why did a Temporal Graph Neural Network (TGNN) predict either the presence or the absence of a link between two nodes, or why was a node categorized to a specific class, but not to others. A well-trained <em>temporal explainer</em> is supposed to produce a list of crucial past events (or a sub-graph that is bounded temporally and spatially) that led to an action performed by a TGNN. The lack of explainability and transparency in almost all such models prevent them from being trustful and reliable in high-stake situations such as disease progression prediction in healthcare and fraud detection in financial transactions. Specially designed explainers should be able to bring model specific rationale and explanations behind its actions, which would instantly improve the confidence on its predictions.</p><p>There have been some works done in the static graph explanation space, where the popular way of explaining static graphs it to study the variations in the outputs of trained GNNs by subtly altering the inputs. The assumption is that when critical pieces of inputs are altered, the outputs also get affected. Two major branches of static GNN explainers are <em>learning</em> and <em>search</em> based explainers. Learning-based explainers use the embeddings generated by the GNNs to train a separate Neural Network to predict the importance scores of nodes and edges. On the other hand, search-based explainers use search algorithms with a score function to find an important subset of the input. Interestingly, neither learning-based, nor search based explainers are able to take temporal networks and their predictions into account and generate explanations behind each of them. Search-based technique suffers from higher time-complexity, since the search space of each instance is different from one another and the search might take forever to draw conclusions.</p><h4>Temporal Graph Neural Network Explainer (T-GNNExplainer)</h4><p>T-GNNExplainer is an instance-level model-agnostic explainer specifically designed and developed for temporal network models. Given an event <em>e</em> at time <em>t</em>, it aims to identify a set of events around the target event <em>e</em>, such that the selected set is the best explanation of a model’s prediction. To do this, an initial set of candidate events would be identified and then refined later to eliminate less important events from the candidates. The candidate events would be conditioned on both temporal and structural properties of the graph. That is, we pick one of the events as a potential candidate, iff it lies with in the <em>k-hop</em> neighborhood (this idea comes from the very famous <em>Message Passing Neural Network</em> family and the neighborhood aggregation strategy) of <em>e</em> and not older than a given timestamp <em>tₙ</em>. So the set of selected events would definitely be from the <em>k-hop</em> neighborhood of <em>e</em> as well as most recent ones, in other words newer than a previous timestamp <em>tₙ</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*a5Zsd__xIzQfPKlm6u81tg.png" /><figcaption>Figure 1: Left — Temporal graph Gᵏ and target event <em>eₖ</em>, Right: Gᵏ after temporal (most recent 5 events) and spatial (event that are 2-hop away) conditions applied. All the green events would be selected as the candidate set.</figcaption></figure><p>T-GNNExplainer is a framework that benefits from both learning and search based explainers - two key strategies used in static GNN based explainers. The learning-based explainer is responsible for estimating the influence of a candidate event <em>c</em> on a target event <em>e. </em>The search-based explainer is inherently complicated when time and resources are considered, but T-GNNExplainer uses a Monte Carlo Tree Search (MCTS) method to optimize the search space by selectively reducing unwanted searches through the candidate set. T-GNNExplainer is made of two major components,</p><ol><li><strong>Navigator - </strong>A inductively pre-trained shallow neural network to quantify the relationship between a candidate event c and a target event e.</li><li><strong>Explorer - </strong>A search algorithm that expands nodes in the MCTS tree for further explorations towards leaf nodes.</li></ol><p>These two components work in tandem i.e. the explorer is guided by the navigator and tries to find an optimal set of candidates based on MCTS search.</p><h4>Methodology</h4><p><strong>Problem Formulation: </strong>Given a sequence of timestamped events and a temporal GNN model <em>f(.) </em>trained on those events, T-GNNExplainer tries to explain why the model <em>f</em> predicts an event <em>eₖ</em> would occur or not. A subset of events <em>Rᵏ</em> from all the previous events <em>Gᵏ</em> that satisfies the temporal and spatial conditions as we discussed earlier would be the ideal explanation of the event <em>eₖ</em>. To do it, we can try to optimize the mutual information <em>MI(𝑌ₖ | 𝑅ᵏ) </em>where <em>𝑌ₖ </em>the original prediction made by <em>f(Gᵏ)[eₖ]</em>. When an optimal <em>𝑅ᵏ </em>is found, it is then considered as the good explanation for the prediction. In other words, the prediction made by considering <em>Gᵏ </em>as a whole should be approximated by using just <em>𝑅ᵏ i.e.</em></p><p><em>f(Gᵏ)[eₖ] ≈ f(Rᵏ)[eₖ]</em></p><p><strong>Navigator</strong><br>It is an inductively pre-trained feed forward neural network <em>h_θ(eⱼ, eₖ)</em>, which tries to identify the importance score of a candidate event <em>eⱼ</em> when paired with a target event <em>eₖ</em>. The score predicted by <em>h_θ</em> will be useful in the node expansion step of the explorer. Candidate events with less importance scores will be removed from each node to make the explanation subset short and optimal. The features used to predict the importance score between <em>eⱼ </em>and<em> eₖ </em>are discussed below,</p><p>Given a target event <em>eₖ = {nᵤₖ, nᵥₖ, tₖ, attₖ} </em>and a candidate event <em>eⱼ = {nᵤⱼ, nᵥⱼ, tⱼ, attⱼ}, </em>the importance is calculated as,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*P4ET5ImZ6OOWZP6UNWjT-w.png" /><figcaption>Importance score calculation of target and candidate events <em>eₖ and eⱼ</em></figcaption></figure><p>where <em>X</em> is the feature matrix of the nodes in the temporal graph, <em>nᵤ </em>and<em> nᵥ </em>are the nodes involved in the event, <em>Time(.) </em>is a function that quantifies the time at which the event took place and <em>att</em> is the attribute associated with the event.</p><p>The navigator is trained using many such instances of target and candidate events inductively and will be used in conjunction with explorer to guide its decisions.</p><p><strong>Explorer</strong><br>The role of explorer is to facilitate node expansion of MCTS by iteratively removing candidate events with less importance. Multiple searches (authors call them rollouts) from the root node of the search tree towards leaf nodes are done to identify a feasible subset of events that are supposed to be the best explanation of a prediction. The steps involved in this process are discussed below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*xF-fNqZ0e7ch9vZjE7ZTXA.png" /><figcaption>Node selection function</figcaption></figure><ol><li><em>Root node initialization</em>: The root node of the MCTS tree will contain all the candidate events around a target event <em>eₖ</em> that satisfy the temporal and spatial conditions as we can see in Figure 1.</li><li><em>Node expansion</em>: It is done by calling the navigator function to remove one event from a node with less importance. So the resultant node will have one less events in comparison with its immediate parent. This process will continue until a termination condition is met, for example maximum number of events can be removed or minimum number of events present in a node.</li><li><em>Node selection</em>: When the search process has to choose one node from multiple nodes to do expansion, this step comes into rescue. Here <em>Nⁱ </em>represents a node in the search tree, <em>C(Nⁱ)</em> is the set of events that are already expanded in <em>Nⁱ</em>, <em>n(Nⁱ, eⱼ) </em>is the count for selecting <em>eⱼ</em> on node <em>Nⁱ</em> in previous searches or rollouts, and<em> c(Nⁱ, eⱼ) </em>is the cumulative reward of selecting event<em> eⱼ </em>on node<em> Nⁱ. </em>The formula tries to have a balance between exploitation and exploration, which means we select the node <em>Nⁱ </em>with maximum average cumulative reward in the former, and the node <em>Nⁱ </em>with fewer simulations in the latter scenario.</li><li><em>Reward simulation and backpropagation</em>: Once the search or rollout is reached a leaf node, the reward function would be invoked to calculate the reward and propogated it back to the root node through the search path.</li></ol><p>After <em>R</em> rollouts, the one leaf node with maximum reward would be the set of events that best explains the prediction.</p><h4>Experiments &amp; Evaluation</h4><p>To evaluate the proposed framework, the authors use both real-world and synthetic datasets. Two of the real datasets used are Wikipedia and Reddit, where the Wikipedia dataset has approximately 9300 nodes and 160,000 temporal events. Similarly, Reddit dataset has 11,000 nodes and 700,000 temporal events. A couple of synthetic datasets are also generated using <a href="https://mathworld.wolfram.com/HawkesProcess.html">Hawkes Processe</a>s with approximately 10,000 temporal events in each of them.</p><p>The target models used in the evaluation process are <a href="https://arxiv.org/abs/2006.10637">Temporal Graph Neural Network</a> (TGN) and <a href="https://arxiv.org/abs/2002.07962">Temporal Graph Attention Network</a> (TGAT). TGN uses <em>update</em> and <em>memory modules</em> to generate and keep track of a compressed representation of the past interactions of each node across different events. TGAT uses a <em>temporal attention</em> layer to calculate the attention scores of the temporal neighbors of a node <em>n</em> before aggregating their information to update the embedding of <em>n</em>.</p><p>Two baseline models used in the study are PGExplainer and an attention based explainer. PGExplainer is actually not meant for temporal explanations, but the authors made some changes to it to adopt it for temporal scenarios. <em>Fidelity</em> and <em>Sparsity</em> are the two evaluation metrics used in the study. Fidelity is defined as the delta of difference between the logits of <em>f(Gᵏ)[eₖ]</em> and <em>f(Rᵏ)[eₖ]</em>. Authors use this intermediate values instead of relying on the probability scores we get after a normalization layer like <em>sigmoid</em> or <em>softmax</em>. Sparsity is the ratio between the sizes of <em>Rᵏ</em> and <em>Gᵏ</em>. But the author have not mentioned if they used number of nodes, events or both combined. As per the assumption, <em>better fidelity and sparsity are the desired properties of a good temporal explainer</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*hoDi3jLIJJGQ4UlRduZ9qQ.png" /><figcaption>Evaluation Results of T-GNNExplainer</figcaption></figure><p>It is evident that the T-GNNExplainer outperformed all the baseline models across different datasets, significantly and consistently. The algorithm PBONE worked the worst out of all, but ATTN, PG and T-GNNExplainer were comparable to each other.</p><h4>Conclusion</h4><p>T-GNNExplainer is proposed as a one of a kind temporal graph prediction explainer. The framework is composed of two core components, namely navigator and explorer. Navigator is a shallow neural network that is inductively trained on multiple pairs of candidate and target events to learn the relationship between them. So that related events will have a higher score of relevance, in contrast with the unrelated events. Explorer uses a MCTS mechanism to facilitate the search across candidate events. For this, the candidate events will be considered as the root of the MCTS tree, and then expanded all the way to leaf nodes by removing one unrelated event from a node, at a time. The explorer uses navigator as a guide in understanding which events are related and unrelated, the decision to select a node for further expansion is done by consulting a scoring function.</p><p>This is still a greedy search method, but explorer - navigator combo is used to reduce the search space to a small manageable subset of all possible candidate solutions. The framework is an instance-level explainer, meaning the explainer is trying to produce explanations corresponding to each input instance. Overall, the paper tries to set a strong baseline on explainers for temporal networks.</p><p>This was a pretty good read, I would say and I enjoyed reading it.</p><p>Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41c8f50c269c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Towards Better Dynamic Graph Learning]]></title>
            <link>https://kelvinjose.medium.com/towards-better-dynamic-graph-learning-21af63408ac9?source=rss-47f3a41adda4------2</link>
            <guid isPermaLink="false">https://medium.com/p/21af63408ac9</guid>
            <category><![CDATA[graph-machine-learning]]></category>
            <category><![CDATA[sequence-model]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[graph]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Kelvin Jose]]></dc:creator>
            <pubDate>Wed, 09 Apr 2025 18:43:49 GMT</pubDate>
            <atom:updated>2025-04-10T12:52:34.324Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is an overview of the paper titled </em><a href="https://arxiv.org/pdf/2303.13047"><em>Towards Better Dynamic Graph Learning: New Architecture and Unified Library</em></a><em> which proposes DyGFormer - a </em><strong><em>transformer</em></strong><em> based architecture that generates embeddings corresponding to a pair of nodes involved an interaction.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cFdzioCOxEHVwFkVQ2U98A.png" /></figure><h3>Introduction</h3><p>The newly proposed architecture DyGFormer is one of the early attempts to incorporate <a href="https://arxiv.org/abs/1706.03762">transformers</a> and multi-headed-attention (MHA) to model the dynamic nature of temporal networks. While static networks exhibit no dynamic behaviour, temporal networks show the evolution of nodes, links and their features over time. We can arrange this evolution as a series of events over a period of time and I think this was a motivating factor to the authors to build something like this. Transformers are primarily meant to process large sequences by formatting each of them into manageable chunks, known as tokens. Each token is then encoded with temporal information to give it a sense of time or position in the sequence. The authors are cleverly trying to proxy this sequence learning technique to model the timed events using transformers and a tokenization method they call, Patching.</p><p>The DyGFormer architecture uses a neighborhood co-occurrence encoding method, which records how often each neighbor shows up in the source and destination node sequences. To capture long-term patterns, DyGFormer breaks each node’s sequence into smaller parts called patches and sends them through the transformer as tokens. This patching method helps the model make better use of longer histories by keeping nearby events together. In contrast to neighborhood sampling techniques such as <a href="https://arxiv.org/abs/1706.02216">GraphSAGE</a>, the proposed method utilizes the full neighborhood of each node rather than sampling a subset. These two are the major challenges the authors are trying to address, i.e. the neighborhood co-occurrence method to exploit the chances of future interactions and patching technique to accommodate the longer neighborhood sequences. While a library named DyGLib is also released, the focus here is solely on the DyGFormer architecture.</p><h3>DyGFormer - Architecture Overview</h3><p>Given an interaction <em>(u, v, t)</em>,<em> </em>the authors are first trying to extract the first-hop neighborhood sequences <em>Sᵗᵤ</em> and <em>Sᵗᵥ</em> for the nodes <em>u</em> and <em>v</em> of the event that took place at time <em>t</em>. Next, in addition to computing the encodings of neighbors, links and time intervals for each sequence, they encode how frequently each neighbor appears in <em>Sᵗᵤ</em> and <em>Sᵗᵥ </em>to better capture the correlations between<em> u </em>and<em> v, </em>resulting in four encoding sequences for<em> u </em>and<em> v </em>in total<em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Tzxfht6-yAi0uU64.png" /><figcaption>DyGFormer Overall Architecture</figcaption></figure><p>Then each encoding is divided into multiple patches and fed into the transformer to calculate the representations. These representations are then averaged to extract the time - aware embeddings corresponding to the nodes involved in the event.</p><p>Features corresponding to the nodes and edges in the neighborhood sequence <em>Sᵗᵤ </em>are retrieved and have the below forms (1) and (2). Time encoding for each of the interaction is learned during the training steps and is denoted by format (3) below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*Q5eODC9VADtNv6EF.png" /><figcaption><em>Input Formats of Neighbors, Edges and Timestamps in </em><strong><em>Sᵗᵤ</em></strong></figcaption></figure><p>Similarly, the above process is repeated to generate the encodings corresponding to the neighbors, edges and timestamps in the sequence <em>Sᵗᵥ </em>as well.</p><h3>Neighborhood Co - Occurrence Encoding Scheme</h3><p>This is one of the two inventions of this research and assumes the appearing frequency of a neighbor in a sequence indicates its importance. The authors say that the occurrences of a neighbor in sequences of <em>u</em> and <em>v</em> could reflect the correlations between them. That is, if <em>u</em> and <em>v</em> have more common historical neighbors in their respective sequences, they are highly likely to interact with each other in the future.</p><p>The encoding is done by counting the occurrences of neighbors in the sequences <em>Sᵗᵤ </em>and<em> Sᵗᵥ </em>and arranging them as a two-dimensional vector. The counts corresponding to each neighbor in the sequences can be retrieved from this vector and arranged in the below format to get the neighbor co-occurrence features.</p><p>For example,</p><ul><li>Historical neighbors of <em>u</em> are: <em>{a, b, a}</em></li><li>Historical neighbors of <em>v</em> are: <em>{b, b, a, c}</em></li></ul><p>We need to compute the neighbor co-occurrence features of nodes <em>u</em> and <em>v</em>.</p><p>Step 1: <strong><em>Compute Appearing Frequencies</em></strong></p><p>For each neighbor, we count how many times it appears in <em>u</em> and <em>v</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/0*VzTxFuYSscuktq8Q.png" /><figcaption>Frequency of occurrence of neighbors</figcaption></figure><p>Thus, the appearing frequencies of each neighbor in <em>u</em>/<em>v</em>’s historical interactions are:</p><ul><li>a appears <strong>2</strong> times in <em>u</em>, <strong>1</strong> time in <em>v</em> → [2, 1]</li><li>b appears <strong>1</strong> time in <em>u</em>, <strong>2</strong> times in <em>v</em> → [1, 2]</li><li>c appears <strong>0</strong> times in <em>u</em>, <strong>1</strong> time in <em>v</em> → [0, 1]</li></ul><p>Step 2: <strong><em>Construct Cₜ​ Matrices</em></strong></p><p>Each row in <em>Cₜ </em>corresponds to a neighbor and its frequency counts.</p><p>For <em>u</em>, the neighbors are {a, b, a}, so <em>Cᵗᵤ</em> = [[2, 1], [1, 2], [2, 1]]<em>ᵀ</em></p><p>where:</p><ul><li>The first row corresponds to a → [2, 1]</li><li>The second row corresponds to b → [1, 2]</li><li>The third row corresponds to a again → [2, 1]</li></ul><p>For <em>v</em>, the neighbors are {b, b, a, c}, so:</p><p><em>Cᵗᵥ</em> = [[1, 2], [1, 2], [2, 1], [0, 1]]<em>ᵀ</em></p><p>where:</p><ul><li>The first and second rows correspond to b → [1, 2]</li><li>The third row corresponds to a → [2, 1]</li><li>The fourth row corresponds to c → [0, 1]</li></ul><p>A 2 - layer perceptron followed by a ReLU activation is used as the function <em>f(</em>.<em>)</em> to encode the features <em>Cᵗᵤ </em>and<em> Cᵗᵥ </em>as below to generate the final neighbor co - occurrence features, where <strong>*</strong> denotes either <em>u</em> or <em>v</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*GjaZJ3qhz6JRSl76.png" /><figcaption>Function Applied Over Cᵗᵤ<em> </em>and<em> Cᵗᵥ</em></figcaption></figure><p>The authors claim that this technique is versatile and can be integrated any model that is based on sequence learning technique.</p><h3>Patching Technique</h3><p>This is the second invention of the paper that helps the model learn long - term patterns and dependencies present in the interaction sequences by dividing them into non - overlapping patches and feeding them to a transformer for processing. This analogy is very similar to language modelling where we divide the input text into non - overlapping chunks which we call tokens, and having them as the input to the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Exsh7omEIXBK97ZI.png" /><figcaption>Patching Pipeline</figcaption></figure><p>The patching pipeline described in the paper is really intuitive to understand. The given features of the neighbors, edges, timestamps and neighborhood co - occurrences will first be divided into non - overlapping patches by a factor <em>P (</em>in the above figure, P is 2<em>)</em>. If the length of the neighborhood sequence <em>Sᵗᵤ </em>or<em> Sᵗᵥ </em>is not divisible by <em>P</em>, the subsequent feature matrix <em>Xᵗ</em> will be padded with some pre - defined placeholders (this info is not clearly mentioned in the paper, I guess the authors use zero padding, by default).</p><p>Features inside each patch are flattened and then sent through a linear layer to get <em>Zᵗ</em> encodings. There will be one <em>Zᵗ</em> matrix per feature type, i.e. Neighbors, Edges, Timestamps and Co-occurrence counts. These four <em>Zᵗ</em> feature matrices are concatenated and forwarded to the transformer model to learn their characteristics as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*qCED_bSHQs5JYmmy.jpeg" /><figcaption>Features to Transformer</figcaption></figure><p>Authors mention that when the length of the neighborhood sequence <em>Sᵗᵤ </em>or<em> Sᵗᵥ </em>is higher, they correspondingly increase P to make the number of patches almost a constant to reduce the computational cost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*cHAT6RbgYShg_fos.png" /><figcaption>Time - Aware Node Representations</figcaption></figure><p>The time - aware representations of the nodes are generated by averaging their related representations at the last layer of the transformer layer.</p><p>The authors empirically show that most baseline solutions fail to generalize when the length of interactions sequences increase, indicating their inability to capture long - term temporal dependencies. So they propose this solution to mitigate the issue mentioned.</p><h3>Experimental Results</h3><p>To evaluate DyGFormer’s performance, the authors conduct a series of experiments. Their objective is to benchmark DyGFormer against several leading methods in dynamic graph learning and provide detailed analysis of its behavior across different settings.</p><p>The experiments are carried out on 13 diverse datasets, spanning domains such as Wikipedia edits, Reddit discussions, online courses, music listening patterns, email communications, political records and international trade. This variety ensures a comprehensive assessment across different types of dynamic graphs.</p><p>DyGFormer is compared against 8 well - established baselines models including <a href="https://arxiv.org/abs/1908.01207">JODIE</a>, <a href="https://arxiv.org/abs/1803.04051">DyRep</a>, <a href="https://arxiv.org/abs/2002.07962">TGAT</a> etc. These baselines represent a mix of techniques, from graph convolutional networks and memory based models to random walk and sequence modelling approaches.</p><p>The evaluation is focused on two main tasks:</p><ul><li><strong>Dynamic Link Prediction</strong>: Predicting whether a link between two nodes will occur at a specific time, tested under both transductive and inductive settings.</li><li><strong>Dynamic Node Classification</strong>: Predicting the state of a node at the time of an interaction.</li></ul><p>Performance is measured using Average Precision (AP) and Area Under the Receiver Operating Characteristic Curve (AUC - ROC). Negative sampling strategies - random, historical and inductive - were employed to create a more challenging evaluation environment. Each dataset is split chronologically into training (70%), validation (15%), and testing (15%) sets to preserve the temporal order of events.</p><h3>Conclusion</h3><p>The authors introduce DyGFormer, a new transformer based model for dynamic graph learning. DyGFormer introduces two key innovations: a neighbor co-occurrence encoding scheme to better capture the relationships between nodes during interactions, and a patching technique that enables the model to learn long - term temporal dependencies more effectively.</p><p>Through extensive experiments across 13 diverse datasets, DyGFormer consistently outperform strong baselines in dynamic link prediction and node classification tasks, achieving higher scores in metrics such as Average Precision and AUC - ROC. The results highlight DyGFormer’s ability to model complex temporal patterns more accurately than previous methods.</p><p>This was an easy read, I hope you enjoyed going through my overview. Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21af63408ac9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DyREP: Learning Representations on Dynamic Graphs]]></title>
            <link>https://kelvinjose.medium.com/dyrep-learning-representations-on-dynamic-graphs-d157c052a304?source=rss-47f3a41adda4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d157c052a304</guid>
            <category><![CDATA[temporal-graph]]></category>
            <category><![CDATA[graph]]></category>
            <category><![CDATA[representation-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[Kelvin Jose]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 13:06:01 GMT</pubDate>
            <atom:updated>2025-01-08T13:06:01.825Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This is an overview of the paper titled <a href="https://openreview.net/pdf?id=HyePrhR5KX">DyREP: Learning Representations on Dynamic Graphs</a> which models the evolution of dynamic graphs through temporal point processes and a neighbourhood-aware attention mechanism.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4z2ATiA8VRo4S7ITrLEeNg.png" /></figure><h4>Introduction</h4><p>DyREP is a popular representation learning technique that generates feature rich and time-dependent embeddings for nodes participating in the evolution process of dynamic graphs. Unlike other embedding models like <a href="https://snap.stanford.edu/node2vec/">Node2Vec</a> or <a href="https://arxiv.org/abs/1403.6652">DeepWalk</a>, DyREP learns functions that produce dynamic embeddings rather than embeddings themselves. This is a notable attribute of all the new age graph embedding models like <a href="https://arxiv.org/abs/2006.10637">TGN</a>, DyREP and <a href="https://arxiv.org/abs/2207.03408">SEMBA</a> which are built for dynamic graphs. It is desired because almost all real world graphs are inherently dynamic, so the learned static embeddings might not capture the evolution in graphs well enough.</p><p>Existing representation learning techniques assume that a single time-scale process drives the evolution of a graph. However, the contributors observe that dynamic graphs in fact exhibit two dynamic processes evolving at different time-scales. One of them captures the <em>dynamics of the graph</em> (topological evolution), while the other models <em>dynamics on the graph</em> (interactions between nodes). Through this framework, the contributors are trying to bridge these two processes with parameterized <em>Temporal Point Processes</em> along with importance-aware attention mechanism which aggregates information flowing in from other nodes (neighbourhood) aroud a central node.</p><h4>Modelling Graph Evolution</h4><p>The contributors of the paper state that the evolution of random graphs are governed through two different random processes — one is an <strong><em>Association Process</em></strong> whereas the other is a <strong><em>Communication Process</em></strong>. The Association Process is responsible for modelling the topological changes in the graph over time i.e. additions of new nodes and edges to a graph. It captures the long-term relationships between the nodes in a graph which lead to the changes in the global structure. The Communication Process on the other hand models the interactions between the existing nodes which are need not to be connected to each other — typically short-term relationships that do not change the topology of the graph but affect the information exchange flow.</p><p>We will go through an example of a professional network like LinkedIn to compare and contrast between these two processes because they are the primary building blocks of the paper. An Association Process occurs when you send a connection request to someone of your professional interests and he/she accepts it sometime later. If we consider each registered user in LinkedIn as a unique node in a big social graph, then a new edge will be added between the nodes corresponding to you and your most recent connection. This could be an event with long-term implications as in you might end up commenting or reacting to his/her new posts and job updates you receive in your feed and vice-versa. A Communication Process involves interactions between entities that do not have an active connection — representing short-term or instantaneous information exchange. If you use the <em>InMail</em> feature in LinkedIn to send a message to one of the users who does not have a connection with you yet represents an interaction without an existing edge. These interactions help to trigger instances of information exchange irrespective of the connection status.</p><p>In summary, on a platform like LinkedIn, an Association Process explains connections that alter the structure or the topology of a graph while a Communication Process represents interactions between nodes with no direct connections.</p><blockquote>I recently read this paper titled <a href="https://arxiv.org/pdf/2402.11139">LiGNN</a> that clearly explains some of the insights on the development and deployment of GNNs at a large scale at LinkedIn based on graphs with at-least 100 billion nodes. A schematic diagram on the paper visualizes different types of nodes they have in their big graph such as users, posts, notifications etc. It is indeed a good read since it covers not only the insights from the research phase but from the deployment phase also.</blockquote><h4>Temporal Point Process</h4><p>A temporal point process <strong><em>T</em></strong> is a random process whose outcome is a sequence of discrete events that get revealed one after another over time t. A Point process is basically probabilistic tool used to model scatter points in some plane like Euclidean space and <strong><em>T</em></strong> is one of the types. We have discussed about point processes briefly in one of our older posts which you can checkout <a href="https://kelvinjose.medium.com/embedding-temporal-network-via-neighborhood-formation-b8496f4043f3">here</a>. T is often represented as a counting process N(t) that represents the total number of events took place till time t. <strong><em>T</em></strong>s are generally explained using a property called <em>conditional intensity function</em> λ(t) which the rate at which events occur given the history of events. This is very similar to the definition of a derivative i.e. dλ(t) = N(t + <em>dt</em>) — N(t) / <em>dt</em> where <em>dt</em> is a negligibly small delta so that only one event can occur in between the time period [t, t + <em>dt</em>). In parallel, we have something else called a survival function S(t) which represents the chances of an event not happening between the time period [tₙ, t) where t &gt; tₙ. So the conditional intensity that an event occurs at time t defined as λ(t) * S(t).</p><p>The <em>conditional intensity function</em> λ(t) is something that we use later in the DyREP modelling section.</p><h4>Proposed Method</h4><p>As discussed before, a graph’s evolution over time can be understood through the realizations of two temporal point processes, namely Association and Communication. The Association process has a more global effect since the topology of the graph changes according its realization. In comparison, Communication has a local effect and it opens a way for local transmission of information between the nodes in case of an event.</p><p>When an event occurs from either of these two processes at any given point of time <em>t</em>, it will be fully dependent on the most recent status of the graph. The current representations of the nodes will be carrying compressed information of the past interactions with other nodes and their own feature evolution over time. Since we model graph interactions as point processes, these historical information is crucial in predicting the future interactions as per <em>conditional intensity function </em>λ(t) because the probability of a future interaction or event happening at time t is conditioned on past events only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*mY_rzrvcnttBqiRp.png" /><figcaption>Figure 1, Conditional Intensity of the point process</figcaption></figure><p>The contributors are trying to model the conditional intensities of the two point processes as below,</p><p>Given an event <em>p = (u, v, t, k),</em> the conditional intensity λ(t) in other words, the probability of the event <em>p</em> taking place between nodes <em>u</em> and <em>v</em> is calculated as per below formulas 1 and 2, where <em>t</em> is the time and <em>k</em> is the type of point process i.e. Association or Communication. You can see the pictorial representation of the calculation in Figure 1 as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Mp4lDtyuNtuxwJLV.png" /></figure><p>The recent embeddings of the two nodes involved in the event <em>p</em> will be concatenated and a dot product operation will be carried out with the parameter <strong>ω</strong> to calculate the compatibility between the two. Each temporal point process is associated with a distinct parameter <strong>ω </strong>, indicating that the two processes are individually parameterized. The outer function <em>fₖ</em> is a softplus function that is primarily used to make the value of <em>gₖ</em> positive.</p><h4>Temporally Attentive Representation Network</h4><p>This part of the paper explains how node representations are updated when an event occurs. Once an event is observed, representations of both nodes involved in it have to be updated in order to capture the effect of the event globally and locally. Below is how the representations are updated,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*BIbrHk1GYPMX-X6b.png" /></figure><p><strong>Self-Propagation</strong>: A node’s evolution in the embedding space depends on its previous position or state. If the node’s embedding represents features like activity level or connectivity, its evolution in time reflects changes in these features relative to the past events. This bypasses the assumption that nodes evolve in a purely random manner. Instead there is a predictable progression based on historical events.</p><p><strong>Exogenous Drive</strong>: It refers to the changes in a node’s features driven by external factors, independent of the node’s interactions or self-propagation dynamics. These changes occur gradually during the time intervals between specific events.</p><p><strong>Localized Embedding Propagation</strong>: When two nodes take part in an event, that happens to be a pathway for information exchange from the neighbourhood of one node to the other node in the event. This implies the influence of the nodes in second-order proximity of a target node through a source node. For example, if event <em>p</em> occurs between nodes <em>u</em> and <em>v</em>, aggregated information from node <em>u</em>’s neighbourhood will be passed to <em>v</em> and vice versa. The aggregation will be regulated by an attention system which we will discuss next.</p><p>These three components work together to update the embeddings of nodes based on past interactions, external events and local neighbourhood aggregation.</p><h4>Temporally Attentive Aggregation</h4><p>During localized embedding propagation, the source node acts as if it is a bridge between its neighbours and the target node. The features of the neighbouring nodes will be aggregated with some function and passed on to the target node via the source node. But all the neighbours of the source node do not possess the same margin of importance, some might hold more importance than others and some not. To quantify the importance scores, contributors propose a weighted aggregation scheme where weights corresponding to neighbouring nodes will be calculated and their features will be scaled based on these weights right before aggregating them to a single feature vector. These weights will be dynamic since the graph is continuously evolving, both locally and globally.</p><p>The matrix <em>S(t) - </em>which is initially calculated from the adjacency matrix <em>A(t) </em>of the graph - captures the dynamic strength of relationships between nodes. It acts as a selection mechanism, allowing nodes to focus more on important neighbours while giving less importance or attention to irrelevant ones. Attention weights, <em>qᵤᵢ(t)</em> are calculated for each node u based on its neighbours using <em>S(t)</em>, evolving over time with the temporal dynamics of the graph. These weights are then used in the aggregation scheme to combine information coming from the neighbours, with <em>max -pooling</em> used to emphasize important features and capture temporal aspects effectively.</p><p>The updates to the matrix <em>S(t)</em> occurs under two conditions:</p><p><strong>(a)</strong>. interaction events between nodes with an existing edge, where attention values are modified based on the events intensity</p><p><strong>(b)</strong>. association events that form new connections, which also adjust the uniform background attention as the neighbourhood size changes.</p><p>This ensures <em>S(t)</em> reflects both structural changes and temporal interactions. Unlike static attention mechanisms, this approach incorporates temporal dynamics by parameterizing attention through <em>S(t)</em>, enabling it to adapt to evolving graph structures over time.</p><h4>Learning Procedure</h4><p>The learning algorithm tries to optimize the below loss function during back propagation through time (BPTT).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Zfid53GaD2BTYm1r.png" /></figure><p>There are two terms present in the function, one for the conditional intensities of the positive samples and another one for the survival probabilities of the negative samples. I would understand the first part as maximizing the likelihood of observing positive samples (events) by assigning assigning higher λ values to them. Meanwhile, the second part also involves a maximization process, but it increases the likelihood of observing less likely events or negative samples. Together, these two parts work in tandem to balance the overall loss function.</p><h4>Tasks and Metrics</h4><p>The effectiveness of the proposed algorithm is tested on two different tasks, namely</p><ol><li><strong><em>Dynamic Link Prediction - </em></strong>When there are multiple interaction events occur between two nodes in the graph, they are highly likely to develop a permanent relationship between them. Similarly, a new relationship could drive more interaction events between these newly connected nodes. This task checks if these assumptions hold true or not.</li><li><strong><em>Event Time Prediction - </em></strong>Here the goal is to predict the time at which a new association or interaction event could occur between a pair of nodes.</li></ol><h4>Conclusion</h4><p>The contributors aim to model the evolution of dynamic graphs and generate contextual representations for nodes using temporal point processes. Their approach assumes that graphs evolve though two distinct types of point processes, a novel approach compared to existing methods that rely on a single point process to govern graph evolution. The two processes are the Association Process, which captures topological changes in the graph, and the Communication Process which models interactions between nodes. Additionally, the algorithm incorporates a conditional intensity based attention mechanism to quantify the importance of neighbouring nodes during the aggregation process.</p><p>The evaluation section is also interesting but I am not going deep into it for now.</p><p>Okay. Thanks for spending time here. I hope you enjoyed it. Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d157c052a304" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Self-Supervised Dynamic Graph Representation Learning via Temporal Subgraph Contrast]]></title>
            <link>https://kelvinjose.medium.com/self-supervised-dynamic-graph-representation-learning-via-temporal-subgraph-contrast-6153c0bc2fa9?source=rss-47f3a41adda4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6153c0bc2fa9</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[representation-learning]]></category>
            <category><![CDATA[graph]]></category>
            <category><![CDATA[graph-machine-learning]]></category>
            <category><![CDATA[graph-theory]]></category>
            <dc:creator><![CDATA[Kelvin Jose]]></dc:creator>
            <pubDate>Tue, 10 Dec 2024 11:16:34 GMT</pubDate>
            <atom:updated>2024-12-10T11:16:34.091Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This is a review of the paper <a href="https://arxiv.org/pdf/2112.08733">Self-Supervised Dynamic Graph Representation Learning via Temporal Subgraph Contrast</a> which tries to learn node representations or embeddings using a self-supervised learning technique called Graph Contrastive Learning.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LkyOV8dB6yKHNbtCPdIi8w.png" /></figure><h4>Introduction</h4><p>Borrowing the words of the authors, “<em>Realistic graphs are often dynamic, which means the interaction between nodes occurs at a specific time</em>”. The whole idea of Temporal Graphs or more formally Continuous Time Dynamic Graphs (CTDG) is to model the dynamic evolution of graphs with respect to time. Over the last five posts in this series, we well established the importance of temporal graphs and key breakthroughs from both industry and academia. Below is the index of the previous posts for reference,</p><ol><li><a href="https://medium.com/@kelvinjose/transforming-data-the-rise-of-temporal-graphs-b0bc1d2abfc4"><em>Transforming Data: The rise of Temporal Graphs</em></a></li><li><a href="https://dl.acm.org/doi/pdf/10.1145/3184558.3191526"><em>Continuous-Time Dynamic Network Embeddings</em></a></li><li><a href="https://dl.acm.org/doi/10.1145/3219819.3220054"><em>Embedding Temporal Network via Neighborhood Formation</em></a></li><li><a href="https://arxiv.org/pdf/2210.00032"><em>Direct Embedding of Temporal Network Edges via Time-Decayed Line Graphs</em></a></li><li><a href="https://kelvinjose.medium.com/representation-learning-in-continuous-time-dynamic-signed-networks-72f1adceff3b"><em>Representation Learning in Continuous-Time Dynamic Signed Networks</em></a></li></ol><p>The framework proposed by the authors is trying to model the dynamic nature of the temporal graph by sampling a subgraph of size <em>k</em> around each node in the given graph and thereby contrasting between positive and negative features generated from the subgraph for both the central node as well as the subgraph. The primary goals of this self-supervised technique is to maximise the mutual information within the positive pair of node and subgraph features and at the same time minimising the information within the negative pair. Also the features should be responsible to capture not only the temporal information in the graph (which is the desired) but also the structural properties along with time. To cater these requirements, a sampling technique that respects both the temporal and structural attributes of a graph, representation techniques for both nodes and subgraphs and a new contrastive loss function that helps to optimise the objective in hand are the key contributions introduced in this paper. We will go into each of these contributions in detail in the later sections.</p><h4>Self-Supervised Learning in Language &amp; Graph</h4><p>In my personal opinion, self-supervised learning got its glory since the advent of language modelling where we wanted to learn meaningful high-dimensional representations for the words in a pre-defined vocabulary which then allowed us to carry out a lot of downstream tasks such as text classification, clustering, summarization etc. In comparison with supervised learning where we explicitly label each data point in the train and test datasets, the supervision signals or labels in self-supervised setting will come from the data itself. In language modelling, given a context window of text, the model is equipped to predict the next word which is the label that comes organically with free text i.e. given any context window, the next word will be its corresponding label.</p><p>Similar to the achievements in the language domain, self-supervised learning has made waves in graph research as well. It leverages the inherent structure and attributes of graph to generate supervisory signals without the need of explicit labels. Self-supervised approaches enable us to learn rich and high-dimensional representations by designing pretext tasks such as predicting missing edges and node attributes. This is valuable for graphs because they almost exist with sparse labels but abundant relational information. Such representations we learn can then be used for many downstream tasks such node classification, link prediction and graph classification.</p><h4>Framework</h4><p>The proposed <strong>DySubC</strong> (<strong>Dy</strong>namic graph representation via temporal <strong>Sub</strong>graph <strong>C</strong>ontrast) — <em>fancy name, huh?</em> — uses contrastive learning that captures the temporal and structural features from temporal graphs during the training phase without additional supervision.</p><blockquote><em>Temporal Graph: Given a graph G: (V, Eₜ, X) where V is the set of vertices, Eₜ ⊆ V × V × ℝ⁺ is the set of edges with timestamp t and X is node features.</em></blockquote><p>The complete framework is divided into three components as,</p><ol><li><strong><em>Temporal subgraph sampling</em></strong>: For each node in G, a temporal subgraph <em>Gᵢ = (Aᵢ, Xᵢ)</em> will be sampled that preserves the temporal and structural information and its counterpart <em>Gᵢ` = (Aᵢ`, Xᵢ`) </em>which does not have time information preserved. I was just wondering what will happen when <em>Gᵢ = Gᵢ` — this is not impossible because a lot of interactions can happen at the same time, so in this case the two graphs will look identical even if we omit the time information.</em></li><li><strong><em>Node and subgraph representations</em></strong>: Given <em>Gᵢ and Gᵢ`, </em>we will generate embedding representations for both nodes and each subgraph using GCNs.</li><li><strong><em>Temporal contrastive learning</em></strong>: Once node and subgraph representations are formed, we will formulate positive and negative training samples and try to optimise the graph contrastive objective function.</li></ol><h4>Temporal Subgraph Sampling</h4><p>This step is used to generate subgraphs of size <em>k</em> and subsequent training samples starting from each node in the graph <em>G</em>. The sampling process begins by preprocessing the graph to obtain both time-weighted and unweighted adjacency matrices. For each node, the algorithm initialises a queue and a sampling pool, then iteratively expands the candidate set of neighborhood nodes. If the number of nodes in the candidate set is insufficient to meet the required subgraph size <em>k</em>, all nodes are added to the queue and then to the pool. However, if the number of candidates exceeds <em>k</em>, the algorithm evaluates the importance of each node and selects the most significant ones based on a calculated <em>importance score</em>. This score is calculated based on both temporal and structural attributes of the nodes. This makes sure that the sampled subgraph not only respects the node connectivity but also reflects the temporal dynamics of the graph. The output consists of a time-weighted subgraph and its unweighted counter part.</p><p>The importance score is a combination of two things, <em>structural importance score</em> and <em>temporal importance score. </em>The structural importance score is simply the degree of a node <em>j</em> and the temporal importance score is a normalized largest timestamp connected to the node <em>j</em>. So the total importance score will be a weighted sum of these two components.</p><p>Once <em>k</em> nodes are sampled, the time-weighted subgraph <em>Gᵢ </em>and unweighted subgraph <em>Gᵢ` </em>are obtained referring to the original graph <em>G </em>represented by adjacency matrix <em>Aᵢ </em>and<em> Aᵢ` </em>respectively<em>. </em>The feature matrix <em>Xᵢ</em> is formed by simply taking out the <em>iᵗʰ</em> row in the full feature matrix <em>X</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*sfPQNysrafQDEtRn.png" /><figcaption>Overview of <strong>DySubC </strong>framework</figcaption></figure><h4>Node and Subgraph Representation</h4><p>Once we have <em>Gᵢ = (Aᵢ, Xᵢ) </em>and<em> Gᵢ` = (Aᵢ`, Xᵢ`), </em>the next step is to use two separate encoders (GCNs) to output their representations <em>Hᵢ</em> and <em>Hᵢ` </em>respectively.</p><p>When GCNs are used, they process the graph as a whole and you get embeddings corresponding to each and every node in the graph (in our case a subgraph). Our current goal is to retrieve the embedding corresponding to our central node <em>i</em> and it is done using a process named <em>picking out</em> as per the above figure. It is as simple as taking the <em>iᵗʰ </em>row out of the learned embeddings matrix.</p><p>The next step is to form representations for both time-weighted and unweighted subgraphs. This is also a straightforward thing, for time-weighted subgraph we take the weighted average of the nodes in the subgraph where the importance scores act as the weighting factor. In contrast with the time-weighted subgraph, the embedding generation of unweighted subgraph is plain averaging of the node embeddings in it. The weighted averaging for time-weighted subgraph and normal averaging for unweighted subgraph are called <em>readout 1</em> and <em>readout 2</em> respectively as per the above figure.</p><h4>Temporal Contrastive Learning</h4><p>Now our goal is to formulate positive and negative samples and loss functions to facilitate contrastive learning. The representations of our time-weighted subgraph (output of the operation <em>readout 1</em>) and the central node <em>i</em> (output of the <em>pick out</em> operation) will form the only positive example for contrastive learning. But there will be two negative samples per training example which are formed this way — the first negative sample will be a pair of the representations of the unweighted subgraph (output of operation <em>readout 2</em>) and the central node <em>i</em>. This will act as a temporal negative sample with the purpose to make the central node <em>i</em>’s representation closer to the time-weighted subgraph representation and farther away from the unweighted subgraph representation. The second negative sample is generated by randomly picking a time-weighted subgraph from a set of shuffled representations which will be paired with the same representation of the central node <em>i</em>.</p><p>In short, one training example consists of three different pieces,</p><ol><li>A positive pair with the representations of time-weighted subgraph and the central node <em>i</em>.</li><li>A negative pair with the representations of unweighted subgraph and the central node <em>i</em>.</li><li>Another negative pair with the representations of a random time-weighted subgraph and the central node <em>i</em>.</li></ol><p>Authors chose two sigmoid based margin loss functions — one for structural sample and another one for temporal sample. The two losses are then weighted averaged to get the final loss value which will then be propagated back to the parameters of the network.</p><h4>Experimental Results</h4><p>The experimental results in the paper highlight the impressive capabilities of the DySubC framework in dynamic graph representation learning. The authors conduct extensive tests on five real-world datasets, focusing on link predictions tasks to evaluate the proposed framework’s performance. The results clearly indicate that DySubC outperforms several baseline models, which include both traditional graph contrastive learnign models and contemporary dynamic graph representation models. This success can be attributed to the framework’s ability to effectively integrate temporal information allowing it to sample more relevant subgraphs that reflect the true nature of node interactions over time.</p><p>Furthermore, the authors perform an ablation study to dissect the contributions of various components within the DySubC framework. This analysis reveals that each element plays a vital role in enhancing model performance. Specifically, the study demonstrated how different time-aware modules contribute to capturing the structural evolution of graphs, emphasising that frequent changes in node’s neighborhood can indicate shifts in its relationships.</p><h3>Conclusion</h3><p>This paper introduced a contrastive learning based approach named <strong>Dy</strong>namic graph representation via temporal <strong>Sub</strong>graph <strong>C</strong>ontrast (<strong>DySubC</strong>) to learn node embeddings from temporal graphs. This is done by sampling temporal subgraphs centered on each node individually and contrasting between the positive and negative samples generated from them during the training phase. The model learns the representations with both structural and temporal information by maximizing the mutual information of the node representation and its temporal subgraph representation. The proposed model is compared against a bunch of baseline models based on link prediction task where it performs well in almost all cases but there is no further information provided regarding other downstream tasks such as node classification, graph classification, clustering etc. I would say the two prime ideas of this paper are temporal subgraph sampling and contrastive learning in graphs which are well explained.</p><p>This was also a good read and it would not take much time to comprehend the core concepts mentioned in the paper.</p><p>Thanks for spending some time here, have a good one!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6153c0bc2fa9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Representation Learning in Continuous-Time Dynamic Signed Networks]]></title>
            <link>https://kelvinjose.medium.com/representation-learning-in-continuous-time-dynamic-signed-networks-72f1adceff3b?source=rss-47f3a41adda4------2</link>
            <guid isPermaLink="false">https://medium.com/p/72f1adceff3b</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[graph-theory]]></category>
            <category><![CDATA[temporal-graph]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[graph-machine-learning]]></category>
            <dc:creator><![CDATA[Kelvin Jose]]></dc:creator>
            <pubDate>Mon, 25 Nov 2024 18:15:26 GMT</pubDate>
            <atom:updated>2024-11-25T18:15:26.493Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This is a review of the paper <a href="https://arxiv.org/pdf/2207.03408">Representation Learning in Continuous-Time Dynamic Signed Networks</a> which proposes a new architecture named SEMBA to capture the dynamics of evolving singed networks.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZHIfWOn_abu5wVTmpw41rQ.png" /></figure><h4>Introduction</h4><p>We have been actively discussing about <em>continous-time dynamic networks</em> or in other words <em>temporal graphs</em> for sometime now and this is the 5th installment in this series.</p><ol><li><a href="https://medium.com/@kelvinjose/transforming-data-the-rise-of-temporal-graphs-b0bc1d2abfc4">Transforming Data: The rise of Temporal Graphs</a></li><li><a href="https://dl.acm.org/doi/pdf/10.1145/3184558.3191526">Continuous-Time Dynamic Network Embeddings</a></li><li><a href="https://dl.acm.org/doi/10.1145/3219819.3220054">Embedding Temporal Network via Neighborhood Formation</a></li><li><a href="https://arxiv.org/pdf/2210.00032">Direct Embedding of Temporal Network Edges via Time-Decayed Line Graphs</a></li></ol><p>In all of the above posts, we saw how useful and effective are temporal graphs in modeling information that evolve in time, be it social interactions, online purchases, web activities etc. In contrast with a static graph, it keeps track of timestamps of interactions that occur in its context to account the temporal evolution of nodes and edges in it. There are many ways in which a graph can evolve - new nodes may join or leave the graph, edges appear or disappear between nodes and features of nodes and edges can be updated over time. Along with some of the attributes of a temporal graph, this study focuses on a property called a <em>sign </em>which denotes friendly or conflicting relationships that occur in a graph among different nodes or entities. In a signed network <em>(more on this below)</em>, each edge will be annotated with a sign, either <em>positive (+)</em> or <em>negative (+)</em> based on the characters of the nodes present in both ends of the edge.</p><p>Authors propose a new <a href="https://arxiv.org/pdf/2006.10637"><em>Temporal Graph Network</em></a> (TGN) based approach to model dynamic signed networks, named <strong>SEMBA</strong>. The core idea is to use the sign information in association with <em>balance theory</em> to form messages as seen in TGN which are then aggregated and stored in an intermediate memory location corresponding to each node. This memory will later be used to generate temporal and sign aware representations of the nodes.</p><h4>Signed Networks</h4><p>Signed Networks are primarily designed to capture the evolution of polarization in social platforms because the relationships between the users often reflect a mixture of positive and negative interactions (<a href="https://cs.stanford.edu/people/jure/pubs/triads-chi10.pdf"><strong>Jure Leskovec et. al</strong></a><strong>.</strong>). Each node in the graph represents a user or an entity and edges connecting them are assigned either “+” or “-” sign to indicate the nature of their relationship. Positive edges typically signify cooperation, agreement or trust, while negative edges denote conflict, disagreement or distrust. This dual nature allows signed networks to model complex social dynamics more realistically than other networks which assume all interactions are neutral.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KQFB1QiaHfIuj8R-6pYOnQ.png" /><figcaption>Figure 1, Example of a signed network</figcaption></figure><p>In social networks, signed edges can reveal patterns of cooperation and conflicts within communities. Positive edges often cluster within groups, reflecting tight social bonds and negative edges occur more frequently between groups than within groups, indicating disagreements. In the above figure (Figure 1), there are two edges between nodes <em>V₂ - V₃</em> and <em>V₂ - V₄</em>, whereas all other interactions are positive. It is important to note that the meanings of positive and negative signed edges are different across settings but the core concepts stay the same.</p><h4>Balance Theory</h4><p>Structural balance theory is a theoretical concept that originated in social psychology in the mid 20th century. It considers the possible ways in which triangles on three individuals can be signed and posits that triangles with three positive signs (three mutual friends) and those with one positive sign (one common enemy) are more plausible and should be seen frequently in real networks than triangles with two positive signs (two enemies with a common friend) or none (three mutual enemies).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*ExEIbbZggmEyhumfLrkQ5Q.png" /><figcaption>Figure 2, Balanced and unbalanced triads.</figcaption></figure><p>Balanced triangles with three positive edges (first triad in Figure 2) amplify the principle that “<em>the friend of my friend is my friend</em>” where as those with one positive and two negative edges (second triad in Figure 2) capture the notions that “<em>the enemy of my friend is my enemy</em>” and “<em>enemy of my enemy is my friend</em>”.</p><h4>SEMBA - The Algorithm &amp; The Approach</h4><p>The authors call the proposed algorithm which learns the representations of nodes present in a signed network - <strong><em>Signed Links Evolution using Memory modules and Balanced Aggregations</em></strong> or in short <strong><em>SEMBA</em></strong>. The algorithm learns two representations per node: positive and negative memories to encode temporal signed interactions and node embeddings to incorporate interactions with its long - term neighbors. And the authors try to test the effectiveness of the learned representation through various tasks such as</p><ol><li>Dynamic Link Existence Prediction: The goal is to predict whether a link exists between nodes <em>u</em> and <em>v</em> in the future.</li><li>Dynamic Link Sign Prediction: Tries to predict the sign of the link.</li><li>Dynamic Signed Link Existence Prediction: The goal is to predict whether a positive, negative or link exists between nodes <em>u</em> and <em>v</em> in the future.</li><li>Dynamic Signed Link Weight Prediction: The goal is to predict the link weight between nodes <em>u</em> and <em>v</em>.</li></ol><p>As per the authors, SEMBA is motivated by three key observations,</p><ol><li>Links Evolution: In an evolving network, new links are added based on the past interactions of a particular node at any given period of time.</li><li>Structural Balance: Based on balance theory, the future link between nodes <em>u</em> and <em>v</em> and their representations are solely depended on information coming from either a friend of a friend or an enemy of a friend.</li><li>Long-tailed distribution: Nodes of a real network follow a <a href="http://www.network-science.org/powerlaw_scalefree_node_degree_distribution.html">power - law distribution</a> i.e. only few nodes possess high degree.</li></ol><p>Following these three observations, the authors introduce three major components to the architecture and they are,</p><p><strong><em>Signed Memories </em></strong>: This means each node will have two individual memories to save the past positive and negative interactions which can later be used to predict future links.</p><p><strong><em>Balanced Aggregation </em></strong>: When a new signed link <em>(u, v)</em> is added, one of the below two things can happen,</p><ol><li>if the sign of the link is positive, memories of the same polarity influence each other. In other words, positive memory of the node <em>u</em> will be updated using the positive memory of node <em>v</em>.</li><li>if the sign is negative, memories of opposite polarity provide influence. That is the positive memory of the node <em>u</em> is updated using the negative memory of <em>v</em> and <em>u</em>’s negative memory is updated using <em>v</em>’s positive memory.</li></ol><p><strong><em>Long term Propagation </em></strong>: To generate embeddings for a node, author decided to aggregate the neighbors of it in the past which eventually solves the staleness problem through propagating information from neighbors over all time steps.</p><h4><strong>Model Pipeline</strong></h4><p>The whole SEMBA pipeline is arranged into 4 steps and they are,</p><ol><li>Event encoding as signed messages based on balance theory</li><li>Signed messages aggregation</li><li>Node memory updation using aggregated messages</li><li>Embedding generation</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NpeT9UvAAMq25VmkQcS5Ow.png" /><figcaption>SEMBA model pipeline</figcaption></figure><p><strong><em>Message Generator</em> : </strong>Given an interaction <em>(u, v)</em>, signed messages of node <em>u</em> and <em>v</em> will be generated based on balance theory such that <em>u</em>’s information will be passed on to <em>v</em> and vice versa. Specifically, when the sign is positive, information in the positive memory of the node <em>u</em> will be used by the positive memory of the node <em>v</em>. In a similar fashion, negative information will also be shared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*jKzFVEAClQfStzVjvyMlAA.png" /><figcaption>Message calculation</figcaption></figure><p>The above two equations demonstrate how messages are generated by passing information from node <em>v</em> to <em>u</em>, where</p><ul><li><strong><em>Sᵤ⁺</em></strong> and <strong><em>Sᵤ⁻</em></strong> are positive and negative memories of <em>u</em> respectively and <strong><em>Sᵥ⁻</em></strong> and <strong><em>Sᵥ⁺</em></strong> are positive and negative memories of <em>v, </em>similarly.</li><li><strong>⊕</strong> is the concatenation operator which merges the information of two nodes together.</li><li><strong><em>t - Δtᵤ</em></strong> is an operation used to quantify the last time node <em>u</em> was updated.</li><li><strong><em>|eᵤᵥ(t)|</em></strong> denotes the edge weight.</li><li><strong><em>msg</em></strong> is a multi-layer perceptron (MLP)</li></ul><p><strong><em>Message Aggregation</em> : </strong>There can be multiple messages formed per node when there are many interactions present in the current batch corresponding to a same node. So it is adequate to aggregate these positive and negative messages into single positive and negative messages respectively. The aggregation function can be any one of the mean aggregator, LSTM or a function that returns the most recent message out of a set of messages. The authors chose to go with the last one of all the options and have reported that they did not observe any significant differences in the results.</p><p><strong><em>Memory Update</em> : </strong>Once the aggregated messages are calculated, the next step is to update the positive and negative memories of a node. To do so, authors simply pass the newly aggregated message and the old memory representation of a node through an LSTM layer. This will result in a updated memory using both the older and newer information.</p><p><strong><em>Embedding Generation</em></strong>: The last step in the model pipeline is to generate the actual embedding corresponding to a node <em>u</em>, for this, the memory of the node <em>u</em> will be jointly used with all its neighbors across timestamps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*O8w4_2VHlyvSmHCMB-aOSg.png" /><figcaption>Embedding generation</figcaption></figure><ul><li>Here <em>Sᵤ</em> is a message that is created by concatenating the positive and negative updated memories of node <em>u</em>.</li><li>Updated memories of neighbors of node <em>u</em> of all timestamps will be weighted and averaged.</li><li>The updated memory of a node and its neighbors help in generating the temporal sign aware embedding which can be used for downstream tasks.</li></ul><h4>Evaluation</h4><p>We will first take a step back to discuss the different metrics used in the evaluation procedure for each task in hand. For binary classification tasks such as <em>Dynamic Link Sign Prediction</em> and <em>Dynamic Link Existence Prediction</em>, the metrics used are F1 score and AUROC (Area Under Receiver Operating Characteristic). F1 is mainly used by the virtue of class imbalances present in the train and evaluation data. For <em>Dynamic Link Signed Weight Prediction</em> which is a regression task, RMSE, R² and KL Divergence are used to quantify the performance.</p><p>In <em>Dynamic Link Existence Prediction</em>, the proposed SEMBA works on par with the state-of-the-art TGN model with a maximum difference of 0.01 in the F1 and AUROC metrics. The model outperforms all the baseline models across all the datasets with substantial margins. This task predict the sign of a future link t i.e. whether it is positive or negative. The authors combine these two tasks into one single multi-class classification task called <em>Dynamic Signed Link Existence Prediction</em> where the objective is to predict whether a link exists between two nodes in the future and if it exists, predict its sign. Authors observe that SEMBA outperforms or matches the baselines across all the datasets. The last task<em>, Dynamic Link Signed Weight Prediction</em> i.e. predicting the signed weights of links at t given the graph until the previous batch. Again, authors report that SEMBA either outperforms or matches the baselines.</p><h4>Conclusion</h4><p>The core idea of this research was to learn the dynamics of a signed network’s evolution using a GNN based model with some components shared with the very famous TGN architecture. Balance theory makes sure how information is shared among nodes when a new link is created by formulating it in the form of a balanced triad. The research did not mention anything substantial about graph events anything other than edge addition but I hope the authors may be explore them in the future versions.</p><p>It was fun reading this and I think having some understanding about the TGN architecture helped a lot.</p><p>Thanks for spending some time here.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72f1adceff3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Direct Embedding of Temporal Network Edges via Time-Decayed Line Graphs]]></title>
            <link>https://kelvinjose.medium.com/direct-embedding-of-temporal-network-edges-via-time-decayed-line-graphs-ec33055d3076?source=rss-47f3a41adda4------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec33055d3076</guid>
            <category><![CDATA[temporal-network]]></category>
            <category><![CDATA[network]]></category>
            <category><![CDATA[graph-learning]]></category>
            <category><![CDATA[graph-theory]]></category>
            <dc:creator><![CDATA[Kelvin Jose]]></dc:creator>
            <pubDate>Wed, 06 Nov 2024 18:20:52 GMT</pubDate>
            <atom:updated>2024-12-09T05:56:57.346Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This is a review of the paper titled <a href="https://arxiv.org/pdf/2210.00032">Direct Embedding of Temporal Network Edges via Time-Decayed Line Graphs</a> which uses a novel technique called Time-Decayed Line Graph (TDLG) to effectively capture temporal information into both edges and nodes.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pDhLP_GODPO9V22_yjmN1A.png" /></figure><h4>Introduction</h4><p>Temporal graph is a special kind of graphs that comes with an extra piece of information i.e. time of interactions between the entities a.k.a. nodes in a graph. Conventionally, when an event or an interaction takes place, an edge between a pair of nodes is added to the graph but it does not save the time of event rather discards that information forever. If we follow this paradigm, the order of events over time gets lost which may result in sub - optimal performance in subsequent graph based tasks such as classification and prediction. The modelling techniques in use are primarily focused on nodes and their embeddings where as the authors of this paper propose a simple solution that can learn embeddings corresponding to edges over nodes.</p><p>Edge representations can be derived indirectly from node emebeddings by aggregating them, for example if we want to get the embedding of an edge that connects nodes <em>a</em> and <em>b</em>, we can aggregate the embeddings corresponding to those two nodes (assuming the node embeddings are already learned using <a href="https://snap.stanford.edu/node2vec/">Node2Vec</a>, <a href="https://dl.acm.org/doi/fullHtml/10.1145/3184558.3191526">CTDNE</a> or any other similar methods) by some aggregation function such as addition, average or even element-wise product. But the quality of edges represented this way is questionable and may lead to not-so-good semantic descriptions. Given that timestamps are associated with edges rather than nodes, the authors claim that it is intuitively a good idea to learn representations and use them for different down-stream tasks.</p><blockquote>If you are strongly interested about temporal networks and embedding generation by neighborhood formation, consider reading <a href="https://medium.com/@kelvinjose/embedding-temporal-network-via-neighborhood-formation-b8496f4043f3">this</a>.</blockquote><h4>Framework</h4><p>Authors construct a <em>line graph</em> of the network which converts each edge of the network into a node and connects interactions that share an endpoint node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*sxduQC8Ui2xawc4WKFYTcg.png" /><figcaption>Converting a temporal graph into its equivalent line graph</figcaption></figure><p>Here in the above image, there are 3 nodes namely <em>a</em>, <em>b</em> and <em>c</em>. Edge <em>e₁</em> connects nodes <em>a</em> and <em>b</em> and edge <em>e₂</em> connects node <em>b</em> and <em>c</em>. Edges <em>e₁</em> and <em>e₂</em> will be converted to nodes in the resulting line graph and an edge between them will be formed. The edge in the line graph is valid because the two edges in the temporal graph share a common end point i.e. node <em>b</em>. The <em>weight</em> of the edge in the line graph will be calculated based on differences in time between interactions - here <em>t₁</em> and <em>t₂</em>. The interactions that occur closer in time will have higher edge weights whereas interactions far from each other will have lower edge weights.</p><p>The newly created line graph well describes <em>topological proximity</em> i.e. those edges that are topologically closer in the temporal graph will still be represented in its corresponding line graph without loosing any proximity information. <em>Temporal proximity</em> is also captured with the help of edge weights where recent interactions will have higher weights in comparison with older events. Temporal embeddings are calculated from this derived line graph instead of using the original temporal graph.</p><h4>Time-Decayed Line Graph</h4><p>We will first touch base on what a temporal graph is in terms of the authors,</p><blockquote>A temporal graph <em>G = (V, E)</em> is a set of vertices V and a set of temporal edges E, where <em>E ⊆ V × V × ℝ</em>, t is the time of the temporal edge (u, v, t).</blockquote><p>Given a temporal graph G, the authors first convert it into a line graph. The line graph of an undirected, unweighted graph is another undirected, unweighted graph that represents the adjancencies between edges in the original graph. The time information is incorporated to the line graph by taking time of interactions in the temporal graph into account. The resulting Time-Decayed Line Graph (TDLG) is defined as,</p><blockquote>Given a temporal graph G = (V, E), the associated time decayed line graph is LTD(G) = (Vₗ, Eₗ, w) where Vₗ = E, Eₗ = {((u, v, t₁), (v, z, t₂)): (u, v, t₁), (v, z, t₂) ∈ E}, and the edge weight function w: Eₗ → ℝ⁺ evaluated on edge ((u, v, t₁), (v, z, t₂)) is given by exp[(-1 / (2 σ² t)) * (t₁ - t₂)²] for σₜ &gt; 0.</blockquote><p>The parameter <em>σₜ</em> in the above definition controls the decay of edge weights over time.</p><p>Assume that we have a graph with <em>n</em> nodes and <em>m</em> edges and its incidence matrix <em>B ∈ {0, 1}ⁿ ˣ ᵐ</em> where each column of <em>B</em> is an <em>n</em> dimensional vector that corresponds to an edge in the graph and is 1 for the edge’s two node end points and 0 elsewhere. The adjacency matrix <em>A ∈ ℝᵐ ˣ ᵐ</em> of the corresponding line graph can be calculated as,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*XgXALBCxCpMvzSgYGdipPw.png" /><figcaption>Adjacency matrix of the line graph</figcaption></figure><p>where <em>bᵢ </em>and <em>bⱼ</em> are two edges or columns in matrix <em>B</em>. This adjacency matrix <em>A</em> can be understood in two ways,</p><ol><li><em>A</em> is the edge adjacency matrix of the original temporal graph <em>G</em></li><li><em>A</em> is the node adjacency matrix of the corresponding line graph of <em>G</em></li></ol><p>The operation <em>bᵢᵀ bⱼ</em> in the above equation is indeed interesting, when <em>bᵢ</em> and <em>bⱼ</em> do not share any common end points (nodes), the result will be <em>0</em> and<em> 1</em> or <em>2</em> if the two edges have at-least one end point in common.</p><p>For downstream tasks such as link prediction and classification, we will need temporal edge embeddings which are real-valued vectors for each edge which can be then fed into a different model say a logistic regression model. For temporal edge <em>i</em>, we will just have to retrieve either the <em>iᵗʰ</em> row or column of the adjacency matrix <em>A</em>. Both the row and column will work because matrix <em>A</em> is symmetric in nature. This will return an m dimensional vector which will mostly be sparse. Authors say we can try a dimensionality reduction technique such as eigen-decomposition to reduce the dimensions and but this is something not necessarily be done because the sparse vectors themselves show some real representational power.</p><h4>Temporal Stochastic Block Model</h4><p>To demonstrate the representational power of the latent structures in the graphs, authors propose a model based on <a href="https://en.wikipedia.org/wiki/Stochastic_block_model">Stochastic Block Model</a> (SBM). We will take a pause here and discuss what SBMs are and why they are important.</p><p>Stochastic Block Model is a generative model for random graphs, commonly used to identify and model community structures within networks. An SBM partitions nodes into different groups or blocks and assigns edges between nodes with probabilities that depend on the groups to which the nodes belong. In an SBM, the setup begins by assigning nodes to different groups or communities, where each node <em>i</em> is assigned to a group <em>zᵢ</em> chosen from a set of <em>K</em> possible communities. This assignment is often based on a probability distribution that specifies the likelihood of a node belonging to each community. Once groups are assigned, edges between nodes are created according to an edge probability matrix <em>P</em> of size <em>K x K</em>. This matrix defines the probability <em>Pab</em> of an edge forming between nodes in groups <em>a</em> and <em>b</em>. For instance, if the values on the diagonal of <em>P</em> are high relative to the off-diagonal values, it indicates that nodes more likely to connect with others in their own group than with nodes from other groups, thus creating a strong community structure. Conversely, more uniform values in <em>P</em> would suggest a lack of distinct community structure, resembling a more random graph.</p><p>Authors introduce a slightly modified version of the SBM called temporal SBM (TSBM) which comprises the union of several SBMs. TSBMs are officially defined as,</p><blockquote>Consider a set of n nodes partitioned into two equal-sized communities {U, V}. For some integer ∆ &gt; 0 and real numbers 0 &lt; α₁, α₂ &lt; 1, construct a random temporal edge set over this graph as follows: Let there be (∆·n) / 2 temporal edges in each of two time periods; the times associated with edges in each time period are drawn from the normal distributions N(μ₁, σ₁²) and N(μ₂, σ₂²), respectively. Of the edges in time period 1, let (1 − α₁) · (∆·n / 2) edges be drawn uniformly at random from U × V , and let the remaining α₁ · (∆·n) / 2 edges be drawn half each from U × U and V × V. Similarly, of the edges in time period 2, let (1 − α₂) · ∆·n / 2 edges be drawn<br>from U × V , and the remaining α₂ · (∆·n / 2) edges be drawn half each from U × U and V × V.</blockquote><p>This model defines a method for generating a random temporal graph with two communities of nodes, each with specific connectivity patterns over time. In this setup, we have n nodes divided equally into two communities, denoted as <em>U</em> and <em>V</em>. The temporal graph evolves over two distinct time periods, with each period containing a fixed number of <em>(∆·n) / 2</em> temporal edges. The times of these edges are drawn from two separate normal distributions, with timestamps in the first time period following <em>N(μ₁, σ₁²) </em>and in the second time period following <em>N(μ₂, σ₂²).</em></p><p>During each time period, the edges are assigned according to pre-defined community interaction patterns controlled by parameters <em>α₁</em> and <em>α₂</em>. In the first time period, a portion <em>(1 — α₁) · (∆·n) / 2 </em>of edges is placed between nodes in different communities, connecting nodes in <em>U</em> to nodes in <em>V</em> randomly. The remaining <em>α₁ · (∆·n) / 2</em> edges are assigned within communities, split evenly between connections within <em>U</em> and within <em>V</em>. A similar assignment process occurs in the second time period, with <em>α₂</em> controlling the ratio of within and between-community edges. This temporal SBM model thus enables structured temporal network generation by specifying edge counts, temporal distributions, and proportions of community-based interactions over time.</p><p>Authors construct a TSBM based on the above technique where it is not possible to distinguish any community structure unless time is considered. As per the definition, each SBM will be formed on the basis of the two distinct distributions for edge times and the corresponding edges with times sampled from these distributions will be called ‘<em>early edges</em>’ and ‘<em>later edges</em>’ respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gfLlTLeVQoOxdCAVyySJjQ.png" /><figcaption>o Early and late SBMs</figcaption></figure><p>The first three figures are of adjacency matrices of an early SBM, late SBM and a combination or union of both. If we look at the first matrix of the three, we will notice how dense and sparse the connections are with in -communities U and V (intra-community relation) and inter - communities. Whereas in the late SBM, we see more dense connections with inter-communities in comparison with in individual communities. We will see some sort community structures in the first two figures but not at all in the third figure which is a union of the two SBMs.</p><p>Authors are trying to prove that it is still possible to recover the community structures from the union of SBMs if temporal information can be considered. In order to do so, we need the embeddings corresponding to each node in the graph but we only have edge embeddings available. Since the proposed time-decayed line graph method only produces temporal edge embeddings, we must aggregate them into node embeddings. Here is how it works, for each node, get the mean of the embeddings of all edges incident on that node - simple as that!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*kudDmfapTSa-L1yXL3xB4g.png" /><figcaption>Efficiency of the proposed TSMB method</figcaption></figure><p>The first two figures are the adjacency representations of the raw line graph in consideration and its corresponding time decayed graph, respectively. The visualizations in third and fourth figures show that the proposed method succeeded in recovering edge types and node types using both edge and derived node embeddings. The edge embeddings are roughly grouped into 6 categories, each for <em>U</em> and <em>V</em> communities alone and one for <em>U - V</em> (inter - community edges) and these three types will be present in both early and later times (which add up to 6 edge types). Also, the node embeddings are now linearly separated to two communities i.e. <em>U</em> and <em>V</em> successfully. This result highlights that preserving temporal information in graphs allows for the recovery of community structures that might otherwise be lost.</p><h4>Conclusion</h4><p>The novel idea of this paper is a framework called Time-Decayed Line Graph (TDLG) which is a non-deep way of representing edges in a semantic space and thereby deriving node features from them. Two things authors emphasize are how effectively the proposed framework is able to capture both temporal and topological proximities in a graph. To show its full effectiveness, an SBM based approach is also illustrated.</p><p>The directions of future work mentioned in the paper is increasing this technique’s scalability via reduction of the number of features. The TDLG method return m features (sparse in most cases) per temporal edge based on proximities to all other temporal edges.</p><p>Anyway that is all about this one. It was a good read, indeed. I hope you also enjoyed reading the post. Have a good one.</p><p>Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec33055d3076" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Embedding Temporal Network via Neighborhood Formation]]></title>
            <link>https://kelvinjose.medium.com/embedding-temporal-network-via-neighborhood-formation-b8496f4043f3?source=rss-47f3a41adda4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8496f4043f3</guid>
            <category><![CDATA[representation-learning]]></category>
            <category><![CDATA[network]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[temporal-network]]></category>
            <category><![CDATA[graph]]></category>
            <dc:creator><![CDATA[Kelvin Jose]]></dc:creator>
            <pubDate>Mon, 28 Oct 2024 12:53:06 GMT</pubDate>
            <atom:updated>2025-01-04T17:11:49.596Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This is a review of the paper <a href="https://dl.acm.org/doi/10.1145/3219819.3220054">Embedding Temporal Network via Neighborhood Formation</a> which uses Hawkess Process to model the dynamics of a temporal network. It was first presented in <a href="https://dl.acm.org/doi/proceedings/10.1145/3219819">24th ACM SIGKDD International Conference on Knowledge Discovery &amp; Data Mining</a>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gJ5N8jLulcuiwYevSUqRpA.png" /></figure><h4><strong>Introduction</strong></h4><p>In previous posts, we discussed a lot about how temporal networks aka <a href="https://medium.com/@kelvinjose/transforming-data-the-rise-of-temporal-graphs-b0bc1d2abfc4">dynamic networks evolved</a> and an <a href="https://medium.com/@kelvinjose/continuous-time-dynamic-network-embeddings-4d3dd0ac9aaa">early attempt</a> to model the dynamic nature of those networks. They continuously evolve as nodes and edges are added or removed over time making them highly dynamic and somewhat difficult to model. Here we discuss an another effort from a group of researchers to account the dynamic nature of these networks with the help of a <a href="https://en.wikipedia.org/wiki/Point_process">Point Process</a> model called <a href="http://www.stat.ucla.edu/~frederic/papers/encycpiece">Hawkess Process</a>.</p><p>The authors define the problem of embedding temporal networks as a neighborhood sequence formation process, which involves representing nodes and their relationships in a continuous vector space while preserving temporal dynamics . The core idea of the paper is to form temporal neighborhoods based on temporal interactions. This means that the embedding process considers not just static relationships but also how these relationships evolve over time. The authors introduce the concept of temporal windows to capture interactions within specific time frames, allowing them to focus on recent or relevant interactions. The methodology includes defining an object function that quantifies how well the embeddings represent the neighborhood structures. The authors use gradient based optimization techniques to learn the embeddings based on the defined objective, ensuring that nodes that interact frequently are closer in the embedding space.</p><h4><strong>Neighborhood Formation Sequence</strong></h4><p>Authors say that traditional temporal networks attempt to capture the dynamic network structures based on pre-defined time windows like we seen in Discrete Time Dynamic Networks or DTDG in short. They are like snapshots of an evolving graph taken at fixed time intervals, say every 30 minutes. But this approach suffers from information loss and is not useful if we want to model the absolute dynamics of the network. What the authors propose is a new approach that unravels the full interaction history of a node with its neighbors back in time to track the complete network formation process. Authors define a temporal network as a triplet</p><blockquote>G = &lt;V;E;A&gt; where V is the set of nodes, E is the set of edges and A is the set of events. Each edge (x, y)∈E between nodes x and y is annotated by ordered events i.e. aₓᵧ = { a₁ → a₂ → … } where aᵢ is an event with timestamp tᵢ.</blockquote><p>There can be several interactions between nodes x and y given a time period and they can be ordered based on the timestamp at which each event took place.</p><p>Given a source node in a temporal network <em>x ∈ V</em>, then the neighborhood of the node <em>N(x)</em> will be <em>{ yᵢ | i = 1, 2, 3, 4…}</em> and the edges between the node and each neighbor is annotated with ordered interactive events <em>aₓ,ᵧᵢ.</em></p><blockquote>The neighborhood formation sequence can be represented as a series of target neighbor arrival events, i.e. {x: (y₁, t₁) → (y₂, t₂) → … → (yₙ, tₙ)} with each tuple representing an event that node yᵢ is formed as a neighbor of node x at time tᵢ.</blockquote><p>It is a fact that the same node can appear multiple times in an interaction sequence because the source and destination nodes can interact with each other any number of times if there are valid reasons. The example mentioned in the paper is of a co-authorship network where an author can publish any number of papers with a same co-author at different time periods of time. So if we arrange the events (paper publications) in the order of time at which each got published, the first paper would appear in the beginning of the sequence and others follow. Authors claim that, we can extract patterns over time from clusters present in such sequences.</p><h4><strong>Point Process</strong></h4><p>A point process is a mathematical way to describe random points in a space, often used to model events occur over time like customer arrival in a queue or phone calls. We can also define a point process <em>N</em> as a random measure on a space <em>S</em> that counts how many points fall within any subset <em>A</em> of <em>S </em>(The values <em>A</em> takes are non-negative integers). Typically, in any bounded area of <em>S</em>, there are only finitely many points. Given a timestamp <em>tᵢ</em>, we can use <em>N(t)</em> as a function that counts the number of events occurred by the time <em>tᵢ</em>. We are discussing about a space and some random points, so I think it is worth spending some time understanding the key properties of this space as well. Point processes are often defined in a complete separable metric space, which allows for the measurement of distances between the points. This property is essential for ensuring that various characteristics such as distributions and measures can be properly defined as analyzed. Also, the space can be of any dimension, it can be one-dimensional like a real line <em>R</em>, two-dimensional like an <em>x-y</em> plane or even high-dimensional.</p><p><strong><em>Point Process Models</em></strong> are used to understand the behavior of point processes over time, especially when these points or events are sequential and can influence one another. The model assumes that past events can affect the likelihood of a current event happening. For instance, if a person receives a message, it might increase the chances of them sending a reply shortly after.</p><p><strong><em>Conditional Intensity Function</em></strong> is a key concept in point processes. It represents the rate at which events are expected to occur at a given time <em>t, </em>considering all previous events that happened before <em>t</em>. Mathematically, it can be expressed as,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*3c2oRu3QrK1p3ITI0ni9MQ.png" /><figcaption>Conditional Intensity Function</figcaption></figure><p>here,</p><ul><li><em>N(t + Δt)</em> is the number of events occurring in a small time window from <em>t</em> to <em>t + Δt</em></li><li><em>H(t)</em> represents all historical events up to time <em>t</em></li><li>The limit essentially gives us the instantaneous rate of event arrivals.</li></ul><h4>The Hawkess Process</h4><p>It is a specific type of point process that captures <em>self-exciting</em> behavior, meaning that each event can increase the likelihood of future events. The major feature of the Hawkess process is that when an event occurs, it increases the probability of subsequent events happening soon after. This effect diminishes as time passes, which is modeled by the kernel function.</p><p>Below is the general format of the conditional intensity function of a Hawkess Process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*H1E0I3PNk_xrbgxh6F2a7Q.png" /><figcaption>Conditional Intensity Function of Hawkess Process</figcaption></figure><p>here,</p><ul><li><em>μ(t)</em> is the base intensity, representing the natural rate at which events would occur without any influence from past events.</li><li><em>k(t — s)</em> is the kernel that models how past events affect the current event’s likelihood. It typically decreases over time, meaning recent events have a stronger influence than old ones.</li><li><em>dN(s)</em> represents the number of events that occurred at time <em>s</em>.</li></ul><p>In the context of neighborhood formation like social networks, the property of self-excitation is useful because recent events can significantly influence whether new connections form among individuals around.</p><p>Hawkess Process is presented as a key component in the paper by the authors to model the neighborhood formation sequences because it is well suitable to model how a node in a network forms connections with other nodes over time.</p><h4>Multivariate Hawkess Process</h4><p>Each node in the network can be seen as a source that can connect to target nodes based on previous interactions. This connection formation can be represented as a counting process where the current target node is influenced by historical events. To account for different types of events (like different kinds of messages in a chat application), the Hawkess Process can be extended to handle multiple event types and each type will have its own conditional intensity function like the one we discussed above. The excitation effects are indeed a sum over all the historical events with different types, captured by an excitation rate.</p><blockquote>So it is naturally appealing to apply Hawkess Process to model the neighborhood formation sequence of the source node x.</blockquote><p>The conditional intensity function for forming a connection from source node x to target node y at times is given by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*XEEa1jLhzso-6iRaI2ogiA.png" /><figcaption>Conditional Intensity Function of Multivariate Hawkess Process</figcaption></figure><p>here,</p><ul><li><em>μₓ,ᵧ </em>is the base rate of forming a connection between nodes <em>x</em> and <em>y</em></li><li><em>h</em> is historical nodes that have previously formed connections with <em>x</em></li><li><em>αₕ,ᵧ</em> is the influence of historical neighbor <em>h</em> on the current target neighbor <em>y</em></li><li><em>k(t — tₕ)</em> is the kernel that models how the influence of past events decay over time.</li></ul><p>Following the above intensity function, the neighborhood formation sequence of each source node can be modeled.</p><p>The only goal of this whole approach is to generate meaningful representation of D dimensions for each node <em>x</em>. So each node will be initialized randomly in the beginning and learned later using gradient based techniques. The base rate of connecting source node x to target node y can be derived from these embeddings as <em>μₓ,ᵧ = f(eₓ, eᵧ) = -||eₓ — eᵧ||² </em>which means that the base rate reflects how similar or close the two nodes are in the vector space. A smaller distance implies a stronger affinity for connection. Similarly, the influence of historical neighbors is computed using the same similarity measure <em>αₕ,ᵧ = f(eₕ, eᵧ) = -||eₕ — eᵧ||².</em></p><h4><strong>Attention for Sequence Formation</strong></h4><p>When forming connection between nodes, the influence of past interactions on the current target node is essential. The idea is that how much a historical connection affects the current one depends on the source node’s characters. Some nodes in the network may have stable connections with specific historical neighbors, leading to predictable and strong influences on new connections. For example, a researcher who consistently collaborates with the same co-authors will have a more predictable network formation. In contrast, other nodes might frequently change their collaborators, resulting in varying levels of influence from different historical nodes.</p><p>To account for these differences, the model needs to incorporate how each source node’s characters affect the influence or excitation it has on forming new connections. This is something that was not adequately addressed in previous models. The proposed model uses an <em>attention</em> mechanism to define the weights between a source node and its historical neighbors. This is done using a softmax function which helps normalize these weights based on their influence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*QEo5D-HIJWayfZutmdrE_w.png" /><figcaption>Attention Function</figcaption></figure><p>here <em>eₓ</em> and <em>eₕ</em> are vector representations or embeddings of the source node and historical neighbor, respectively. The negative squared euclidean distance used to measure how similar or different these embeddings are.</p><h4>Model Optimization</h4><p>The proposed model uses a multivariate Hawkess Process to analyze how connections form between nodes over time. The conditional intensity function helps predict the likelihood of forming a connection between a source node and a target neighbor at a given time <em>t</em>. The probability of forming a connection can be expressed as,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*cLbWTNyMHLCt_Q8UcgFQwA.png" /><figcaption>Probability of a new connection given past interactions</figcaption></figure><p>here <em>Hₓ(t)</em> represents the historical events leading up to time t and the conditional intensity <em>λᵧ|ₓ(t)</em> indicates how likely it is to connect with neighbor y based on past interactions. The log likelihood of all neighborhood formation sequences across the network can be represented as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*PkE9kWFzV3qnQe7xQelOrg.png" /></figure><p>which sums up the likelihood of forming connections for all nodes in the network which is essential for optimizing the model.</p><h4>Conclusion</h4><p>The Hawkess Process based network embedding method proposed a new approach for modelling temporal networks by leveraging the Hawkess Process to capture how historical connections influence the formation of new connections. This technique learns node embeddings by incorporating network sequence along with an attention mechanism. The attention quantifies how a source node and its temporal neighbors are related to each other.</p><p>That is most about Hawkess Process based temporal network embeddings. I hope you enjoyed reading it and I appreciate the time you spent here.</p><p>Have a good one!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8496f4043f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Continuous-Time Dynamic Network Embeddings]]></title>
            <link>https://kelvinjose.medium.com/continuous-time-dynamic-network-embeddings-4d3dd0ac9aaa?source=rss-47f3a41adda4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d3dd0ac9aaa</guid>
            <category><![CDATA[representation-learning]]></category>
            <category><![CDATA[graph]]></category>
            <category><![CDATA[network]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[sequence-model]]></category>
            <dc:creator><![CDATA[Kelvin Jose]]></dc:creator>
            <pubDate>Thu, 03 Oct 2024 16:49:19 GMT</pubDate>
            <atom:updated>2024-10-03T16:49:19.476Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This is going to be a holistic review of the paper <a href="https://dl.acm.org/doi/pdf/10.1145/3184558.3191526">Continuous-Time Dynamic Network Embeddings</a> which was first presented in BigNet 2018. This is one of the early stage attempts to capture the temporal information present in networks along with topological and other external features.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iPqF9AsJj3viJt1Ikg02uQ.png" /></figure><blockquote>If you are interested in reading on the rise of temporal graph networks, consider <a href="https://kelvinjose.medium.com/transforming-data-the-rise-of-temporal-graphs-b0bc1d2abfc4">this</a>.</blockquote><h4><strong>Introduction</strong></h4><p>Network evolution is now a highly discussed topic among academia and researchers considering the fact that almost all real-world networks are dynamic in nature. It means that nodes and edges can join and leave the network as time progresses. A simple example of this would be of a graph that could be formed from the interactions in an e-commerce platform. For the purpose of this illustration, let’s consider the users and products as nodes of a graph and the interactions between them as edges. So, new members could join and products could get added or removed from the platform. Authors of this paper are trying to propose a new framework where temporal information is incorporated into existing random walk - a stochastic process with random variables <em>W₁vᵢ, W₂vᵢ, …, Wₖvᵢ</em> such that <em>Wₖ₊₁vᵢ</em> is a vertex chosen at random from the neighbors of vertex <em>vₖ</em> <a href="https://arxiv.org/pdf/1403.6652">(Perozzi et. al, 2014</a>) - based embedding approaches such as DeepWalk (<a href="https://arxiv.org/pdf/1403.6652">Perozzi et. al, 2014</a>) and Node2Vec (<a href="https://arxiv.org/pdf/1607.00653">Grover et. al, 2016</a>). Similar algorithms simply rely on random walks starting from every single node ignoring the temporal properties. The proposed framework allows one to learn appropriate node embeddings totally respecting time-dependencies which in-turn removes spurious information caused by non-existing sequences.</p><h4><strong>Time-independent Random Walks</strong></h4><p>Authors of the paper claim that their novel approach learns stronger network representations from continuous-time dynamic networks or <em>temporal networks</em>. We should take a pause here and think about what shortcomings of the existing random walks they are trying to solve. Given a snapshot of the graph, one tends to generate random walks of arbitrary length based on the neighborhood information of each node and assume all such generated sequences are valid. These sequences will then be used in conjunction with sequence embedding techniques such as <a href="https://jalammar.github.io/illustrated-word2vec/">Word2Vec</a> to generate their corresponding embeddings that well capture the topological as well as external features available in the network. Naively, a random walk starts from a random node and the control transitions from the first node to one of its neighbors and this process gets repeated until the number of nodes selected or in other words, length of the node sequence reaches some limit. The only criteria we follow is that the control gets transferred to one of the neighboring nodes of the current node and nothing else.</p><p>The assumption that every sequence that followed this criteria is valid need not to hold true always since some noise which is already present in the data that we knowingly or unknowingly ignored could have poisoned the entire sequence by corrupting some of the intermediate nodes in the walk. Imagine we have two nodes namely A and B and an edge between them. This edge could denote a relationship between either A - B or B - A but we cannot guarantee which one is true unless we have some directions given. What if A is a sender of a message and B is the corresponding receiver, the edge <em>‘sends’</em> is only valid when this exists between A and B but not vice versa. In an undirected graph, these two nodes may seem neighbors of each other but in real-world what actually works is only one of them. So randomly selecting neighbors of each node is not as good because non-existent relations like the one we slightly explained before could happen in the form of noise which makes the sequence invalid. If training algorithms encounter such invalid sequences during training, they might learn invalid as well spurious information.</p><h4><strong>Time-dependent Walks</strong></h4><p>Existing random walk based embedding approaches try to model the space of sequences of all random walks <em>S</em> of graph G but actually what is valid is a subset <em>Sₜ</em> only. The proposed approach limits the space to be learned to just <em>Sₜ</em> by introducing a time based condition along with the existing neighborhood criteria. That is, we are now only allowed to sample new nodes based on not just the neighborhood information but also the time at which each edge between the neighbors came into existence. A temporal walk St from node <em>vᵢ₁</em> to node<em> vᵢₗ₊₁</em> is defined as a sequence of edges <em>{(vᵢ₁, vᵢ₂, tᵢ₁), (vᵢ₂, vᵢ₃, tᵢ₂), …, (vᵢₗ, vᵢₗ₊₁, tᵢₗ)}</em> such that <em>tᵢ₁ ≤ tᵢ₂ ≤ … ≤ tᵢₗ</em>. A temporal walk is a temporally valid sequence of edges traversed in the increasing order <em>edge times</em> and therefore accept time. In simple terms, three nodes <em>vᵢ₁, vᵢ₂,</em> and <em>vᵢ₃</em> can appear in a temporal walk if and only if <em>vᵢ₂</em> and <em>vᵢ₃</em> are neighbors of <em>vᵢ₁ </em>and <em>vᵢ₂</em> respectively and the edge time between nodes <em>vᵢ₂ - vᵢ₃</em> is greater than of nodes <em>vᵢ₁ - vᵢ₂</em>. If we were to do random walks on these nodes, sequences <em>vᵢ₁ - vᵢ₂ - vᵢ₃</em> and <em>vᵢ₃ - vᵢ₂ - vᵢ₁</em> would be possible but the second one would be indeed invalid. If <em>vᵢ₁ - vᵢ₂ - vᵢ₃ </em>are one way communication channels, the temporal walk would probably show the flow of information starting from <em>vᵢ₁</em> to <em>vᵢ₃</em> but at the same time communicating backwards is not possible so the walk <em>vᵢ₃ - vᵢ₂ - vᵢ₁</em> would become irrelevant.</p><p>We can now be sure that an embedding model that generated embeddings based on the invalid sequence would learn unwanted representations which eventually lead to degradation of evaluation metrics. In a nutshell, time-dependent walks are sequences of nodes connected by edges with non-decreasing edge times.</p><h4><strong>Selection of First Edge and Subsequent Nodes</strong></h4><p>We are now going to discuss selecting the first edge from which a temporal walk should start and then progress. So far we were thinking about selecting a random node from the given graph and then iteratively sampling neighbors until we reach some walk limit - which is always true in case of random walks. Unlike in a random walk, we begin by selecting an edge with some timestamp in a temporal walk. We are not starting from a random node because it does not have any time information associated with it. The alternate option is to select an edge that connects two nodes together and we assume the edge is accompanied with some timestamp which might denote the time at which the interaction took place.</p><p>Authors propose two independent strategies namely unbiased and biased to select the first edge. In unbiased selection, each edge in a temporal graph will have an equal probability to be selected as the first edge i.e. if <em>Eₜ</em> is the set of all temporal edges, then each edge <em>eᵢ</em> will be equally likely to be sampled which means the probabilities follow a uniform distribution.</p><blockquote>Probability(<em>eᵢ</em>) = 1 / |<em>Eₜ</em>|</blockquote><p>In biased selection, we use a non-uniform distribution to select an edge to begin the walk where the probabilities are not equal but weighted based on some function (exponential or linear). The weight function can be chosen in such a way that it defines a probability distribution that favors either early or later edges appearing in the graph. The rationale behind biasing sounds sensible because the downstream applications of the learned embeddings are heavily dependent on the representations, so some applications might prefer more recent information whereas others opt for old information. For example, in a link prediction problem, we might want to begin temporal walks from edges closer to the current time since new edges might be more relevant or highly indicative of the current state of the system. This way biased selection helps us in selecting the first edge with some bias applied.</p><p>After the first edge is selected, we will now have to sample the subsequent nodes to finish the walk. For that, we will first identify the temporal neighborhood of the second node in the first edge i.e. if our edge <em>eᵢ </em>connects a node <em>vᵢ₁</em> to <em>vᵢ₂</em>, then we would look into the temporal neighborhood of <em>vᵢ₂</em> and figure out all those eligible nodes. Being in the neighborhood is not just the only criteria to be passed but there exists a second one regarding the timestamps of the edges that connect the second node in the first edge and its neighbors. Edges with timestamps greater than the timestamp of the first edge and the trailing nodes at the end of these edges are now eligible to be selected as the next node in the walk (Figure 1).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*rg8Sk6QNBj5d0Ld7O3oNKA.png" /><figcaption>Figure 1. We assume that the walk starts from edge E₀ with timestamp 11.7. Then the nodes that form the temporal neighborhood of node v₁ will be v₂ and v₄ only.</figcaption></figure><p>The temporal neighborhood of a node <em>v</em> can be defined as,</p><blockquote>Γt (vi) = {(w, <em>t</em>′) | <em>e</em> = (vi, w, <em>t</em>′) ∈ <em>Eₜ</em>∧T(<em>e</em>) &gt; <em>t</em>}</blockquote><p>where <em>e</em> is the first edge in the walk, <em>Eₜ </em>is the set of all edges and <em>T</em> is a function that maps each edge <em>e</em> to a timestamp, <em>t</em> is the timestamp of the edge that connects <em>vᵢ₋₁</em> and <em>vᵢ</em>.</p><p>This means that node w is in the temporal neighborhood of <em>vᵢ </em>iff there exists an edge <em>e</em> starting from <em>vᵢ </em>to <em>w</em> and the timestamp of <em>e</em> is greater than <em>t</em>.</p><p>From the set of temporal neighbors, authors use the same unbiased and biased strategies to select the next node in the walk. In unbiased setting, every node in the temporal neighborhood will have the same probability (uniformly distributed) of getting selected whereas unbiased setting uses either an exponential or a linear function to add weightage (non-uniformly distributed) to the probabilities of nodes.</p><h4><strong>Temporal Context Windows</strong></h4><p>Authors point out that since we have time constraints on selecting subsequent nodes, it is pretty much possible to run out of nodes in the walk, so a hard limit on the maximum length of the walks is not always required, rather they define a minimum length <em>ω</em>. This is imposed because of the minimum context-window length requirement in the sequence model which we use to learn the embeddings later. So any sequence with at least the length <em>ω </em>will be valid. If S is the set of all valid sequences, then the total number of context windows can be from it will be,</p><blockquote>β = ∑ |Si| − ω + 1</blockquote><h4><strong>Modeling</strong></h4><p>Once all the temporal walks are generated, the next step will be to use a sequence modeling algorithm to learn time-dependent embeddings corresponding to each node in the sequences. Since the restrictions are only applicable to the sequence generation phase, any sequence modeling algorithm with minimum hyperparameters can be utilized here. We have transformers (<a href="https://arxiv.org/pdf/1706.03762">Vaswani et. al, 2017</a>) now, so it can also be a candidate.</p><h4><strong>Evaluation</strong></h4><p>The proposed algorithm is tested against different existing algorithms such as DeepWalk, Node2Vec and LINE on link prediction task on multiple datasets. The way in which the train and test split is made is quite simple, authors sort each dataset in the ascending order of edge times and use the first 75% of the data to train the model and use the rest for evaluating the trained model. The last 25% of the sorted data is considered as positive examples and they randomly generate the same proportion of data as negative examples. Authors observe that the proposed algorithm consistently outperformed all the existing algorithms and they say important information is lost when temporal information is ignored. Overall 11.9% gain is observed across datasets and I believe the biggest factor that helped the authors achieve this is the set of regulations they introduced to the sequence generation phase which substantially reduced the noise in the training data.</p><h4><strong>Conclusion</strong></h4><p>Authors of the paper were trying to come up with a framework that incorporates the temporal information into existing random walk methods believing that it cannot be ignored at all. The novel idea of the paper is something they call a ‘temporal walk’ which is an ordered set of nodes and edges with non-decreasing edge times. Each such walk will form the basis of the training data which will later be used in association with a sequence learning algorithm like Word2Vec. Models trained on the data of this new type of walk perform better than existing algorithms and overall a gain of 11.9% is observed. This temporal walk something compatible with any sequence learning algorithm, so scaling this to an existing will not be a headache.</p><p>As we navigate the landscape of Continuous-Time Dynamic Networks, we recognize the profound impact of temporal information on our understanding of complex systems. I appreciate your time and interest. Thank you for spending time here. Have a good one 👋👋👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d3dd0ac9aaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transforming Data: The rise of Temporal Graphs]]></title>
            <link>https://kelvinjose.medium.com/transforming-data-the-rise-of-temporal-graphs-b0bc1d2abfc4?source=rss-47f3a41adda4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0bc1d2abfc4</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[temporal-graph]]></category>
            <category><![CDATA[graph]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Kelvin Jose]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 09:16:35 GMT</pubDate>
            <atom:updated>2024-09-10T09:16:35.664Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This blog is now part of world’s biggest and ever evolving Temporal graph — The World Wide Web (WWW).</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAZRDEoW_DMT7UK_Hgl82Q.png" /></figure><h4>Introduction</h4><p>Graphs have become an important data structure under research and development for numerous reasons such as its ability to model complex non-euclidean data and adaptability in various fields of science and engineering. They opened up an easy but strong opportunity to define entities as nodes and relationships between the entities or nodes as edges. The choice of entities and relationships can vary depending on data abstractions and business needs but the underlying design and core concepts of graphs stay unchanged. If we consider Instagram as a simple example, users and posts could play the role of entities or nodes whereas the interactions between users and posts such as likes, comments or shares could best form the candidates for relationships or edges. Modeling data itself is not just helpful even though it is an important prior to be solved before shifting focus to anything else.</p><p>Deep Learning has been pivotal in learning graph data and performing various downstream tasks such as node — graph classification, edge prediction and clustering. There exists classical feature engineering techniques based on graph measures and properties like centrality, degree etc. but they possess limitations which make them not scalable or even usable after a certain threshold. Before diving deep into Deep Learning techniques for graphs, it is better we get to know graphs in some detail. Well, there are two broad categories of graphs, one is static and the other one is dynamic (obviously). Static graphs (<em>Figure 1</em>) are constant structures meaning the node and edge information always stay the same with no notion of time. Traditional machine learning algorithms were primarily designed and maintained considering static graphs only. However, many real world applications involve dynamic graphs that change their properties over time. That means, nodes, edges and attributes can get added, removed or updated at different times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dcJSrhl3BSM1Ba_YYuG3MA.png" /><figcaption>Figure 1, Created by author</figcaption></figure><p>Dynamic graphs can further be divided into two as Discrete — Time Dynamic Graphs (DTDG) (<em>Figure 1</em>) and Continuous - Time Dynamic Graphs (CTDG) or Temporal Graphs (<em>Figure 1</em>). DTDGs are more like snapshots of a graph taken at fixed time intervals but they guarantee to lose the details about the interactions between two snapshots (<em>Figure 2</em>). In simple terms, if we take one snapshot after each 30 mins window, all the interactions such as node additions — deletions and edge additions — deletions between two windows will completely be lost. One method to address this issue is bringing down the snapshot interval to a smaller number, but this can lead to unnecessary computations and increased storage requirements. CTDGs on the other hand keep track of the timestamps of every single graph event which in turn realistically shows the evolution of graphs over time. Since temporal information is preserved along with nodes and edges, algorithms developed for static graphs or CTDGs become less useful as they were primarily designed to cater non-temporal data only. Time and order, both are equally important components in causal inference because future events are likely to be predicted with some confidence based on a function of the set of past ordered events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*QvTEty9vu4j6bwkK3hDK3Q.png" /><figcaption>Figure 2, Created by author.</figcaption></figure><blockquote>Our current focus will just be Temporal graphs in detail. Consider this as a starter guide if you are new to this topic. I will be using the terms ‘evolving graphs’ and ‘temporal graphs’ interchangeably but assume both are the same.</blockquote><h4>Why are evolving graphs important?</h4><p>We have been witnessing the staggering amount and pace at which data (both online and offline) is being produced every single day of our life. Here are some interesting statistics, 402M TerraBytes (TBs) of data are created everyday which sum up to approximately 147 ZettaBytes (ZB) this year only. The amount of data generated annually has grown year-over-year since 2010 and different estimates underline that 90% of the world’s data were generated in the last two years alone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n-rT4gPwJNZQWxQ-JzHAZg.png" /><figcaption>Image Credits: <a href="https://cdn.buttercms.com/output=f:webp/ods4p5fQVmXkFeHFP3Zx">https://cdn.buttercms.com/output=f:webp/ods4p5fQVmXkFeHFP3Zx</a></figcaption></figure><p>In the beginning of the Internet revolution, we just had to deal with unstructured plain text in most of the cases because both production and consumption were limited and effortful. Eventually, we started handling structured and hierarchical data, images and videos, time series, biological sequences, sensory readings and so on which means not just the amount was increasing but the complexity too in collecting, storing and maintaining them efficiently. Data is now not at all perceived as isolated pieces rather systemically well connected pieces. There are many equally important ways in which interconnected data is stored such as relational databases, document stores, key — value pairs, Resource Description Framework (RDF) and graphs. To model complex data where there are well defined entities and relationships are present, a graph is a good choice considering the efficiency in querying and analysis. As the volume and complexity of data continue to grow, traditional static graphs have become less resilient in representing the data in a useful way. Most of the classic graphs are static and thus not suited in some real world scenarios, since entities and their relationships can continually evolve over time. New entities may join or leave the graph, new edges can appear and existing ones can disappear, the attributes of the nodes can change — all such incidents are natural in evolving graphs.</p><p>Let us now try to understand some of the evolving graphs around us. On E-commerce platforms such as Amazon or Walmart, new sellers, users and products can enter the platform and leave. We can consider all these three entities as nodes in our temporal graph and their relationships among them as edges. If a user adds one product to his/her cart, that directly shows the user’s interest in the product and its category, so an ‘<em>interested </em>in’ relationship can easily be formed and tracked here and if the user checks out by successfully placing the order, that is again a strong relationship or signal to be considered. Product descriptions and user information such as location, gender, age and past purchases can act as node attributes. Recommendation engines (<a href="https://ieeexplore.ieee.org/document/9378444"><strong>Ting Bai et al, 2020</strong></a>) can consume these pieces of information and recommend new products based on evolving preferences, collaborative influence of peers and the temporal impact of previous purchases. In social networks, users can join, make or remove friends, post updates and interact with existing updates. If we consider users and posts as nodes in temporal graphs, interactions among them can be counted as different relationships. If a user adds someone else to their friend list, a new edge ‘<em>friends with</em>’ can be added to the graph and the user is also allowed to remove this connection by unfriending them which adds an another edge i.e. <em>‘unfriended’. </em>Interesting signal can be mined and stored in the form of edges when a user interacts with posts by liking, disliking, commenting and sharing them because this can directly or indirectly denote the user’s evolving or changing likes and dislikes of different social media topics such as entertainment, sports, politics, automobile etc.</p><p>The nodes and edges described here are for illustrations only, the actual choice of them is solely dependent on what businesses are trying to solve and achieve. Sometimes in the real-world, temporal evolution may only occur at the levels of entities, relationships and their characteristics. Also, there can be different parts of the graph that evolve at different paces.</p><h4>Learning from Temporal Graphs</h4><p>Business owners can navigate temporally evolving graphs to answer their needs about entities and the relationships among them. The needs can range from basic queries like ‘<em>what</em>’, ‘<em>when</em>’, ‘<em>why</em>’ and ‘<em>who</em>’ to complex ‘<em>how</em>’ and ‘<em>what next</em>’ queries. In the context of evolving graphs, knowledge refers to a combination of information pieces that serves for understanding causality as explained above. The past events and interactions in an evolving temporal graph can control the occurrence of future events. The main challenge for knowledge extraction in a graph with temporal evolution is to be able to combine information from its different dimensions such as evolution and topology and other external factors. Different researches have been taking place in solving these challenges and many innovations such as Temporal Graph Networks (<a href="https://arxiv.org/pdf/2006.10637"><strong>Emanuele Rossi et al, 2020</strong></a>) and Temporal Graph Transformer (<a href="https://openaccess.thecvf.com/content/WACV2023/papers/Chu_TransMOT_Spatial-Temporal_Graph_Transformer_for_Multiple_Object_Tracking_WACV_2023_paper.pdf"><strong>Peng Chuet al, 2023</strong></a>) have come out of labs and academia.</p><p>The future of learning from temporal graphs is exciting and I believe the <a href="http://chatgpt.com/">ChatGPT</a> moment of it is yet to come.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0bc1d2abfc4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>