LLGA · Course notes

Advanced Graph Neural Networks

M2 · Advanced Graph Neural · Year 2 · Period 1

Contents

Introduction and overview

Module Advanced Graph Neural Networks
Code Not communicated — module announced by the master’s brochure; SynapseS 2026-2027 sheet not published (the S3/S4 tracks of the catalog are currently empty).
Team and workload LLGA team (École Polytechnique) · teaching hours and ECTS not communicated · the “research” continuation of the Graph ML module (M1 P2): expressive power and the Weisfeiler-Lehman test, over-squashing, positional encodings, graph transformers, temporal GNNs, robustness — up to industrial scale and the laboratory’s research.
Period M2 · period 1 (announced)
Status in the program M2 M2 program being finalized by the course instructors; official description not communicated until the sheet is published.

Audience: an engineer who has already trained a GCN or a GAT (M1 Graph ML) and has seen accuracy stall with depth, or two different molecules receive identical scores. Empirical first: we start from what fails in practice — information that does not get through a bottleneck, a GNN that cannot separate two regular graphs — and only then name the concepts that explain it: expressive power, positional encodings, graph transformers.

The module is the research follow-up to M1 Graph ML: the Weisfeiler-Lehman test, over-squashing, positional encodings, graph transformers, temporal graphs, scale and robustness. The official sheet is not published; these notes develop the themes announced by the brochure and flag what they add.

What you will be able to do

Official objectives and syllabus

Official syllabus: sheet not published — this module appears neither in the S3 track nor in the S4 track of the SynapseS 2026-2027 catalog (both currently empty), and the master’s wiki indicates that the detailed M2 curriculum is still under development: description, teaching hours and instructor are therefore “not communicated”. The themes below are those carried by the module in the master’s brochure, as restated by this material, mapped to its sections.

Announced theme (brochure, as restated by the material) Course section covering it
Message passing foundation and its limits (M1 Graph ML refresher) ch. 0 “Background: the message passing foundation”
Scaling: sampling, systems ch. 1 “Scale: sampling, systems”
GNN expressive power: the Weisfeiler-Lehman test ch. 2 “Expressive power: the Weisfeiler-Lehman test”
Over-squashing and deep GNNs ch. 3 “Over-squashing and deep GNNs”
Positional and structural encodings ch. 4 “Positional and structural encodings”
Graph transformers ch. 5 “Graph transformers”
Dynamic and temporal graphs ch. 6 “Dynamic and temporal graphs”
Robustness and privacy on graphs ch. 7 “Robustness and privacy on graphs”
LLGA team research and bridges (3D, algorithmic reasoning, GNN × LLM) ch. 8 “LLGA bridges: 3D, algorithmic reasoning, GNN × LLM” and ch. 9 “Research at DaSciM (Vazirgiannis, Lutzeyer)”

The exact split between brochure content and the material’s own deepenings can only be settled when the official sheet is published; in any case, chapters 0 (refresher), 8 (bridges) and 9 (team research) belong to the common structure of the repository’s materials.

Where this course fits in the program

An M2 module (period 1), whose official teaching volume is not communicated. It builds directly on the message passing foundation of Graph Machine and Deep Learning for Generative AI (M1 P2), reactivated in chapter 0. Downstream, it prepares Graph Generative Models and Applications, which builds graphs rather than analyzing them, and Fundamentals of Security and Robustness for AI (M2 P2), which recaps Nettack in one case study and a lab and takes the robustness chapter (ch. 7), where Nettack, its successors and the defenses are developed, as optional upstream reading.

Course outline

Session plan

24 h in class (assumed) = 8 sessions of 3 h. The sheet of this module publishes no volume: 24 h is the M2 volume published for the Large Language Models course (CSC_53432_EP: 24 h, 2 ECTS) and is assumed here. The split below is our proposal for covering these notes in that time. Level 1 = foundations (reviews, definitions, first worked examples), 2 = core methods, 3 = advanced theory; the level never goes down from one session to the next.

Session Hours Level Content Practice
1 3 h 1 ch. 0 Background: message passing and its limits; ch. 1 Scale: partitioning, sampling costs, benchmark hygiene lab: sampling vs full batch, seeds and confidence intervals
2 3 h 2 ch. 2 Expressive power: 1-WL, GNN ≤ 1-WL, GIN reaches 1-WL Ex. 1, 4
3 3 h 2 ch. 2 (continued) C6 vs 2×C3, the k-WL hierarchy, subgraph GNNs and motif counting Ex. 5
4 3 h 2 ch. 3 Over-squashing: Jacobian bound, Cheeger constant and spectral gap, curvature and SDRF, DIGL, APPNP and GCNII Ex. 6
5 3 h 2 ch. 4 Positional and structural encodings: LapEig and SignNet, RWSE, 3D invariants Ex. 2, 3
6 3 h 2 ch. 5 Graph transformers: Graphormer, GPS, Exphormer, when an MPNN is enough Ex. 7
7 3 h 2 ch. 6 Dynamic and temporal graphs: TGAT, TGN, fraud; ch. 7.1–7.2 Evasion and poisoning attacks Ex. 8, 9
8 3 h 2 ch. 7.3–7.5 Certification, privacy, structural fairness; ch. 8 LLGA bridges: 3D, algorithmic reasoning, GNN × LLM (soft tokens and graph–text alignment, worked) Ex. 10, 11; start Ex. 12 (project)

Self-study, outside the 24 h (about 3 h in total): ch. 9 Research at DaSciM — PathNN, GOAT, NGG, pseudo-code prompting (≈ 3 h).

How to study this module

independent note This module carries the graph half of the master up to the GNN × LLM crossroads. Whether you aim at research (PhD, research engineer) or at large-scale industrial GNNs, the habit to acquire is the same: diagnose expressive power and over-squashing before stacking layers.

0. Background: the message passing foundation

This chapter restates the M1 message passing GNN and the facts about it that the module assumes; its last item, over-smoothing, is the first of the limits that the following chapters study.

Review of the Graph ML module (M1 P2) — what is assumed known

  • Generic layer (M1, ch. 5): h_v^{(\ell+1)} = \phi\big(h_v, \mathrm{AGG}_{u \in \mathcal{N}(v)}\{\psi(h_v, h_u)\}\big) ; GCN (renormalized averaging, spectral derivation), GraphSAGE (sampling, inductive), GAT (edge attention);
  • Spectral (M1, ch. 4): Laplacian L = D - A, variational characterization of \lambda_2, spectral clustering as a RatioCut relaxation, convolution by Chebyshev polynomials — filtering = a polynomial of L;
  • Embeddings (M1, ch. 3): DeepWalk/node2vec and their NetMF reading (factorization of random-walk matrices); the PathNNs of ch. 9 are their generalization;
  • Link prediction / GAE (M1, ch. 6) and scale (M1, ch. 7: NeighborSampler, Cluster-GCN, GraphSAINT) — the ch. 1 below extends the latter;
  • Over-smoothing (M1, ch. 5): after many layers, all embeddings converge (proved on a regular graph: geometric convergence to the mean) — why one stops at 2-4 layers… and why this module exists.
  • Notation (the site-wide convention, as in Graph ML ch. 0): \tilde A = A + I, \quad \hat A = \tilde D^{-1/2} \tilde A \tilde D^{-1/2}, \quad P = D^{-1} A, \quad L = D - A, \quad L_{\mathrm{sym}} = I - D^{-1/2} A D^{-1/2} . \hat A is the GCN propagator and P the random walk, nothing else. Laplacian eigenvalues are listed in ascending order, 0 = \lambda_1 \leq \lambda_2 \leq \dots, so \lambda_2 is the spectral gap. Node features are rows, so a layer reads H W.

The module’s four research questions (1) How far can a GNN see? — expressive power (ch. 2); (2) How far can information travel? — over-squashing and depth (ch. 3); (3) Where am I in the graph? — position and structure (ch. 4); (4) At what scale and under what attacks? — systems (ch. 1) and robustness (ch. 7). Transformers (ch. 5) and the temporal dimension (ch. 6) answer “all-all” and “as time goes by” to these same questions.

1. Scale: sampling, systems

Real graphs have millions of nodes, and a careless experiment can make a method look better than it is. This chapter covers the systems side of training at scale and the experimental protocol (seeds, confidence intervals, leakage checks) that every later chapter relies on.

What is assumed known (M1, ch. 7)

NeighborSampler (fanouts, expansive neighborhood 1 + s_L(1 + s_{L-1}(\dots))), Cluster-GCN (METIS partitioning, partition bias), GraphSAINT (subgraphs + bias-free coverage normalization), and the bias/variance/memory triangle. Here: the systems layer and experimental hygiene.

2. Expressive power: the Weisfeiler-Lehman test

Which graphs can a message passing GNN tell apart, and which ones will it always confuse? This chapter answers exactly, with the Weisfeiler-Lehman test. A concrete scene: take two non-isomorphic 6-regular graphs. Your 3-layer GCN produces the same embeddings for both (up to permutation), and a link-prediction AUC around 0.5. This is not an implementation bug but the 1-WL bound, which this chapter makes operational before any architectural gadget is added.

The statement of this bound and of the GIN result is already in Graph ML, Proposition 5.1b. Here we prove both, then go beyond 1-WL.

What breaks Three classic mistakes: believing that a deeper GNN “sees more” (often false); evaluating only on graphs that 1-WL already separates (which gives a false sense of power); and ignoring the initial features (they fix the initial colors). All three mislead the reading of papers as much as a small molecular experiment.

Definition 2.1 — 1-WL (color refinement) Initialize a color c_v^{(0)} from the features; iterate: c_v^{(k+1)} = \mathrm{HASH}\Big(c_v^{(k)},\ \mathrm{SORT}\big\{c_u^{(k)} : u \in \mathcal{N}(v)\big\}\Big). Two graphs are 1-WL-equivalent if the multisets of colors coincide at convergence.

1-WL distinguishes almost all random graphs (Babai-Erdős-Selkow); but fails on simple families: regular graphs of the same degree, cycles, pairs of molecules discussed since the 1960s (CIR: chemical identity recognition).

