Case Studies Temporal Attention for Link Prediction on Dynamic Graphs - 86% AUC at NUS
research Academic Research · Nov–Dec 2019

Temporal Attention for Link Prediction on Dynamic Graphs - 86% AUC at NUS

Research internship in Prof. Bryan Hooi's lab at NUS - built a temporal attention model that predicts which edges form next in an evolving graph, reaching 86% AUC on the College Messages dataset and beating node2vec, TMF, CTDNE, and BANE under identical splits.

Problem

Graph Machine Learning at the time treated graphs as static - a frozen set of nodes and edges - discarding the timing of interactions, which is exactly the signal that predicts which connections form next.

Outcome

A from-scratch PyTorch temporal attention model reached 86% AUC on College Messages and outperformed node2vec, TMF, CTDNE, and BANE under one shared, leak-free evaluation protocol.

Impact - who used it & what changed

Research conducted and reviewed in Prof. Bryan Hooi's lab at the National University of Singapore - external academic validation of the approach by an active graph-mining research group.

Context

During my undergraduate studies at IIT Bombay, I did a research internship at the National University of Singapore with Prof. Bryan Hooi’s group, an active graph-mining lab. The task: temporal graph representation learning - use attention to capture how relationships evolve over time in a dynamic network, then use that representation to predict which edges form next.

It was my first exposure to cutting-edge Machine Learning research, and it is where I first learned that a result and a claim are not the same thing - and that Machine Learning research and Machine Learning engineering are different disciplines. The engineering question is “does it run and scale.” The research question is “is the number real, and does it survive an honest comparison.” This project was about the second one.

The Problem

Most graph Machine Learning work at the time treated graphs as static: a fixed set of nodes and edges, embeddings learned from that frozen structure. But real networks evolve. Social connections form and dissolve, transactions create temporal patterns, information spreads in time-ordered sequences.

For link prediction - predicting which connections will form in the future - the timing of past interactions is not noise. It is signal. A model that ignores when interactions happened is throwing away the most predictive part of the data. The question was how to represent a time-evolving graph so that signal survives into the prediction.

Why It Mattered

Temporal link prediction underpins social-network recommendation, fraud detection (spotting unusual connection patterns), academic collaboration prediction, and dynamic knowledge-graph completion. The lab’s interest was the core representation question - how to encode a time-evolving graph usefully - rather than any single application.

Data & Inputs

The timestamp on each interaction was the thing we were trying to exploit. That is what made the problem interesting and what every baseline either used or ignored.

The Work

I implemented and benchmarked the relevant temporal and static methods on a common footing:

The contribution was a temporal attention model that:

  1. encodes the sequence of interactions a node has participated in,
  2. weights past interactions with an attention mechanism rather than a fixed recency rule, and
  3. combines that temporal history with structural graph features for the link-prediction head.

The attention mechanism was the load-bearing design choice. It let the model learn which past interactions were most predictive, instead of assuming the most recent one always was - a subtle distinction with a measurable effect on the result.

Engineering & Validation

The harder half of the project was making the comparison honest:

Without that discipline, the comparison would have been meaningless - you can make almost any model “win” with a generous split. Holding every method to the same protocol is what turned the 86% from a claim into a result.

Outcome

Impact

This was research, not a product, so the honest measure of impact is academic: the work was conducted inside Prof. Bryan Hooi’s NUS lab and reviewed by his research group, with findings presented back to them. That review by an active graph-mining group is the external validation - the approach and its results were scrutinized by people whose job is to find the hole in a comparison. There was no production or commercial deployment, and I am not claiming one.

Limitations & What I’d Do Differently

Stack

Python, PyTorch, NetworkX, NumPy, Pandas, Matplotlib.

Stack

Python PyTorch NetworkX NumPy Pandas
graph-ml research temporal-graphs link-prediction attention

Have a problem worth solving?

Whether you need a quantitative researcher, a Machine Learning systems builder, or a technical advisor, I take a small number of consulting engagements at a time.

Book a call →