Speaker: Emanuele Rossi (Imperial/Twitter)
Problem: Many Graphs are Dynamic
E.g. social/interaction networks
- How do we make use of timing information to make better representations of nodes?
- Can we predict when and how the graph will change in the future?
This talk focuses on the first question.
From static to dynamic graphs
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3.us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9e1ede0a-0ae1-432f-8b18-c272b066b359%2FUntitled.png%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIAT73L2G45EIPT3X45%252F20221016%252Fus-west-2%252Fs3%252Faws4_request%26X-Amz-Date%3D20221016T192402Z%26X-Amz-Expires%3D86400%26X-Amz-Signature%3D25f92aa7704990f07b8028a8508a69efeb096f6e5d383bb5fdb9ebd3f27bc519%26X-Amz-SignedHeaders%3Dhost%26x-id%3DGetObject?table=block&id=1a76593b-ce6f-462e-be7d-50b695977a5d&cache=v2)
CTDGs: many types of events
Node/edge - creation/deletion/feature change
Why is learning on dynamic graphs different?
Model must:
- Handle different kinds of events
- Use time information
- Efficiently incorporate the graph changing - don't recompute everything
- Different tasks: predict when something will happen
Model
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3.us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F8c2f892b-77de-4200-b114-5f6527cebc96%2FUntitled.png%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIAT73L2G45EIPT3X45%252F20221016%252Fus-west-2%252Fs3%252Faws4_request%26X-Amz-Date%3D20221016T192402Z%26X-Amz-Expires%3D86400%26X-Amz-Signature%3Df9428ab2e3863b009094f3780686a9065f0636ddd0ae99cc96369799348e0419%26X-Amz-SignedHeaders%3Dhost%26x-id%3DGetObject?table=block&id=1eeefeb2-3525-4e8a-8d2d-ac756d78c90a&cache=v2)
Encoding a temporal graph
Simplification: assume the graph consists entirely/only of edge creation events
First idea: Process events in order using an RNN with a different hidden state for each node
Pros: Built in bias of sequentiality
Cons:
- Not using the graph of interactions directly
- Memory staleness: nodes only updated when involved in interaction
![Note: typo - second line should start with](https://www.notion.so/image/https%3A%2F%2Fs3.us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F69bd7544-4ca9-4837-bc91-fec6bc0a7216%2FUntitled.png%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIAT73L2G45EIPT3X45%252F20221016%252Fus-west-2%252Fs3%252Faws4_request%26X-Amz-Date%3D20221016T192402Z%26X-Amz-Expires%3D86400%26X-Amz-Signature%3D5553d4af3f7ea3f74fc4266622c2dc0ffd2ed331a5931ac495c0ffaddef056a1%26X-Amz-SignedHeaders%3Dhost%26x-id%3DGetObject?table=block&id=5a5204b2-f8de-4666-aec8-b7e859285e5a&cache=v2)
RNN for a node takes previous state, plus message
Second idea: Use a GNN with attention and use timestamps as edge features
Pros:
- More efficient - no need for sequential processing
- Uses the graph explicitly, mitigates staleness because neighbours will still be updated
Cons
- Can only handle edge addition events
- Not suitable for online updates
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3.us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fff0c9679-c283-49a9-b430-11d136ab6240%2FUntitled.png%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIAT73L2G45EIPT3X45%252F20221016%252Fus-west-2%252Fs3%252Faws4_request%26X-Amz-Date%3D20221016T192402Z%26X-Amz-Expires%3D86400%26X-Amz-Signature%3Dc07c0532a72d0bb54e6bfbdaf57bac2980be46e97268d46156ff474286534c58%26X-Amz-SignedHeaders%3Dhost%26x-id%3DGetObject?table=block&id=baafd33b-734b-410c-9295-4118f4fa368e&cache=v2)
Temporal Graph Networks
Attempts to combine best of both worlds
- Defines general framework which can handle all types of events
- Each type of event generates a message used to update node representations
- Uses GNN directly on graph of interactions
Module 1: Memory
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3.us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb8fa1259-377d-4e00-8af0-d38c673ac7de%2FUntitled.png%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIAT73L2G45EIPT3X45%252F20221016%252Fus-west-2%252Fs3%252Faws4_request%26X-Amz-Date%3D20221016T192402Z%26X-Amz-Expires%3D86400%26X-Amz-Signature%3D446a80921151b9a3e15bb611777f5d6283f0c7b5fb7342429d4a014f2bbd5db3%26X-Amz-SignedHeaders%3Dhost%26x-id%3DGetObject?table=block&id=d02ceaed-0048-4f47-95c6-64a04fbc921b&cache=v2)
- One per node
- Analogous to RNN hidden state
- Contains a vector for each node the model has seen so far—a compressed representation of all past interactions of a node
- This is not a parameter - it is also updated at test time
Module 2: Message Function
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3.us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F28df6563-2041-4f24-b898-ac8514db9716%2FUntitled.png%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIAT73L2G45EIPT3X45%252F20221016%252Fus-west-2%252Fs3%252Faws4_request%26X-Amz-Date%3D20221016T192402Z%26X-Amz-Expires%3D86400%26X-Amz-Signature%3D345218d9faae7a60a74325a8a74a4286c6e479b72cd0b37a2ef445d246b6fe98%26X-Amz-SignedHeaders%3Dhost%26x-id%3DGetObject?table=block&id=862aa7dd-a616-4a92-8774-3eed7a90e717&cache=v2)
- Each event creates a message
- Messages used to update memory
- Given an interaction , messages are computed
- This is done for source and destination
Module 3: Memory Updater
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3.us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0b2fb49c-afaa-4f2f-bafe-333953dc89cc%2FUntitled.png%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIAT73L2G45EIPT3X45%252F20221016%252Fus-west-2%252Fs3%252Faws4_request%26X-Amz-Date%3D20221016T192402Z%26X-Amz-Expires%3D86400%26X-Amz-Signature%3D14c85f73b38f81b52b59a08833480ebc92b9604e699c04f0b8dedd369752783d%26X-Amz-SignedHeaders%3Dhost%26x-id%3DGetObject?table=block&id=582f304f-8cf4-4c39-ac91-78b91210278e&cache=v2)
- Memory updated using newly computed messages
- This is an RNN (GRU used)
Module 4: Graph Embedding
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3.us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fdec0afc9-4a16-48ee-8f64-1cb1ac17817b%2FUntitled.png%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIAT73L2G45EIPT3X45%252F20221016%252Fus-west-2%252Fs3%252Faws4_request%26X-Amz-Date%3D20221016T192402Z%26X-Amz-Expires%3D86400%26X-Amz-Signature%3Df68c8a7dc5fba86c853e29ff5d9ca98c6bf98227f7df5b1d2a5b798d0da190c4%26X-Amz-SignedHeaders%3Dhost%26x-id%3DGetObject?table=block&id=20f037bb-03cb-4487-9a56-a5aedb54b132&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3.us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F78524500-9b24-4bc7-8da2-c3c67cca4864%2FUntitled.png%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIAT73L2G45EIPT3X45%252F20221016%252Fus-west-2%252Fs3%252Faws4_request%26X-Amz-Date%3D20221016T192402Z%26X-Amz-Expires%3D86400%26X-Amz-Signature%3D20f502bc9579608ee49c009ce2c8a0740e466fd5b2764eb6e598ac373d90465e%26X-Amz-SignedHeaders%3Dhost%26x-id%3DGetObject?table=block&id=76328e2f-b8ab-43ed-85a2-36ec3bbf2db1&cache=v2)
- Adding a GNN over everything from previous modules
- Essentially, a GNN is run over the current graph, using the memory as additional features
- Uses graph attention over node features and memory
Link Prediction with TGN
- Data split is chronologically
- All previous events used in prediction of next one
- Training this efficiently is not trivial - see paper for details!
Scalability
- Memory is a concern for scalability as it is not a parameter → we can just think of it as an additional feature vector for each node
- So we only ever need memory for nodes involved in a batch
- Model is scalable as GraphSage → can scale to very large graphs!
Experiments
Link prediction:
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3.us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F694313bc-6d29-4427-b971-7a3e5171737b%2FUntitled.png%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIAT73L2G45EIPT3X45%252F20221016%252Fus-west-2%252Fs3%252Faws4_request%26X-Amz-Date%3D20221016T192402Z%26X-Amz-Expires%3D86400%26X-Amz-Signature%3D7a3e95c5dded27084125850443fee3957ed9c121148c50c0159294391530301f%26X-Amz-SignedHeaders%3Dhost%26x-id%3DGetObject?table=block&id=9a778d8b-aeb5-405a-80d6-288ce0c08158&cache=v2)
It's not clear to me how they've wired up the non-temporal methods here!
Other experiments also presented. Performance similarly strong.
Ablation study also included. Memory and embeddings both very important.
Q & A
- Timestamp representation is a difficult problem - some work has been done on this. Raw timestamps are bad, embeddings a bit better. More work needed though!