Theorem 2.2 — GNN ≤ 1-WL (Xu et al., 2019; Morris et al., 2019) Any message passing GNN whose aggregation and update are functions (continuous, computable) cannot distinguish two 1-WL-equivalent graphs: if the initial colors coincide and the layers saturate the test, the embeddings coincide at every depth.

Proof. By induction on \ell.

  1. Initialization: initial colors = features, identical by assumption, so h_v^{(0)} = h_{v'}^{(0)} for every pair (v, v') of the same color.
  2. Heredity: if all nodes of color c have the same representation h_c, then the input of the aggregation at v is the multiset \{h_c : c \in \mathrm{multicol}_v\}. Now 1-WL-equivalence = equality of color multisets and of neighbor color multisets at each iteration — so AGG receives identical inputs, and h_v^{(\ell+1)} = h_{v'}^{(\ell+1)} .
  3. Readout: in the end, the readouts (permutation-invariant by construction, M1 ch. 2) see only the multiset of the h_v — identical on both graphs. ∎

Theorem 2.3 — GIN reaches exactly 1-WL (Xu et al., 2019) With sum + MLP and discrete features, h_v^{(k+1)} = \mathrm{MLP}^{(k)}\Big((1 + \epsilon^{(k)})\, h_v^{(k)} + \sum_{u \in \mathcal{N}(v)} h_u^{(k)}\Big) the GNN distinguishes exactly what 1-WL distinguishes.

Proof. The ingredient: on a countable domain, there exists an injective function f : \text{finite multisets} \to \mathbb{R}. Encoding each element by an integer (canonical log of a prime: c \mapsto \log p_c) gives \sum_i \log p_{c_i}, and the uniqueness of prime factorization ensures injectivity; a universal MLP approximates it.

Then the sum+MLP layer is injective in (h_v, \mathrm{multiset}(h_u)) — the pair (own color, neighbor multiset) is encoded without collision. By induction, two nodes have the same embedding \iff same 1-WL color. The injective sum readout concludes: GIN = 1-WL. ∎

Immediate consequences: mean and max are not injective — \{a, a, a\} and \{a\} have the same mean; \{a, a\} and \{a\} the same max. So GCN/GraphSAGE (mean) are strictly less powerful than GIN on categorical features.

In practice the difference shows up mainly on tasks where counting neighbors matters (molecules: \mathrm{CH}_4 vs \mathrm{CH}_3-\mathrm{CH}_3).

Example 2.4 — C6 vs 2×C3: 1-WL fails, the folklore pair test 2-FWL separates (demonstration)

  • 1-WL: all nodes have degree 2; by induction, at each round each node sees (its color, {its color, its color}). The colors remain uniform on each graph, and identical between the two graphs: indistinguishable.
  • 2-FWL (pair coloring, “folklore” rule): consider an adjacent pair (u, v). In the triangle, \{w : w \sim u, w \sim v\} counts 1 common vertex; in C6, this count is 0 (no triangles). The update aggregates for the pair (u,v) the multiset of joint colors \big(c(u, w), c(w, v)\big) over all w. It therefore encodes the number of triangles on each edge — the pair histograms differ: separated. ∎

Moral: a pair test with the joint rule (hence a pair GNN built on it) “counts the moments” that the local sum cannot see. Aggregating the colors of (u, w) and of (w, v) as two separate multisets is not enough: that is the 2-WL of the box below, which equals 1-WL and fails here too. To code in the lab (exercises 1 and 5).

k-WL and k-GNN hierarchy k-WL colors k-tuples of nodes. Two conventions coexist, so state which one you use.

  • k-WL (Morris, Grohe): a tuple is refined by k separate multisets, one per coordinate that can be replaced. In this convention 2-WL has exactly the power of 1-WL, and the hierarchy is strict from k = 2 on: (k+1)-WL distinguishes pairs that k-WL confuses.
  • k-FWL (“folklore”): for each w, the k tuples obtained by putting w in each position are read jointly, as in Example 2.4. Then k-FWL = (k+1)-WL; in particular 2-FWL = 3-WL.

For k of the order of n the test decides isomorphism, at exponential cost. Even 2-FWL fails on strongly regular graphs with the same parameters, such as the 4 \times 4 rook’s graph and the Shrikhande graph.

The k-GNNs (Morris et al., 2019) implement a local, set-based variant of k-WL: messages between neighboring k-sets — memory and compute cost \mathcal{O}(n^k): k = 2 practical, k = 3 reserved for small graphs (molecules). PPGN (Maron et al., 2019) reaches 2-FWL = 3-WL with matrix products on n \times n pair tensors. Morris et al.’s survey (JMLR 2023, “Weisfeiler and Leman go Machine Learning”) draws the complete map.

Model Power Cost
GCN / GraphSAGE (mean) < 1-WL \mathcal{O}(|E|)
GIN (sum+MLP) = 1-WL (= 2-WL) \mathcal{O}(|E|)
PathNN (ch. 9) SP+ and AP variants strictly > 1-WL (paths) path enumeration, exponential in the length for AP
GOAT (ch. 9) strictly > invariants (learned orders) \mathcal{O}(|E|)
2-FWL = 3-WL (PPGN) counts triangles, separates C6 from 2×C3; fails on strongly regular pairs \mathcal{O}(n^3) time, \mathcal{O}(n^2) memory
3-GNN (Morris, local) above 1-WL: a 3-set is typed by its induced subgraph, so triangles are seen \mathcal{O}(n^3)

Pragmatic alternatives: subgraphs and motif counting

  • ESAN (Equivariant Subgraph Aggregation Networks, B. Bevilacqua et al., 2022): each graph is described by a bag of subgraphs (ego-nets of each node, or “node-deletion” — the graph deprived of v); a shared 1-WL GNN encodes them, aggregation across subgraphs adds expressive power without full \mathcal{O}(n^k) cost — strictly above 1-WL and, for node-based policies, no stronger than 3-WL (Frasca et al., 2022);
  • Motif counting (Bouritsas et al., 2020): precompute counts of isomorphic subgraphs (triangles, paths, cycles) and inject them as features — “moments matter”: raising expressive power by preprocessing rather than by architecture; direct link with Example 2.4 (triangles) and with the MMDs of generative evaluation (M1, ch. 9.6);
  • Practical limits: more expressive power = more estimation variance and cost; on real benchmarks (Dwivedi et al., 2023), GIN vs GCN is decided by tenths — expressive power is the bottleneck only on structural tasks (counting, distinguishing) — cf. ch. 1.

3. Over-squashing and deep GNNs

Even when a GNN could in principle tell two nodes apart, the information may never reach them: messages from far away must squeeze through a few edges. This chapter defines this over-squashing precisely, links it to the geometry and spectrum of the graph, and presents the two families of remedies — changing the graph or changing the propagation.

Definition 3.1 — Over-squashing and its Jacobian bound (Alon & Yahav, 2021; Topping et al., 2022) Alon & Yahav named the phenomenon: a node must receive, in one fixed-size vector, information from a receptive field that grows exponentially with depth. Topping et al. made it measurable. The influence of the input feature x_u of a node u on the representation of a node v after \ell layers is the Jacobian \Big| \frac{\partial h_v^{(\ell)}}{\partial x_u} \Big| . There is over-squashing when this sensitivity is tiny for nodes u that the task needs, typically because it decays exponentially with the distance d(u, v).

The bound (Topping et al., 2022, Lemma 1). Take an MPNN whose layer is h_v^{(\ell+1)} = \phi_\ell\Big(h_v^{(\ell)}, \sum_{w} \hat A_{vw}\, \psi_\ell\big(h_v^{(\ell)}, h_w^{(\ell)}\big)\Big), with |\nabla \phi_\ell| \leq \alpha and |\nabla \psi_\ell| \leq \beta at every layer. If d(u, v) = r + 1, then \Big| \frac{\partial h_v^{(r+1)}}{\partial x_u} \Big| \leq (\alpha\beta)^{r+1} \big(\hat A^{r+1}\big)_{vu} .

Why: by the chain rule, the Jacobian is a sum over the walks of r+1 steps from u to v. Each step contributes at most \alpha\beta times the weight \hat A of the edge it crosses, and the weighted sum over walks is (\hat A^{r+1})_{vu}.

What makes the right-hand side small is the graph, not the network. Take a full binary tree rooted at v and one of its leaves u, at depth r + 1. The only walk of r + 1 steps between them is the path itself. With self-loops, the augmented degree is 3 at the root, 4 at the inner nodes and 2 at the leaf, so, for r \geq 1, (\hat A^{r+1})_{vu} = \frac{1}{\sqrt{3 \cdot 4}} \Big(\frac14\Big)^{r-1} \frac{1}{\sqrt{4 \cdot 2}} = \frac{4^{-r}}{\sqrt 6} . The influence of one leaf decays geometrically, while the number of leaves doubles at each level. Topping et al. quote 2^{-1}\,3^{-r}: the same path weighted by the walk matrix P = D^{-1}A instead of \hat A. Bottlenecks (bridges between communities) are where the walk weight is lost.

Proposition 3.2 — Bottleneck ⇔ small Cheeger constant ⇔ small spectral gap For a set S of nodes, let \partial S be the set of edges leaving S and \mathrm{vol}(S) = \sum_{v \in S} d_v. The Cheeger constant h_G = \min_{S \neq \emptyset,\ \mathrm{vol}(S) \leq \mathrm{vol}(V)/2} \frac{|\partial S|}{\mathrm{vol}(S)} is small exactly when two large parts of the graph are joined by few edges: a bottleneck. The Cheeger inequality ties it to the spectral gap \lambda_2 of L_{\mathrm{sym}}: \frac{\lambda_2}{2} \leq h_G \leq \sqrt{2 \lambda_2} .

So topological bottleneck ⇔ small \lambda_2: the bottom of the spectrum, not its top, carries the diagnosis. Every message between the two sides crosses the few edges of \partial S, and the walk weights of the bound above are small there.

Worked example: two triangles \{0,1,2\} and \{3,4,5\} joined by the bridge (2,3). The cut around one triangle gives h_G = \frac{1}{2 + 2 + 3} = \frac17, \qquad \lambda_2 \approx 0.205 \leq \frac27 . Adding the single edge (1,4) across the bridge gives h_G = \frac28 = \frac14 and \lambda_2 = 1 - \frac{1}{\sqrt 3} \approx 0.423 : one well-placed edge doubles the gap.

Hence the two families of remedies: change the topology (rewiring, below) or change the propagation (3.4).

3.3 — Discrete Ricci curvature and SDRF (Topping et al., 2022) The Ollivier-Ricci curvature of an edge (u,v) compares neighborhoods by optimal transport: \kappa(u, v) = 1 - \frac{W_1(\mu_u, \mu_v)}{d(u, v)}, \qquad \mu_u = \text{uniform law on } \mathcal{N}(u), W_1 = Wasserstein-1 distance (Optimal Transport module): “locally dense” edges (triangles) → large \kappa; bridges → negative \kappa.

Worked example (by hand):

  • edge of a triangle: \mu_u = \{\frac12 v, \frac12 w\}, \mu_v = \{\frac12 u, \frac12 w\}; transport plan: keep w (cost 0), transport \frac12 from v to u (cost 1) → W_1 = \frac12, \qquad \kappa = +\frac12 ;
  • edge of a hexagon C6: the best plan transports v \to t, s \to u (cost 1 each) → W_1 = 1, \qquad \kappa = 0 ;
  • bridge edge between two triangles (barbell): the best plan pays W_1 = \frac{1}{3}(1 + 1 + 3) = \frac53 , so \kappa = -\frac23 < 0 — the bridge is “hyperbolic”: it is the bottleneck.

Topping et al. prove that negatively curved edges are those responsible for over-squashing. Conversely, if every edge has curvature at least \kappa_0 > 0, then h_G \geq \kappa_0/2 (their Proposition 5): positive curvature everywhere forbids a bottleneck.

SDRF (Stochastic Discrete Ricci Flow) uses Topping et al.’s Balanced Forman curvature, a combinatorial curvature computed from the degrees of the two endpoints and the triangles and 4-cycles through the edge — much cheaper than a transport problem. Like \kappa, it is positive on triangle edges, zero on the edges of C6 and -\frac23 on the barbell bridge. At each iteration:

  1. take the edge (i, j) of minimal curvature;
  2. for each candidate edge (k, l) not yet present, with k equal or adjacent to i and l equal or adjacent to j, compute how much adding it would raise the curvature of (i, j); sample one candidate with a softmax of these improvements (a temperature sets how greedy the choice is) and add it — this creates a triangle or a 4-cycle around the bottleneck;
  3. remove the edge of maximal curvature if it exceeds a threshold (avoid densification).

Effect: the most negative curvatures rise, the bottleneck widens, and h_G and \lambda_2 typically increase — the edge (1,4) of the worked example of Proposition 3.2 is exactly such an addition. Looking at the graph as a geometric object — curvatures, distances, volumes — is one of the field’s great turns (cf. ch. 8 and the Geometric DL module).

DIGL — diffusion rewiring (Gasteiger, Weißenberger & Günnemann, NeurIPS 2019) A “filtering” alternative: replace A by a sparsified generalized graph diffusion S = \sum_{k=0}^{\infty} \theta_k\, T^k , with T a transition matrix of the graph (a random walk, possibly symmetrically normalized). Two classical choices of weights are personalized PageRank, \theta_k = \alpha(1-\alpha)^k, and the heat kernel, \theta_k = e^{-t} t^k / k!. S is then sparsified (top-k entries per column, or a threshold \varepsilon). Each node gains “virtual” edges toward its multihop neighbors weighted by the diffusion; simple, and the final GNN trains on the rewired graph.

Comparison: SDRF is topological (local curvature, targeted additions); DIGL is spectral (global diffusion). Diffusion scores across a bottleneck are small, so top-k sparsification keeps mostly edges inside communities: Topping et al. (Theorem 6) show that after PPR rewiring the Cheeger ratio of a cut stays below a fixed multiple of its old value, a factor set by \alpha and the degrees: a narrow bottleneck stays narrow. DIGL therefore helps on homophilous graphs more than against over-squashing. Both may destroy motif information: measure the trade-off in the lab (exercise 6).

3.4 — Deep GNNs: APPNP and GCNII APPNP (Klicpera et al., 2019) separates predicting from propagating: a network (often simple) predicts H = f_\theta(X); propagation follows personalized PageRank with the GCN propagator \hat A of ch. 0: Z^{(k+1)} = (1 - \alpha)\, \hat A\, Z^{(k)} + \alpha H . Fixed point: Z^* = \alpha \big(I - (1 - \alpha)\hat A\big)^{-1} H . The series expansion \sum_{k} \alpha(1-\alpha)^k \hat A^k shows that the effective depth is infinite without stacking parameters. Here \alpha is the PageRank teleport probability of Graph ML Definition 0.9: the restart term \alpha H keeps every node anchored to its own prediction and kills over-smoothing (M1, ch. 5.3); K iterations = truncation of the series.

GCNII (Chen et al., 2020) makes GCN truly deep through two mechanisms: H^{(\ell+1)} = \sigma\Big( \big[(1-\alpha_\ell)\, \hat A H^{(\ell)} + \alpha_\ell H^{(0)}\big]\big[(1-\beta_\ell) I + \beta_\ell W^{(\ell)}\big] \Big)

  • initial residual: the propagated \hat A H^{(\ell)} is mixed with the first layer H^{(0)} itself, not propagated — \alpha_\ell plays the role of APPNP’s teleport (typically \alpha_\ell = 0.1);
  • identity mapping: the weight matrix is pulled toward the identity, as in ResNet, with \beta_\ell = \log\Big(\frac{\lambda}{\ell} + 1\Big) \approx \frac{\lambda}{\ell} , where \lambda is a hyperparameter, not an eigenvalue (the paper uses 0.5 on the citation graphs and 1.0 on PPI). \beta_\ell decreases with depth: deep layers are close to the identity, so stacking them does not degrade the representation. With these two mechanisms, GCNII trains up to 64 layers.

Positioning: rewiring (3.3) changes the channel; APPNP/GCNII change the dynamics; graph transformers (ch. 5) remove the bottleneck by making the channel all-all; over-smoothing (representation) and over-squashing (channel) remain two distinct limits that must be diagnosed separately.

4. Positional and structural encodings

A GNN only sees the neighborhood of a node, not where the node sits in the whole graph. This chapter shows how to add this information as positional or structural encodings, and how to do it without breaking the invariances a GNN must respect.

Problem: GNNs “do not know where they are” Message passing is equivariant (M1, ch. 2): two nodes with isomorphic neighborhoods have the same embedding — correct… but insufficient: the global position (distance to the center, membership in a cycle, bridge role) is informative. Transformers had the same problem (token order) and solved it with positional encodings — we re-import the idea (and its pathologies).

Encoding Principle Notes
LapEig eigenvectors of L graph Fourier (M1, ch. 4); sign/base ambiguities
RWPE / RWSE return probabilities of the walk simple, robust, computed by hand below
SE(3)-invariant distances, angles, areas (3D molecules) ch. 8; Geometric DL module
Learned / anchor distances to anchor nodes inductive — recommended in production

4.1 — LapEig: the ambiguities, and SignNet to lift them Taking p_v = [u_2(v), \dots, u_k(v)] (coordinates of v on the eigenvectors) suffers from three pathologies:

  1. sign: -u_i is also an eigenvector — two runs give opposite encodings;
  2. basis: if \lambda_i is multiple, any rotation of the basis is admissible;
  3. instability: a small perturbation of the graph crosses the eigenvalues and makes the basis jump.

SignNet (D. Lim et al., 2023) builds functions invariant to the sign of each eigenvector: f(v_1, \dots, v_k) = \rho\Big( \big[\phi(v_i) + \phi(-v_i)\big]_{i=1}^{k} \Big), where [\cdot]_i is a concatenation and \phi, \rho are permutation-equivariant networks (for instance a GIN on the graph, with v_i as node feature). Each term \phi(v) + \phi(-v) is even, which gives sign invariance; the eigenvectors stay in their eigenvalue order.

Rotations inside a repeated eigenspace (pathology 2) are not handled by SignNet. For them, Lim et al. propose BasisNet, which reads each eigenspace through its projector V_i V_i^\top, a matrix that does not depend on the chosen basis.

The completeness result: a continuous function h is sign invariant if and only if h(v) = \phi(v) + \phi(-v) for some continuous \phi, so SignNet can represent every sign-invariant function. This mirrors the sum decomposition of Deep Sets (Zaheer et al., 2017) for multisets, the idea behind the injective sum of Theorem 2.3. In practice: LapEig + SignNet is the default PE of spectral graph transformers.

Example 4.2 — RWPE computed by hand (and why it matters) The random-walk positional encoding (RWPE, Dwivedi et al., ICLR 2022; called RWSE in GPS) of a node v is the vector of return probabilities \big[ (P)_{vv}, (P^2)_{vv}, \dots, (P^K)_{vv} \big], \qquad P = D^{-1} A. Computation:

  • node of a triangle: the back-and-forths give (P^2)_{vv} = \frac{1}{2}\cdot\frac{1}{2} + \frac{1}{2}\cdot\frac{1}{2} = \frac12 , and going around the triangle, in both directions, gives (P^3)_{vv} = 2 \times (\frac12)^3 = \frac14 ;
  • node of a hexagon C6: (P^2)_{vv} = \frac12 — identical (same back-and-forths); but (P^3)_{vv} = 0: a return of odd length requires an odd cycle, and C6 has none. At k = 6, every closed walk counts, not only the two full tours: a walk of 6 steps \pm 1 returns when it makes 0, 3 or 6 steps forward, so (P^6)_{vv} = \frac{\binom{6}{0} + \binom{6}{3} + \binom{6}{6}}{2^6} = \frac{22}{64} = \frac{11}{32} , the same value as for a node of the triangle, which also has 22 closed walks of length 6: only the odd lengths separate them.

Now C3 and C6 are exactly the pair that 1-WL cannot distinguish (Example 2.4). The RWSE — a single scalar, p_3, suffices here (\frac14 versus 0) — separates them immediately.

Structural PEs “buy” expressive power at cost \mathcal{O}(|E| K); this is why the winning models of positional benchmarks (ch. 5) systematically carry a PE.

4.3 — SE(3) invariants for molecules, and the theory of positions In 3D (ch. 8), the encoding must respect rotations/translations/reflections: invariants = interatomic distances \|x_i - x_j\|, angles, dihedrals; it is the continuous version of the principle “use only what is invariant”.

The theoretical question: how many coordinates to inject without breaking isomorphism invariance? A perfect positional encoding should distinguish the nodes of a regular graph (where 1-WL is constant) while remaining invariant under automorphism — canonical encodings (canonical numbering) make the learning variance explode; the practical compromise: relative encodings (RWSE, anchor distances, the SPD bias of ch. 5) — never absolute coordinates.

The inductive vs expressive debate Positional encodings partially “break” equivariance — a delicate choice between positional information and invariance guarantees. In industry (evolving graphs), one favors inductive PEs (generalizable to new nodes/graphs — RWSE, anchoring); in chemistry, exact invariants dominate. Cross-reference: Graphormer’s SPD bias (ch. 5) is a relative PE — the only category that survives both constraints.

5. Graph transformers

Attention lets every node exchange information with every other node in one step, which removes bottlenecks but forgets the graph. This chapter shows how graph transformers put the structure back into attention, what they cost, and when a plain message passing GNN is enough.

Idea: all-all attention + structural bias Global attention \mathcal{O}(n^2) removes bottlenecks and over-squashing at once (ch. 3); but without an encoding of the graph, a transformer on features alone is blind to structure: the topology must be reinjected via (i) positional encodings (ch. 4) and (ii) additive attention biases in the scores — structure steers attention rather than masking it.

5.1 — Graphormer (Ying et al., 2021) — the three structural encoders

  1. centrality encoding: an embedding of the degree (in/out if directed) added to the features — degree is the first “where am I”;
  2. spatial encoding: a bias learned per shortest-path distance: \mathrm{Attention}(Q, K)_{ij} = \frac{q_i^\top k_j}{\sqrt{d}} + b_{\phi(d_{ij})}, \qquad d_{ij} = \mathrm{SPD}(i, j), \quad b_{\phi(\cdot)} \text{ learned (table)}, with a dedicated value for d_{ij} = \infty (disconnected nodes); the bias is additive before the softmax — structure conditions attention;
  3. edge encoding: on the shortest path i \rightsquigarrow j, the mean of the embeddings of the crossed edges is added to the score — for molecules, the type of the bonds along the path matters.

Plus a global virtual node (connected to all) for the readout. Result: 1st rank on OGB-LSC PCQM4M (3.7M molecules) at its release. Implementation:

import numpy as np, torch, torch.nn as nn
from scipy.sparse.csgraph import shortest_path

def spd_matrix(adj):                                 # adj: (n, n) 0/1 NumPy array
    d = shortest_path(adj, unweighted=True)          # BFS from every node; inf if unreachable
    d[np.isinf(d)] = -1                              # -1 marks "unreachable"
    return torch.as_tensor(d, dtype=torch.long)

class GraphormerLayer(nn.Module):
    def __init__(self, d, h, max_spd=5):
        super().__init__()
        self.max_spd = max_spd
        self.attn = nn.MultiheadAttention(d, h, batch_first=True)
        self.bias = nn.Embedding(max_spd + 2, h)     # b_phi: 0..max_spd, plus one slot for "unreachable"
        self.ffn = nn.Sequential(nn.Linear(d, 2*d), nn.GELU(), nn.Linear(2*d, d))
    def forward(self, x, spd):                       # x: (1, n, d), one graph; spd: from spd_matrix
        idx = spd.clamp(max=self.max_spd)            # long distances share the last slot
        idx = torch.where(spd < 0, torch.full_like(spd, self.max_spd + 1), idx)
        b = self.bias(idx).permute(2, 0, 1)          # (h, n, n) = (batch * heads, n, n) for a batch of 1
        x = self.attn(x, x, x, attn_mask=b)[0] + x   # a float attn_mask is added to the scores
        return self.ffn(x) + x

Two details: nn.MultiheadAttention takes the additive bias as a float attn_mask of shape (batch · heads, n, n); and the dedicated slot max_spd + 1 keeps disconnected pairs apart from distant ones. The per-head bias is an embedding table indexed by the distance matrix (exercise 7).

5.2 — GPS (Rampasek et al., 2022): the two channels, layer by layer H^{(\ell+1)} = \mathrm{MLP}\Big( \mathrm{BN}\big(\underbrace{\mathrm{MSA}(H^{(\ell)} + \mathrm{PE})}_{\text{global channel}} \;+\; \underbrace{\mathrm{MPNN}(H^{(\ell)}, A)}_{\text{local channel}}\big) \Big) — global attention (all-all; kills over-squashing) + local message passing (locality bias, convolution); PE injected at the input (ch. 4); graph batches by concatenation-padding.

Per-layer complexity: \mathcal{O}(n^2 d) (attention) + \mathcal{O}(|E| d) (MPNN) — the global channel dominates. GPS is a recipe: any MPNN (GCN, GINE, GAT) and any PE (RWSE, LapEig+SignNet) plug into it — hence its status as the reference framework.

5.3 — Efficient transformers: Exphormer and sampled attention For large n (ogbn-products…), \mathcal{O}(n^2) no longer fits; Exphormer (Shirzad et al., 2023) replaces full attention with a sparse attention graph:

  1. the edges of the real graph;
  2. the neighbors of a random d-regular expander graph — an expander has a spectral gap bounded away from zero and a logarithmic diameter: information crosses the graph in \mathcal{O}(\log n) layers, precisely what ch. 3 demands (no bottleneck, by Proposition 3.2);
  3. global virtual nodes.

Complexity linear in n + |E|; combined with the local MPNN, this gives “Exphormer-GPS”, the scalable state of the art.

Generalization: sampled attention (neighborhood, kernels, hashing) — the same recipes as the long-context transformers of the M2 LLMs module, transposed: the graph transformer and the LLM live the same algorithmic life.

5.4 — When is an MPNN enough? (decision guide)

  • homophilous graph, local dependencies (Cora, transactional fraud): GCN/GAT 2-3 layers — no point paying n^2;
  • motifs, distances, long-range dependencies (molecules, QA over KGs): transformer or ESAN (ch. 2) — structure exceeds the neighborhood;
  • large n: MPNN + sampling (ch. 1) or Exphormer;
  • empirical benchmark rule (Dwivedi et al., 2023): at equal size, the gain of the transformer over MPNN+PE is real but modest — the hybrid (GPS) wins most often; the PE is the dominant factor, the architecture second.

LLGA connection: “attention = complete dynamic graph” versus “GNN = attention on a given graph” (M1, ch. 5); Graphormer is the synthesis — a given and learned attention — the transformers ↔︎ GNN convergence is THE guiding thread of the master.

6. Dynamic and temporal graphs

Many graphs change over time — transactions, edits, interactions — and the order of events carries the signal. This chapter presents the two ways of representing such graphs and the two reference architectures, TGAT and TGN.

Two formalisms: snapshots vs event-based

  • snapshots: G_1, G_2, \dots, G_T (graph aggregated per window); models: GCN+RNN (encode each snapshot, make recurrent); simple, but the granularity loses the order within the window;
  • event-based: the stream of timestamped interactions (u, v, t_1), (u, w, t_2), \dots — the “true” formulation of the problem; it is the regime of fraud (millisecond) and sequential recommendation.

6.1 — TGAT (Xu et al., 2020): encoding time Event-based models predate it (JODIE and DyRep, 2019, keep a recurrent state per node); TGAT injects time into attention: a learned sinusoidal temporal encoding (in the spirit of Time2Vec) \phi(\Delta t) = \big[\cos(\omega_1 \Delta t), \sin(\omega_1 \Delta t), \dots, \cos(\omega_d \Delta t), \sin(\omega_d \Delta t)\big], \qquad \omega_i \text{ learned}, concatenated with the features. Attention is computed over the strictly past neighborhood \mathcal{N}(v; t) = \{u : (u, v, t') \in E,\ t' < t\} — a causal GAT; inductive by construction (new nodes = new times).

6.2 — TGN (Rossi et al., 2020): the modules and their equations TGN factorizes temporal memory:

  1. memory s_i(t) \in \mathbb{R}^d: a recurrent state per node, summarizing its history;
  2. message: at each event (i, j, t), m_i^t = \mathrm{msg}(s_i(t^-), s_j(t^-), \Delta t, e_{ij}) (likewise for j, symmetric);
  3. update: s_i(t) = \mathrm{GRU}\big(s_i(t^-),\ \mathrm{agg}(\{m_i^{t'} : t' \leq t\})\big) — only the nodes touched by the batch are updated; the memory of a node without events stays as it is, and its staleness is compensated by the embedding module below, which reads the memories of its neighbors;
  4. embedding: z_i(t) computed by a TGAT-type module over the memory \{s_u(t^-) : u \in \mathcal{N}(i; t)\} + the time encoding \phi — memory is a compressed summary, the embedding an attentive reading.

Training: strictly causal — batches are ordered by time. If the memory were updated with the events of the current batch before predicting them, the model would see the answers. TGN therefore keeps a raw message store: for each batch, the memory is first updated with the raw messages stored from previous batches, then the embeddings predict the current interactions, and finally the raw messages of the current batch are stored for the next one. The memory-related modules (message function, aggregator, GRU) thus receive a gradient without leakage.

Future link prediction loss: score (i, j, t) against negatives (M1, ch. 6, temporal version). The paper’s ablation (Wikipedia): removing the memory costs nearly 4 points of average precision, and replacing the graph embedding module by the node’s own memory (TGN-id) loses by a large margin — both the long-term memory and the attentive reading of the neighbors matter.

6.3 — LLGA application: real-time fraud The transaction graph is event-based by nature: a fraudulent card must be blocked in seconds. The pipeline:

  1. TGN encodes the accounts (memory = past behavior);
  2. a head classifier reads z_i(t) at the moment of the transaction;
  3. the negatives are old legitimate transactions — beware temporal contamination (train strictly before t: the temporal-split protocol of Graph ML 5.6–5.8, with its worked leakage example);
  4. in production: incremental memory update, model drift to monitor.

Lab datasets: Wikipedia edits / Reddit (TGN standards, with banned-user labels for dynamic node classification), and anonymized transaction banks such as Elliptic. Variants: CAWN (attention by causal walks), compressed memorization; the state-of-the-art survey lives on the temporal graph learning side. A TGN detector under attack and drift is the core of the end-of-year project Y2.5, which reuses exercises 8 and 9.

7. Robustness and privacy on graphs

Graph models are exposed to attackers who can add or remove a few edges, and graph data often reveals private information. This chapter studies attacks at test and training time, defenses and certification, then privacy and fairness on graphs.

7.1 — Nettack (Zügner, Akbarnejad & Günnemann, 2018): greedy search on a linearized surrogate The scenario: a target node u and its class y_u; budget: \Delta modifications (edge additions/removals, feature changes), applied at test time (evasion) or before retraining (poisoning) — the paper reports both. The attacker’s dilemma: the model is not differentiable in the discrete structure. Nettack’s solution, the one summarized in Security, Case study 9.2:

  1. train a linearized surrogate: a two-layer GCN without its nonlinearity, whose logits are \hat A^2 X W ;
  2. exact score of each candidate (flip of an edge, or of a feature): the surrogate margin of the target after the flip, \mathcal{L}_s = \max_{c \neq y_u} \big[\hat A^2 X W\big]_{uc} - \big[\hat A^2 X W\big]_{u y_u} . For an edge, one flip changes only a few entries of \hat A^2, which are updated incrementally in constant time. For a feature, the margin is linear in X, so its gradient gives the exact score;
  3. greedily apply the best candidate and repeat until the budget is spent. Unnoticeability constraints keep the attack discreet: the perturbed degree distribution must pass a likelihood-ratio test against the clean one, and added features must co-occur plausibly with existing ones.

Gradient-based structure attacks exist too — FGA (Chen et al., 2018) ranks edges by the gradient of the loss with respect to A, and Metattack (7.2) uses meta-gradients — but Nettack scores discrete flips exactly.

Historic result: a few flips suffice to flip the prediction — and the attacks transfer to the true GCN (the surrogate suffices). The LLGA lesson: in fraud detection, the attacker knows the model (or its shadow); robustness is a design requirement, not an option.

7.2 — Poisoning: Metattack (Zügner & Günnemann, 2019) An attack at training time (poisoning): the graph is corrupted before learning. Bilevel: \min_{\delta}\ \mathcal{L}_{atk}\big(f_{\theta^*}(A + \delta)\big) \quad \text{s.t.} \quad \theta^* = \arg\min_\theta \mathcal{L}_{train}\big(f_\theta(A + \delta)\big), solved by meta-gradient: a few inner gradient steps are unrolled (differentiable), and the outer gradient flows back to \delta.

MAML in three lines (Finn, Abbeel & Levine, 2017). Model-agnostic meta-learning learns an initialization \theta such that one or a few gradient steps on a new task, \theta' = \theta - \eta \nabla_\theta \mathcal{L}_{task}(\theta), already perform well. Its outer gradient differentiates through these inner steps. Metattack uses the same unrolled differentiation, with respect to the graph instead of the initialization.

The attack loss needs labels that the attacker does not have on unlabeled nodes. Meta-Self trains a surrogate on the labeled nodes, takes its predicted labels on the unlabeled ones (self-training) and sets \mathcal{L}_{atk} = -\mathcal{L}_{self}, the negated loss on these pseudo-labels; Meta-Train uses -\mathcal{L}_{train} instead. In both, the attacker controls no label — only the graph.

Structural defenses:

  • pruning (attack edges are often “suspicious” — large feature distances);
  • purification (Pro-GNN: learn a clean graph A' regularized close to A while training the GNN);
  • robust GCN (RGCN, Zhu, Zhang, Cui & Zhu, KDD 2019): Gaussian layers whose variance absorbs the attack + attention over reliable neighbors.

7.3 — Certification: sketch Guarantee that no attack of budget \Delta changes the prediction: by randomized smoothing applied to graphs (majority over graphs perturbed by random flips, as in Security ch. 5) or by convex relaxations of the network (Zügner & Günnemann, KDD 2019, for feature perturbations, with a robust training that enlarges the certified set). The state of the art certifies small budgets on moderate GCNs: in practice, one combines partial certification + the defenses above + monitoring (detecting edge-addition anomalies).

7.4 — Privacy: node-DP, edge-DP, reidentification

  • edge-DP: the basic mechanism is randomized response on the adjacency matrix — each pair of nodes is reported truthfully with probability p > \frac12 and flipped otherwise. This is \varepsilon-edge-DP with \varepsilon = \ln \frac{p}{1 - p} , the convention of Privacy & UQ, Proposition 4.2 (exercise 10). With a trusted curator, a counting query (how many edges between two groups?) can instead receive Laplace noise of sensitivity 1;
  • node-DP: much harder — sensitivity explodes with the degree (removing a node removes d edges); recipe: project the graph onto a graph of bounded degree k (keep the k “most important” neighbors), then apply the edge mechanisms; the price: bias on hubs;
  • reidentification: graph embeddings (M1, ch. 3) are fingerprints — re-routing an “anonymized” node into a public graph by comparing neighborhoods (attacks by degrees, by subgraphs — the Narayanan-Shmatikov attack transposed); GraphRAG (M1, ch. 10) aggregates scattered facts: the reidentification risk grows with the quality of the graph;
  • evaluation: measure the utility-privacy trade-off (AUC vs \varepsilon); cross-reference with the M2 security module for LLMs (prompt injection over the KG, leakage by generation).

7.5 — Structural fairness Degree bias: low-degree nodes (minorities in social networks, new customers) are predicted less well — fewer messages = less signal; remedies: structural features (RWSE, ch. 4), virtual edges, degree-based resampling, reweighted losses; open question: structural fairness (communities) vs individual fairness (nodes) can conflict — the exact counterpart of the fairness tensions of the Optimal Transport module (transporting node distributions; homophily bias: a homophilous GNN propagates label biases).

8. LLGA bridges: 3D, algorithmic reasoning, GNN × LLM

This chapter connects the module to the other axes of the master: geometric graphs (3D molecules), GNNs that learn to execute algorithms, and the combination of GNNs with LLMs.

8.1 — 3D molecules: EGNN and E(n) equivariance (Satorras, Hoogeboom & Welling, 2021) The positions x_i \in \mathbb{R}^3 make the molecular graph geometric; physics is invariant under rotations/translations (E(3)); a GNN that respects this symmetry by construction learns better with less data (Bronstein et al., the Geometric DL “charter”).

Recall. The EGNN layer and the proof of its E(n)-equivariance are in Graph ML, Proposition 8.3. In short, the messages read only invariant distances, m_{ij} = \phi_e\big(h_i, h_j, \|x_i - x_j\|^2, e_{ij}\big), and each position moves along the differences x_i - x_j, weighted by \phi_x(m_{ij}). Under x \mapsto Qx + t with Q orthogonal, the features are unchanged and the positions follow.

What this module adds:

  • applications: 3D property prediction (invariant features into a readout) and learned molecular dynamics (equivariant outputs as forces);
  • the bridge to diffusion: an EGNN is the denoiser of equivariant diffusion models — EDM (Hoogeboom et al., ICML 2022) generates atom types and coordinates jointly, GeoDiff (Xu et al., ICLR 2022) generates the conformers (3D coordinates) of a given molecular graph. With an equivariant denoiser, an isotropic prior and centered coordinates, the learned density is invariant to rotations and translations;
  • the M2 Geometric DL module generalizes to groups; M1 ch. 9 covers the 2D version, and Graph Generative Models takes over the generation side.

8.2 — Neural algorithmic reasoning (Veličković et al.) Learning to execute algorithms with GNNs: encode inputs as a graph (sorting: a list = a comparison graph; shortest paths: the graph itself), execute via message passing layers, decode outputs — the black-box replaces the code.

The CLRS benchmark (Veličković et al., ICML 2022) tests faithful execution of classical algorithms (CLRS = Cormen, Leiserson, Rivest, Stein). Results: GNN processors generalize to unseen sizes better than transformers on certain families (structural induction).

The LLGA lesson: a learned algorithm is differentiable (it can be inserted into an end-to-end trained pipeline: routing, scheduling, matching) and approximately robust (noisy inputs); at the price of exactness — the trade-off to master.

Routing is the natural target: shortest paths and minimum spanning trees are CLRS tasks, and the end-of-year project Y2.4 puts a learned router next to an exact solver.

Loop with Refresher CS: what more can a “learned algorithm” do than an algorithm? Answer: train on data, slot into gradient descent — and the pseudo-code prompting of ch. 9.4 is the dual path (the LLM simulates the execution; NAR embodies it).

8.3 — GNN × LLM: injected encoders, alignment and benchmarks Three injection architectures. The site-wide taxonomy is the one of Graph ML 10.2 (soft tokens, structural recall, cross-distillation); the table maps the names used here onto it.

Architecture (here) Graph ML 10.2 What is trained Examples
structural tokens: GNN outputs projected into the LLM’s embedding space; the LLM reads structure as a language (a) soft tokens the projector (and the GNN); LLM frozen or LoRA GraphGPT (Tang et al., SIGIR 2024), G-Retriever (He et al., NeurIPS 2024)
structural recall: the GNN or a graph traversal retrieves the relevant facts, the LLM writes — “graph-RAG” (b) structural recall the retriever GraphRAG (Graph ML 10.1), the subgraph retrieval of G-Retriever
LLM annotator: the LLM enriches node features (summaries, explanations, types) for the GNN — the text-attributed graph (“TAG”) regime (c) cross-distillation, LLM → GNN direction the GNN, on the LLM-enriched features TAPE (He et al., ICLR 2024) on ogbn-arxiv

Worked: soft tokens. A node v, or each node of a small retrieved subgraph, is encoded by a GNN into z_v \in \mathbb{R}^{d_g}. A two-layer MLP projector maps it to the width d_{\mathrm{LLM}} of the LLM’s token embeddings: t_v = W_2\, \mathrm{GELU}(W_1 z_v) \in \mathbb{R}^{d_{\mathrm{LLM}}} . The vectors t_v are inserted before the embeddings of the prompt tokens, as if they were extra words. The LLM stays frozen (or LoRA-adapted, LLM 4.3); the projector, and possibly the GNN, are trained with the next-token loss on the answer tokens only.

Sizes: with d_g = 256, a hidden width of 1,024 and d_{\mathrm{LLM}} = 2{,}048 (a 1B-parameter LLM), the projector has about 2.4M parameters — negligible next to the LLM.

Worked: graph–text alignment. Soft tokens work better when the two spaces already agree. Take a batch of B nodes with GNN embeddings z_i and text embeddings c_i of their descriptions (title and abstract of a paper, for instance). Two linear heads map them to a common space, normalized to unit length: a_i = \frac{W_g z_i}{\|W_g z_i\|}, \qquad b_j = \frac{W_t c_j}{\|W_t c_j\|}, \qquad s_{ij} = \frac{\langle a_i, b_j \rangle}{\tau}, with a temperature \tau. The symmetric InfoNCE loss, as in CLIP, treats each matching pair as the positive and the other B - 1 items of the batch as negatives, in both directions: \mathcal{L} = -\frac{1}{2B} \sum_{i=1}^{B} \Big[ \log \frac{e^{s_{ii}}}{\sum_j e^{s_{ij}}} + \log \frac{e^{s_{ii}}}{\sum_j e^{s_{ji}}} \Big] .

By hand, with B = 2 and the score matrix S = \begin{pmatrix} 2 & 0 \\ 0.5 & 1.5 \end{pmatrix} :

  • graph → text (rows): \log(1 + e^{-2}) = 0.127 and \log(1 + e^{-1}) = 0.313;
  • text → graph (columns): \log(1 + e^{-1.5}) = 0.201 twice;
  • hence \mathcal{L} = \frac{0.127 + 0.313 + 0.201 + 0.201}{4} \approx 0.211 .

The loss falls as the diagonal dominates each row and each column. After alignment, a node can be retrieved from a text query and the reverse, and zero-shot classification works by matching a node with the texts of the class names. Exercise 11 runs this on ogbn-arxiv.

Benchmarks: NLGraph (serialized reasoning — M1, ch. 10.2), Talk like a Graph (encodings: none dominates everywhere), and the industrial GraphRAG suites.

Industrial GraphRAG (summary; details in M1, ch. 10): LLM extraction → entity graph → Leiden communities + summaries → local/global queries; the M2’s role: the quality of the graph (robust communities — ch. 7; KGC completion — M1 ch. 6) is the system’s bottleneck; the rare specialty the master builds: both GNN theory and the LLM pipeline. The GNN retriever and the graph tokens of this section are two options of the end-of-year project Y2.1 (biomedical question answering on STaRK-Prime).

8.4 — What the master expects of you here Knowing how to choose: MPNN vs transformer (ch. 5), with or without PE (ch. 4), deep or rewired (ch. 3), certified or not (ch. 7) — and knowing how to prove the theorems of ch. 2, reproduce the experiments of ch. 9, and read a paper of the field in one hour. This is the “entry-level research / advanced R&D” level.

9. Research at DaSciM (Vazirgiannis, Lutzeyer)

The DaSciM laboratory (LIX, École Polytechnique — M. Vazirgiannis, J. Lutzeyer) is the master’s host laboratory: this chapter studies its papers in depth, positioning them relative to the program. General-audience introductions were given in M1 (ch. 11); here we go into the machinery.

9.1 — Path Neural Networks, in depth (Michel, Nikolentzos, Lutzeyer & Vazirgiannis, ICML 2023) Starting point: the canonical GNN layer aggregates 1-hop neighbors (M1, ch. 5); stacking L layers amounts — when all goes well — to aggregating walks of length L. But

  1. walks repeat nodes (backtracking — redundant information);
  2. composing layers degrades (over-smoothing/squashing, ch. 3);
  3. 1-WL — hence the GNN (th. 2.2) — aggregates only multisets of colors, without the sequence of the route.

The path operator: for each node v and each length \ell \leq K, take a collection \mathcal{P}_v^{(\ell)} of simple paths (without repeated nodes) of length \ell starting from v. Each path is encoded by an LSTM run over the node representations along it, ending at v, and the codes are summed: m_p = \mathrm{LSTM}\big(h_{u_\ell}^{(\ell-1)}, \dots, h_{u_1}^{(\ell-1)}, h_v^{(\ell-1)}\big), \qquad h_v^{(\ell)} = \mathrm{COMBINE}\Big(h_v^{(\ell-1)}, \sum_{p \in \mathcal{P}_v^{(\ell)}} m_p\Big). Three variants choose the collection of paths, each contained in the next (SP ⊆ SP+ ⊆ AP):

  • PathNN-SP: a single shortest path for each pair of nodes — captures distances: two nodes “close to everyone” versus “peripheral” separate;
  • PathNN-SP+: all shortest paths between each pair — also counts how many geodesics join two nodes;
  • PathNN-AP: all simple paths of length up to K — the most expressive and the most expensive, so K stays small (5 in the paper’s synthetic experiments).

There is no random-walk variant: the point of the operator is to use paths that, unlike walks, repeat no node (problem 1 above).

Complexity: \mathcal{O}(P \cdot K \cdot d^2) per node for P paths of length at most K — of the same order as a GAT if P \sim \bar d. For AP, P grows exponentially with K in dense graphs.

Results: on graph classification and regression — six TU datasets (DD, NCI1, PROTEINS, ENZYMES, IMDB-B, IMDB-M, with the 10-fold protocol of Errica et al., 2020), ogbg-molhiv, ZINC12K, Peptides-func and Peptides-struct — PathNN matches or exceeds GIN/GCN in most cases; on tasks where the geometry of routes carries the signal (molecules: paths are chemical chains!), the gain is clear.

Theoretical positioning: the paper proves that PathNN-SP+ and PathNN-AP are strictly more powerful than 1-WL, and PathNN-AP even separates strongly regular graphs that 3-WL confuses. Simple paths carry information that walk multisets ignore. Recall C6 vs 2×C3 (Example 2.4): a node of 2×C3 has no simple path of length 3, since its component has three nodes, while a node of C6 has two. Ordered recurrent aggregation is also the tool of GOAT (below), and PathNN is the subject of the “paper” exercise (exercise 12).

9.2 — GOAT (Chatzianastasis, Lutzeyer, Dasoulas & Vazirgiannis, AAAI 2023) Introduced in M1 (ch. 11.3), which also links its learned order to the node-ordering problem of autoregressive graph generation. GOAT itself is not a generative model: it learns node representations, and here we study its expressive power. The invariant aggregator \mathrm{AGG} (th. 2.2–2.3) bounds the GNN to 1-WL precisely because it is invariant.

GOAT learns a local order by attention (scoring neighbors by (h_v, h_u), sorting), then processes the sequence with an RNN — a sequence model inside the graph. It is strictly more expressive than invariant aggregation (it distinguishes identical distributions of a multiset as soon as the order carries signal), while remaining globally equivariant (the order is a learned function of the representations, not an external numbering).

Positioning in M2: an architectural answer to the question of ch. 2 — gain expressive power without paying \mathcal{O}(n^k); and an answer to ch. 4 — the local order is a learned positional encoding.

9.3 — NGG (Evdaimon et al., 2024): conditioned latent generation The bridge M1-ch. 9 ↔︎ diffusion: a GNN encoder projects graphs into a compact latent space; a diffusion model (M1, ch. 9.5 — Multimodal GenAI) learns the distribution there conditioned on structural features (spectrum, degrees, counts); the decoder regenerates graphs exhibiting the requested features.

The interest for M2: latent diffusion bypasses discretization (continuous diffusion in \mathbb{R}^d rather than over DiGress’s categories), and the spectral conditioning connects generation to ch. 3 (the spectrum governs communication — here, it governs the shape of the generated graphs). LLGA applications: faithful synthetic data (pre-training!), distributional anonymization, anomaly detection (a real graph far from the latent support).

9.4 — Pseudo-code prompting (Skianis, Nikolentzos & Vazirgiannis, 2024) Presented in M1 (ch. 10) as a GraphRAG tool; the M2 reading: a benchmark of algorithmic reasoning — LLMs execute graphs described in pseudo-code better than in natural language (systematic gains); to be connected with neural algorithmic reasoning (ch. 8): two ways of making algorithms run on graphs — by a prompted LLM, or by a trained GNN.

Exercises

  1. ★ 1-WL by hand. Run 1-WL on C6 and 2×C3 and verify indistinguishability (detail Example 2.4); then on the “house” graph (square + roof) versus the pentagon; conclude on the exact family of indistinguishable pairs.

    Partial solution: the house has degrees 3, 3, 2, 2, 2 — the two eaves, where the roof meets the square, have degree 3, and the roof top has degree 2 (an even number of odd degrees, as the handshake lemma requires). The pentagon is 2-regular, so 1-WL distinguishes them from iteration 1 (initial color = degree).

    Generalization: 1-WL confuses every pair of d-regular graphs with the same number of nodes, since all colors stay equal — for instance all unions of cycles with the same total number of nodes. It also confuses non-regular pairs: two graphs are 1-WL-equivalent exactly when they admit equitable partitions with the same cell sizes and the same numbers of neighbors between cells (fractional isomorphism: Tinhofer, 1986; Ramana, Scheinerman & Ullman, 1994).

  2. ★ LapEig. Compute the first 2 nontrivial eigenvectors of the Laplacian of the karate club graph; project the nodes; verify that the visualized separation ≈ the actual partition; rerun 5 times and observe the sign flips; implement the SignNet correction (ch. 4.1) and measure stability (distance between the encodings of two runs).

    Partial solution: \rho\big([\phi(v_i) + \phi(-v_i)]_{i}\big) with MLPs \phi, \rho — each even term is invariant under the flip of its eigenvector; compare with the baseline “sign fixed by the first positive component” (unstable at nodes of near-zero value).

  3. ★ RWSE by hand and in code. Recover the computations of Example 4.2 (triangle vs hexagon), then compute the RWSEs (K = 4) of all nodes of the karate club graph. Show that two nodes exchanged by an automorphism always get the same RWSE. Then take the 2-regular graph C3 ∪ C6 (disjoint union), where all nodes are 1-WL-equivalent, and show that RWSE separates the triangle’s nodes from the hexagon’s. Explain why automorphism invariance is both a feature (the encoding does not depend on the numbering) and a limit (no such encoding separates automorphic nodes, even when a task needs it).

    Partial solution: let \Pi be the permutation matrix of an automorphism \sigma. Then \Pi A \Pi^\top = A, \quad \text{so} \quad \Pi P^k \Pi^\top = P^k \quad \text{and} \quad (P^k)_{\sigma(v)\sigma(v)} = (P^k)_{vv} . In C3 ∪ C6, (P^3)_{vv} = \frac14 on the triangle and 0 on the hexagon.

  4. ★★ GIN vs GCN. Show that the mean is not injective on multisets (give the counterexamples {a, a, a} vs {a} and {a, a, b, b} vs {a, b}) and that sum+MLP is (discrete features); check experimentally: train GIN and GCN on a 1-WL-indistinguishable pair and measure.

    Partial solution: mean: {a, a, a} → a and {a} → a (collision); discrete sum: encode a by \log 2, b by \log 3 — \{a,a,b,b\} \mapsto 2\log 2 + 2\log 3 = \log 36 and \{a, b\} \mapsto \log 6 — no collision by uniqueness of factorization (th. 2.3); in practice, the mean does better on continuous real features — discuss why (estimation variance).

  5. ★★ Minimal pair GNN. Implement a pair GNN with the folklore rule of Example 2.4: a representation h_{uv} per pair, updated from the multiset of (h_{uw}, h_{wv}) over all w. Verify that it separates C6 and 2×C3 (disjoint readout outputs) where GIN fails. Then implement the 2-WL rule (two separate multisets) and check that it fails, as the k-WL box predicts.

    Hint: start with hashed colors (exact 2-FWL and 2-WL) before learning. With dense tensors, the sum over w of h_{uw} \odot h_{wv} is one matrix product per channel — the trick of PPGN.

  6. ★★ Over-squashing. Build two “communities” connected by a single bottleneck node; measure the classification performance of a GCN as a function of the distance to the bottleneck; compare GPS (ch. 5), GCN + SDRF and GCN + DIGL. Plot the spectral gap \lambda_2 of L_{\mathrm{sym}} (or the effective resistance between the two sides) before and after rewiring, with the Jacobian sensitivity of Definition 3.1 computed by autograd.

    Partial solution (expected): gradient of accuracy with distance for the GCN; GPS nearly uniform. With two random communities of 30 nodes (edge probability 0.3), three edges added across the bottleneck raise \lambda_2 from about 0.003 to about 0.02. DIGL (PPR with teleport 0.15, top-8 per node) only reaches about 0.005, as Theorem 6 of Topping et al. predicts.

    The effective resistance R_{uv} = (e_u - e_v)^\top L^{+} (e_u - e_v) across the bottleneck falls accordingly (Black et al., 2023); the curve of accuracy against \lambda_2 is the graph to produce.

  7. ★★ Graphormer-PE. Implement the attention bias by shortest-path distance (distance matrix by BFS; learned bias table — skeleton in ch. 5.1); train on ogbg-molhiv and compare GCN / GIN / Graphormer-mini; report means ± standard deviations over 5 seeds.

    Partial solution: BFS \mathcal{O}(n(|V| + |E|)) per graph — precompute; clamp distances at a max_spd read from the distance histogram of the training molecules, with a separate slot for unreachable pairs (code of 5.1); expected: a small but systematic gain of the SPD bias over GCN.

  8. ★★ Temporal. On a standard TGN dataset (Wikipedia/Reddit): train a TGN (torch_geometric.nn.models.TGNMemory from PyTorch Geometric, or the paper’s code); ablation: remove memory (keep the TGAT embedding); plot the AUC of future link prediction as a function of the horizon \Delta t.

    Partial solution (expected): memory dominates on recent interactions; without memory, the AUC drops by several points at small \Delta t (the information of the last events is no longer compressed).

  9. ★★ Attack. Implement a Nettack-style structure attack on a target node (ch. 7.1): train the linearized two-layer surrogate, score every candidate edge flip by the exact surrogate margin after the flip, apply the best one and repeat k times. Measure the prediction flip rate of a normally trained GCN against the budget k; test a defense (RGCN or training on perturbed graphs).

    Partial solution: with \hat A^2 updated incrementally, each candidate is cheap to score. Compare with the gradient ranking of FGA (magnitude of the gradient of the attack loss per candidate edge), cheaper but only a first-order approximation of the same choice. The surrogate suffices (transfer). A defense raises the budget needed to flip a target but makes no target immune; conclude on certification (ch. 7.3).

  10. ★★ Edge-DP. Prove that randomized response — each pair of nodes reported truthfully with probability p > \tfrac12, flipped otherwise — is (\varepsilon, 0)-edge-DP with \varepsilon = \ln \frac{p}{1-p} (the convention of Privacy & UQ, Proposition 4.2). Then estimate the number of edges between two groups from the released graph, and compare its error with the Laplace mechanism applied to the true count by a trusted curator.

    Solution: for two graphs neighboring in one edge, all other pairs have the same output law, and the differing pair is reported present with probability p in one graph and 1-p in the other. The likelihood ratio of any output is therefore at most \frac{p}{1-p}, hence the \varepsilon.

    Counting: over the m pairs between the two groups, with c true edges, the released count S has mean \mathbb{E}[S] = c\,p + (m - c)(1 - p) = m(1 - p) + (2p - 1)\,c , so \hat c = \big(S - m(1-p)\big)/(2p - 1) is unbiased, with variance \mathrm{Var}(\hat c) = \frac{m\, p(1-p)}{(2p-1)^2} .

    The Laplace mechanism on the true count (sensitivity 1, scale 1/\varepsilon) has variance 2/\varepsilon^2, independent of m. With p = 0.75, \varepsilon = \ln 3 \approx 1.10 and m = 1000 pairs, the standard deviations are about 27 edges for randomized response and 1.3 for Laplace: local noise is the price of not trusting a curator.

  11. ★★ Aligning a GNN with a text encoder on ogbn-arxiv. On ogbn-arxiv (169,343 papers, 40 subject classes; titles and abstracts from the OGB mapping to MAG), train a 2-layer GraphSAGE and embed each title with a frozen sentence encoder. Train two linear heads with the symmetric InfoNCE loss of 8.3 (batches of 512, learned \tau). Report:

      1. graph → text recall@10 among 1,000 random test candidates;
      1. zero-shot node classification by cosine similarity with the embedded names of the 40 classes, against a GraphSAGE trained with labels;
      1. optionally, one soft token per node in a small open LLM, with the projector trained to generate the class name.

    Partial solution (expected): chance level is 1 % for (a) (10 out of 1,000) and 2.5 % for (b) (1 out of 40); the aligned model should be far above both, and (b) below supervised training. Expect most zero-shot confusions between neighboring fields. Map your pipeline onto the table of 8.3: (a)–(b) align the spaces, (c) is the soft-token architecture.

  12. ★★★ Research project. Reproduce an experiment from one of (PathNN / GOAT / GPS / TGN / NGG) on OGB or TU; report: protocol, seeds, comparison to the published numbers, failure analysis — the M2’s “paper” exercise; for PathNN: compare the three variants (SP / SP+ / AP) on a molecular dataset (ZINC12K) and explain the observed hierarchy via ch. 9.1.

Projects and assessment

The fiche above records that the SynapseS 2026–2027 sheet of this module is “not published”: the module appears in neither the S3 nor the S4 track of the catalog, so no official assessment is displayed. Everything below is a proposal of these notes, not an official rule. The subjects are sized for an M2 module and reuse the experimental protocol of ch. 1 (seeds, confidence intervals, leakage checks), which every rubric line assumes.

The projects exercise mainly O4 (graph-structured data: expressive power, over-squashing, encodings, temporal graphs), O5 (Graph × LLM: soft tokens, alignment, graph prompting) and O8 (robustness and privacy on graphs), with O7 (hands-on, reproducible research practice). They feed the end-of-year projects Y2.1, Y2.4 and Y2.5.

Solo projects

  1. [Solo · ≈ 20 h] A test bench for expressive power. Which models separate which hard pairs of graphs, and does every outcome match a statement of ch. 2 and ch. 4?
    • Work: implement 1-WL, 2-WL and 2-FWL by hashing, GCN, GIN, an ego-net subgraph GNN in the style of ESAN, and GIN with RWSE or LapEig + SignNet inputs.
    • Data: synthetic pairs built with NetworkX — C6 vs 2×C3, house vs pentagon, the 4 \times 4 rook’s graph vs the Shrikhande graph (both strongly regular with parameters (16, 6, 2, 2)) — and the CSL graphs of Murphy et al. (ICML 2019), 41-node 4-regular cycles with skip links, in 10 classes.
    • Success criterion: a models × pairs table in which each entry is predicted, before running, by a result of the page — including the negative ones: 2-FWL and RWSE must both fail on the strongly regular pair.
    • Deliverables: code, a 4–6 page report, a 10-minute talk; chapters 2 and 4, exercises 1, 3 and 5.
  2. [Solo · ≈ 25 h] Paper study: Path Neural Networks (Michel, Nikolentzos, Lutzeyer & Vazirgiannis, ICML 2023). Do the three variants rank as their theory says, on synthetic pairs and on real benchmarks?
    • Work: reimplement PathNN-SP, SP+ and AP (path enumeration up to length K, LSTM path encoder of 9.1); check the separation claims on the pairs of solo project 1; then train on ZINC12K and two TU datasets.
    • Data: ZINC12K (Dwivedi et al.’s benchmarking subset) and PROTEINS and IMDB-B from TUDataset, with the 10-fold splits of Errica et al. (2020).
    • Success criterion: published numbers reproduced within one standard deviation, or the gap explained (budget, splits, K); the SP ≤ SP+ ≤ AP ordering tested, with its cost in time and memory.
    • Deliverables: code, report, talk; chapters 2 and 9, extending exercise 12.

Group projects

  1. [Group of 3 · ≈ 30 h each] Diagnosing and curing over-squashing. Do rewiring, deep propagation and global attention fix the long-range failures that the bound of Definition 3.1 predicts?
    • Work: measure the Jacobian sensitivity by autograd against distance, the spectral gap \lambda_2, the effective resistance and the edge curvatures; then compare SDRF, DIGL, APPNP, GCNII, GPS and Exphormer under one parameter budget.
    • Data: synthetic barbell graphs and the Tree-NeighborsMatch task of Alon & Yahav (2021), depths 2–6; then Peptides-func from the Long Range Graph Benchmark (Dwivedi et al., NeurIPS 2022), with its budget of about 500k parameters.
    • Split: diagnostics and rewiring; deep MPNNs; graph transformers — with one shared training harness.
    • Success criterion: average precision on Peptides-func with 95 % intervals over 5 seeds; \lambda_2 before and after each rewiring; a decision guide that confirms or corrects 5.4.
    • Deliverables: code, an 8–10 page joint report, a 20-minute talk; chapters 1, 3 and 5.
  2. [Group of 3 · ≈ 30 h each] Abuse detection on an event stream, under attack and under privacy. How much do memory, a budgeted attacker and an edge-DP release each cost a temporal detector?
    • Work: TGN and TGAT for dynamic node classification with a chronological 70/15/15 split; the memory ablation of exercise 8; an evasion attack that injects k events from attacker-controlled accounts, and a pruning or RGCN-style defense; a release of the training graph by randomized response (7.4) at several \varepsilon.
    • Data: the Wikipedia and Reddit interaction streams of JODIE (Kumar, Zhang & Leskovec, KDD 2019), with their banned-user labels; for a finance variant, the Elliptic Bitcoin graph (Weber et al., 2019) with snapshot models.
    • Split: temporal models and leakage checks; attack and defense; privacy release and evaluation.
    • Success criterion: AUC against attack budget and against \varepsilon, with intervals over 5 seeds; the leakage checklist of Graph ML 5.6–5.8 passed.
    • Deliverables: code, joint report, talk; chapters 1, 6 and 7, exercises 8–10. It is a first version of Y2.5 and links to Security ch. 9 and Privacy & UQ ch. 4.
  3. [Group of 3 · ≈ 30 h each] Graph tokens for an LLM. For a small open LLM, which input answers graph-reasoning questions best as graphs grow: text, pseudo-code or soft tokens?
    • Work: three pipelines on the same questions — text serialization with the encodings of Talk like a Graph (Fatemi, Halcrow & Perozzi, ICLR 2024); pseudo-code prompting (Skianis, Nikolentzos & Vazirgiannis, 2024; 9.4); and a GPS + RWSE encoder whose outputs enter the LLM as soft tokens, after the symmetric InfoNCE alignment of 8.3, with LoRA on the LLM.
    • Data: synthetic questions in the style of GraphQA (edge existence, degree, cycle check, connectivity, shortest path) on random graphs of 5 to 50 nodes, and the NLGraph benchmark (Wang et al., NeurIPS 2023); a model of 0.5B to 1.5B parameters on a free GPU.
    • Split: prompting pipelines; encoder, projector and alignment; evaluation harness and size curves.
    • Success criterion: accuracy against the number of nodes for each task and pipeline, with intervals over 3 seeds and an equal training-data budget for the trained pipelines.
    • Deliverables: code, joint report, talk; chapters 4, 5, 8 and 9. It connects to LLM 4.3 (LoRA) and LLM ch. 7 (retrieval), to Graph ML 10.2, and is the graph-token option of Y2.1.

Written exam (proposal)

Two hours, one handwritten A4 sheet allowed, no calculator needed; four questions, 20 points.

  1. Question (5 points). Define over-squashing with the Jacobian of Definition 3.1 and state the bound of Topping et al. Explain how a bottleneck, the Cheeger constant and the spectral gap are related. Then say how rewiring, APPNP/GCNII and graph transformers each act on the problem, and why over-squashing is not over-smoothing.
    • Expected: the sensitivity |\partial h_v^{(r+1)} / \partial x_u| is at most (\alpha\beta)^{r+1}(\hat A^{r+1})_{vu}, small when few walks of u reach v.
    • A bottleneck is a small h_G; by Cheeger, \lambda_2/2 \leq h_G \leq \sqrt{2\lambda_2}, so a small gap — not a large top eigenvalue.
    • Rewiring (SDRF) raises the curvature of negative edges and the gap; APPNP/GCNII change the propagation and anchor to the input; transformers make the channel all-to-all.
    • Over-smoothing is the collapse of representations with depth; over-squashing is the loss of distant inputs in the channel, even at moderate depth.
  2. Question (5 points). Two triangles \{0,1,2\} and \{3,4,5\} are joined by the bridge (2,3). (a) Compute the Ollivier-Ricci curvature of the bridge, with uniform measures on the neighbors. (b) Compute the Cheeger constant and deduce an upper bound on \lambda_2 of L_{\mathrm{sym}}. (c) Add the edge (1,4) and recompute the Cheeger constant.
    • Expected: (a) mass \frac13 on each of the neighbors 0, 1, 3 of node 2 moves to the neighbors 2, 4, 5 of node 3. The best plan moves 3 to 4 and 0 to 2 at cost 1, and 1 to 5 at cost 3, so W_1 = \frac53, \qquad \kappa = 1 - \frac53 = -\frac23 .
      1. The cut around one triangle: one edge over a volume 2 + 2 + 3 = 7, so h_G = \frac17 (no cut does better), and \lambda_2 \leq 2h_G = \frac27; the true value is about 0.205.
      1. The same cut now has 2 edges for a volume of 8: h_G = \frac14, and the bound on \lambda_2 rises to \frac12 (the true value is about 0.423).
  3. Question (5 points). (a) Compute the RWSE \big[(P^k)_{vv}\big]_{k=1}^{6} of a node of C3 and of a node of C6. (b) Show that 1-WL gives the same color to every node of the disjoint union C3 ∪ C6. (c) Conclude on the power of a GIN with RWSE inputs, and name two graphs that this GIN still cannot separate.
    • Expected: (a) for C3, (P^k)_{vv} = \frac13\big(1 + 2(-\frac12)^k\big); for C6, the odd terms vanish and the even ones agree with C3: \mathrm{C3}: \Big(0, \tfrac12, \tfrac14, \tfrac38, \tfrac{5}{16}, \tfrac{11}{32}\Big), \qquad \mathrm{C6}: \Big(0, \tfrac12, 0, \tfrac38, 0, \tfrac{11}{32}\Big) .
      1. The graph is 2-regular: all nodes start with the same color and see two neighbors of that color at every round.
      1. GIN + RWSE separates what 1-WL cannot (here, through k = 3 or k = 5); it still fails on strongly regular graphs with the same parameters, such as the 4 \times 4 rook’s graph and the Shrikhande graph, whose return probabilities are fixed by the parameters.
  4. Question (5 points). Randomized response releases each pair of nodes truthfully with probability p > \frac12 and flipped otherwise. (a) Prove that it is \varepsilon-edge-DP with \varepsilon = \ln \frac{p}{1-p}. (b) Give an unbiased estimator of the number c of edges among m given pairs, and its variance. (c) For p = 0.75 and 400 pairs, compare its standard deviation with that of the Laplace mechanism on the true count, at the same privacy level (take ln 3 ≈ 1.10).
    • Expected: (a) neighboring graphs differ on one pair; all other pairs have the same output law, and on that pair the probabilities of each output are p and 1 - p in some order, so every likelihood ratio is at most \frac{p}{1-p}.
      1. The released count S has mean m(1-p) + (2p-1)c, so \hat c = \big(S - m(1-p)\big)/(2p-1) is unbiased, with variance m p (1 - p)/(2p - 1)^2.
      1. With p = 0.75: variance 400 \times 0.1875 / 0.25 = 300, standard deviation about 17.3; Laplace with \varepsilon = \ln 3 \approx 1.10 has standard deviation \sqrt 2 / \varepsilon \approx 1.29.

Grading rubric (proposal)

Criterion Weight What earns the marks
Question and hypothesis 15 % a precise question, with the result of the page that predicts the outcome written down before the experiment
Method and implementation 25 % models written from the chapters and checked on cases with a known answer (the hand computations of Examples 2.4 and 4.2, Proposition 3.2)
Experimental protocol 20 % the ch. 1 protocol: equal parameter budgets, fixed splits, at least 5 seeds with intervals, temporal splits and leakage checks where relevant
Analysis tied to the theory 20 % each result, failures included, explained by a statement of the course (1-WL bound, Cheeger, curvature, DP accounting)
Critical reading 10 % the reference papers read for their assumptions and limits; published numbers compared honestly
Report and presentation 10 % a clear report and a talk on time, with honest limits and reproducible code

References