Project P04

Applied graph ML: from message passing to equivariant networks

How do we rigorously build, train, and evaluate neural networks on real graphs, from citation networks and molecules to source-code graphs?

stages
8
duration
14 h
concepts
24
available in English
8 / 8
completed by you
0 of 8

Where it fits

Leads to

This completes the path.

Overview

Build a custom PyTorch GNN library with scatter operations and compare it with PyTorch Geometric on node, graph, and link tasks. Study GCN, GraphSAGE with neighbor sampling, GAT, GIN and its relationship with the Weisfeiler-Leman test, knowledge-graph embeddings, E(n)-equivariant networks for molecular properties, and graph transformers with positional encodings, using multiple seeds and honest splits. Finish with vulnerability detection on code graphs and a dataset leakage audit.

Why it matters

Much real-world data describes relationships: citations, molecules, transactions, dependencies, and a program's flow graphs. Efficient message passing on an 8 GB GPU, reasoning about expressivity and equivariance, and evaluation without leakage support applying Graph ML to your own problems, including application security, and reading the literature critically.

Stages 8

  1. 01Graph data and message passing from scratchBuild the core library: COO graph data structure, GPU gather and scatter operations, a message-passing base class, and batching graphs as a disjoint union. Verify against dense adjacency multiplication and PyTorch Geometric, and measure performance. GPUAdvanced100 min
  2. 02GCN, node classification and oversmoothingImplement Kipf and Welling's GCN on the custom core, reproduce its Cora result with the original protocol and several seeds, and study what happens as layers are stacked: representations converge and accuracy falls. Measure oversmoothing with Dirichlet energy and test residual connections and normalizations that mitigate it. GPUAdvanced90 min
  3. 03GraphSAGE, GAT and large graphsImplement GraphSAGE with neighbor sampling and GAT with neighborhood softmax, and train them on ogbn-arxiv, a graph of about 170,000 nodes, within an 8 GB budget. Compare full-batch, neighbor-sampling, and cluster-partition training in memory, time, and accuracy using the official OGB evaluator. GPUAdvanced110 min
  4. 04Graph classification, GIN and expressivityMove from nodes to whole graphs: invariant readouts, GIN with bond attributes, and the ogbg-molhiv molecular benchmark with scaffold split. Implement the Weisfeiler-Leman test, construct pairs no message-passing GNN can distinguish, and check empirically with the trained network. GPUAdvanced100 min
  5. 05Link prediction and knowledge graphsImplement TransE, DistMult, and RotatE on FB15k-237 with self-adversarial negative sampling and filtered-ranking evaluation. Study how edge splits and evaluation protocol can inflate results and compare a graph autoencoder for link prediction on a homogeneous graph. GPUAdvanced100 min
  6. 06E(n)-equivariant networks and molecular propertiesImplement EGNN, a network equivariant to rotations, translations, and reflections using 3D coordinates, and train it on QM9 to predict quantum properties. Before training, write a numerical equivariance test that architecture changes must pass, and compare with a geometry-free GNN and one using coordinates without symmetry. GPUAdvanced110 min
  7. 07Graph transformers and rigorous evaluationAdd Laplacian and random-walk positional encodings and implement a GPS layer combining local message passing with global attention. Compare with GIN on the ZINC subset under a fixed parameter budget, multiple seeds, component ablations, and significance tests, following benchmark methodology in the field. GPUResearch110 min
  8. 08GNNs on code graphs for vulnerability detectionApply the preceding methods to a problem close to your work: classify public C functions as vulnerable from their code property graphs. The central task is auditing duplicates, random versus temporal or project splits, and simple baselines to assess how much of a published metric holds up. GPUResearch120 min

Final deliverable

Custom Graph ML library with benchmark report

Package the library with equivariance and PyTorch Geometric equivalence tests, and publish a reproducible report of node, link, graph, and molecular results with seeds and intervals.

Check what you already know

  • Implement message passing with scatter operations and graph batching as a disjoint union
  • Derive GCN normalization and diagnose oversmoothing with depth
  • Train with neighbor sampling on a graph that does not fit in a single full forward pass
  • Construct two nonisomorphic graphs that 1-WL cannot distinguish and explain GIN's expressivity limit
  • Evaluate link prediction with filtered MRR and correct negative sampling
  • Numerically test a network's E(3) equivariance and explain its relevance to molecules

References