Glossary

What is a temporal graph network (TGN)?

A temporal graph network (TGN) is a graph neural network that learns from a stream of timestamped events between nodes. It keeps a memory for each node that updates as events arrive, so when things happened, and in what order, shapes what it learns.

Book a demo

The short answer

A temporal graph network is a graph neural network for data that changes over time. It reads each dated interaction as an event, keeps a running memory for every node and rewrites that memory as events arrive, so order and spacing shape the output. Clean runs a live TGN over plant-level account timelines to flag accounts heading into a buying moment.

Key takeaways

  • A TGN learns from timestamped events between nodes and keeps a memory per node that updates with each event.
  • A static graph neural network sees one frozen map of connections. A TGN also sees when each one formed.
  • Rossi and colleagues introduced TGN in 2020 and framed JODIE, DyRep and TGAT as special cases of it.
  • One 2023 benchmark found simple methods often beat temporal graph models at predicting node properties.
  • Clean models companies, plants, owners and suppliers as nodes and dated changes as events to flag buying moments.
01

Temporal graph network definition

A temporal graph network (TGN) is a graph neural network built for graphs that change over time. Emanuele Rossi and five colleagues at Twitter introduced it in 2020, treating a graph as a time-ordered stream of events instead of one fixed picture.

An event either creates or updates a node, or adds a timestamped edge between two nodes (a pair can have many edges). From that stream the TGN produces an embedding (a learned vector) for any node at any moment, which a small task model uses to predict a future edge or classify the node. The paper also frames earlier models, including JODIE, DyRep and TGAT, as special cases.

02

How a TGN works: memory, messages and embeddings

The framework has five modules. Time enters as the gap since a node's last event, so the same two events a week apart and a year apart produce different results.

  • Memory: one vector per node that compresses its history. It starts at zero and is rewritten after every event the node takes part in.
  • Message function: turns each event into a message using the nodes' memories, the time gap and the event's features.
  • Message aggregator: if a training batch holds several events for one node, it keeps the latest message or averages them.
  • Memory updater: a recurrent unit such as a GRU or LSTM folds the message into memory.
  • Embedding module: mixes a node's memory with its neighbors' to fight memory staleness, where a quiet node carries an out-of-date memory.
03

TGN vs static graph neural networks and single-event scoring

A static graph neural network, such as Kipf and Welling's 2016 graph convolutional network, learns from one fixed set of nodes and edges. You can run one on a changing graph by ignoring time, but the TGN paper notes that approach has been shown to be sub-optimal.

Single-event scoring is the sales version of the same blind spot. A trigger event rule scores each change on its own, and topic-level scores share the gap, which is part of why intent data misses manufacturing plants.

A made-up example: Plant A shows new equipment investment, then a first hire in a new maintenance function a month later. Company B shows the same two changes two years apart at different sites. A one-event rule scores them alike. A TGN does not, because the time gap and the shared node are inputs.

What each approach reads, and what it cannot see

ApproachWhat it readsWhat it misses
Static graph neural networkOne fixed map of nodes and edgesWhen each edge formed and in what order
Snapshot (discrete-time) modelThe graph at set intervals, such as monthlyChanges between snapshots and their exact spacing
Temporal graph networkEvery timestamped event, with a running memory per nodeAnything that never made it into its event history
Single-event scoringOne trigger at a timeHow events combine, their order and the gaps between them
04

Where temporal graph networks fall short

A TGN learns only from the events it is given. Wrong dates make memory drift, and a node nobody observed looks quiet even when it is busy. A brand-new node starts at zero memory, so early on the model leans on its neighbors.

Benchmarks are mixed. One 2023 study, the Temporal Graph Benchmark, found results for common temporal graph models varied widely across graphs, and that on node property prediction, simple methods often beat them. Treat a TGN's output as a flag to check, not a verdict.

05

How Clean uses a temporal graph network

In Clean's setup, every account is a timeline of dated events, and a live TGN runs over that timeline. Companies, the plants they run, their owners and their suppliers are the nodes. The events are dated changes, each sorted into one of the 14 buying moments. A first hire in a new function is one; so are a capacity expansion, new equipment investment and an ownership change. Alongside the model, Clean's research maps 140+ typical chains, the usual paths by which one change at a plant sets off another.

Among the most telling accounts in Clean's research, some showed several related changes arriving at a single plant close together in time. A cluster like that can signal a project in progress, not a one-off purchase. Because Clean researches accounts plant by plant, a new factory or expansion is read at the site where the work happens, not folded into headquarters.

What the model produces is a flag on an account heading into a buying moment. The point is timing: you reach the plant before the decision closes, and often before the company has announced anything. Each flag carries a date, the evidence behind it, competing explanations for the same events and the observation that would disprove it, and whatever Clean cannot confirm is left marked unknown. Deciding who to reach, and why, is Clean's part; your team handles the reaching out. For the full method, read how Clean works or Clean for manufacturing, or book a demo: during the call, Clean will build your product a live list of plants.

Common questions

What is the difference between a temporal graph network and a graph neural network?

A standard graph neural network learns from a fixed graph: nodes, edges and their features at one moment. A temporal graph network learns from a stream of timestamped events and keeps a memory for each node that updates as events arrive, so it can use when interactions happened, their order and the gaps between them. A static model throws that away.

Is a temporal graph neural network the same as a TGN?

Mostly, with one nuance. Temporal graph neural network is the broad name for graph neural networks that handle time, including snapshot-based and continuous-time designs. TGN usually means the specific continuous-time framework Rossi and colleagues published in 2020, with its per-node memory, message functions and embedding module. People often use TGN loosely for the whole family.

What is temporal graph learning used for?

Temporal graph learning fits any problem where relationships change and timing matters. The original TGN paper tested future link prediction and node classification on interaction histories from Wikipedia, Reddit and Twitter. The 2023 Temporal Graph Benchmark covered larger networks spanning years, including social and transportation networks. In B2B sales, it suits companies and sites whose changes build toward a purchase over months.

How does Clean use a temporal graph network?

Clean treats companies, their plants, owners and suppliers as nodes, and dated changes such as a capacity expansion or a certification renewal as events between them. A live TGN reads the order and spacing of those events to flag accounts heading into a buying moment. Each flag comes with dated evidence, other possible explanations and what would prove it wrong.

Sources

  1. 01Temporal Graph Networks for Deep Learning on Dynamic Graphs (Rossi, Chamberlain, Frasca, Eynard, Monti, Bronstein), arXiv, 2020-06-18
  2. 02Temporal Graph Benchmark for Machine Learning on Temporal Graphs (Huang et al.), arXiv, 2023-07-03
  3. 03Semi-Supervised Classification with Graph Convolutional Networks (Kipf and Welling), arXiv, 2016-09-09
  4. 04Inductive Representation Learning on Temporal Graphs (TGAT, Xu et al.), arXiv, 2020-02-19
  5. 05Predicting Dynamic Embedding Trajectory in Temporal Interaction Networks (JODIE, Kumar, Zhang and Leskovec), arXiv, 2019-08-03

Next