CMU Introduction To Deep Learning 11-785, Fall 2026: Lecture 25
Overview
The lecture derives graph neural networks (GNNs) as generalizations of convolutional neural networks (CNNs): both update node representations by passing and aggregating messages, but their weights reflect the structure available in the data. It moves from grid neighborhoods to irregular spatial points and unordered graphs, then covers permutation-equivariant aggregation, degree normalization, edge features, attention, graph positional encodings, prediction tasks, and limitations such as over-smoothing.
Key takeaways
- A CNN is a message-passing network on a grid: each neighbor's weight depends on its relative offset, and the same offset-specific weights are shared across all image locations.
- A graph's adjacency matrix changes under node renumbering as P A Pᵀ, so effective node-level GNN updates must be permutation-equivariant rather than tied to arbitrary node IDs.
- When graph neighbors have no positions or edge types, an order-independent aggregator such as sum, mean, or max is needed; mean aggregation helps prevent updates from scaling directly with node degree.
- Irregular spatial data can use learned functions of coordinate offsets to generate message weights, generalizing CNNs' fixed weight tables for grid offsets.
- Edge labels, edge features, degree normalization, and attention provide ways to distinguish graph neighbors beyond a single shared message weight.
- Laplacian eigenvectors can supply graph positional encodings, while repeated message passing risks over-smoothing by making node representations increasingly alike.
Chapters
- The lecture introduces graph neural networks as a final major topic in CMU's 11-785 deep learning course.
- MLPs, CNNs, RNNs, and transformers each impose assumptions on how input data are organized.
- CNNs exploit the regular grid structure of images, while general graphs lack a consistent grid or node ordering.
- Each image pixel is a node with a feature vector, initially RGB values and later convolutional channel values.
- Grid neighbors have meaningful relative positions, such as left, right, above, and below.
- CNN filters reuse weights according to each neighbor's relative offset as they scan the image.
- In a general graph, the drawing's layout does not define relationships; only the connections between nodes matter.
- Unlike grid nodes, graph neighbors have no universal left, right, or distance-based ordering.
- Because two differently drawn diagrams can represent the same graph, assigning a distinct weight by visual position would make the model depend on an irrelevant drawing.
- When graph edges have no distinguishing types or positions, neighbors must share a weight rather than receive direction-specific weights.
- Each node combines messages from its neighbors and itself to create a new representation, producing an updated copy of the graph.
- Feeding a flattened adjacency matrix to an MLP creates a large, sparse input and loses the graph's symmetry under node relabeling.
- A graph is specified by a vertex set and an edge set, with the adjacency matrix recording which node pairs are connected.
- A directed edge from node 1 to node 2 sets the corresponding matrix entry without requiring a reverse edge.
- An undirected graph has a symmetric adjacency matrix because every connection works in both directions.
- Renumbering nodes changes the rows and columns of the adjacency matrix without changing the underlying graph.
- A permutation matrix P reorders the graph, transforming its adjacency matrix as P A Pᵀ.
- Two adjacency matrices related by this permutation represent the same graph structure.
- Node-level tasks include classifying a social-network account as a bot or human; edge-level tasks include predicting a molecular bond.
- Graph-level prediction can classify a whole molecule by properties such as toxicity.
- An MLP on a flattened adjacency matrix can change its prediction after arbitrary node renumbering, even though the graph itself is unchanged.
- A CNN node update forms a weighted sum of neighboring feature vectors and the node's own vector, then applies a bias and activation.
- Each neighbor can be viewed as sending a message formed by multiplying its representation by a weight matrix.
- The receiving node aggregates the messages to produce its representation in the next layer.
- A CNN is convolutional because each message weight depends on the sender's relative offset and that weight pattern is shared across image locations.
- Grid edges have types such as left, right, and diagonal, allowing different weights for different directions.
- Stacked message-passing layers expand a node's receptive field, so deeper CNN layers incorporate information from farther across the image.
- A GNN applies message passing to graphs beyond the regular grid used by a CNN.
- Nodes can have different numbers of neighbors, and an edge has no positional offset unless the data provide one.
- Without extra edge information, a graph message can use a shared weight matrix for each connected neighbor before aggregation and activation.
- LiDAR point clouds, weather stations, and molecular atoms can have positions even when they do not form a regular grid.
- Neighbor sets can be defined through a radius or nearest-neighbor rule, while the coordinate differences describe relative direction and distance.
- Rotating or rearranging a drawing must not erase the meaningful coordinate relationships in the underlying spatial data.
- For spatial points, a learned function G can map the relative position pⱼ − pᵢ to a message weight.
- Unlike a CNN's finite table of weights for fixed grid offsets, G can handle offsets that vary across point-cloud inputs.
- An example weight function can decrease exponentially with squared distance, while other functions can be learned from data.
- In a graph without positions, a node's neighbors form a set, so the aggregation result must not depend on the order used to list them.
- Sum, mean, and max are order-independent aggregators, unlike subtraction or other order-sensitive operations.
- The node's own representation can use a separate weight matrix from its neighbors because the node itself has a distinct role.
- Summing neighbor messages can produce values that grow with node degree; mean aggregation divides by the number of incoming neighbors.
- With node features arranged in H and adjacency information in A, a mean update can be expressed using D⁻¹ A H W, where D contains node degrees.
- Under node relabeling, the updated node representations reorder in the same way as the inputs, making the operation permutation-equivariant.
- A self-edge lets each update combine a node's own representation with incoming neighbor messages.
- Symmetric degree normalization uses each edge's source and destination degrees to reduce the influence of highly connected hubs.
- Edge labels, such as single versus double molecular bonds, can select different message weights; edge features can also be passed through a learned function.
- Graph attention computes queries, keys, and values for nodes, then uses softmax attention weights to combine neighbor messages.
- Attention over an unpositioned graph can miss structural distinctions, so graph models may need positional encodings.
- Eigenvectors of a graph Laplacian can provide node position vectors; on a linear graph, suitable eigenvectors yield sinusoidal-style encodings.
- Random-walk return probabilities offer another structural encoding, though the lecture notes limitations for directed graphs.
- After several message-passing layers, an MLP can classify individual node vectors, pairs of node vectors for edge prediction, or pooled vectors for whole-graph prediction.
- Because the layers are differentiable, graph models can be trained end to end on labeled examples.
- Over-smoothing occurs when repeated aggregation makes node representations increasingly similar; information may also weaken as it travels across many graph steps.
- Applications include molecular property prediction, recommendations, travel-time estimation, weather modeling, and physics simulation.
Transcript excerpt
0:08 Why is discord going me giving me rubbish? Okay. Did you get the discord thingy? >> [snorts] >> It's I dropped it on lectures. >> Okay, just open it. [snorts] Come up.
1:05 Okay, we just use this clicker and >> off to the races we go. Will it last the full class? >> Will it last the full class or do I need to have connect the charger? >> No, I think it has full charge. >> Okay. was late. >> I just need a second screen and just the uh board. Good morning everybody. [snorts] >> Yeah, sorry we are slightly late. It's >> just to be safe. If I came in 15 minutes early and you know, of course, this means that my laptop has crashed so badly that it's I had to copy everything over to a second laptop and so I'm going to be late to class >> because equipment is malicious.
1:59 Yeah. >> All right. You get the clicker in. Yeah. Perfect. All right. Morning everybody and [snorts] welcome to the I don't have any last lecture before Thanksgiving and uh the final couple of topics in class. So today we're going to be talking about graph neural networks. I decided to go easy on you. The most fun subject of all I'm going to have uh easiest for me to explain also means
2:47 that I have the smallest audience. Great. Uh the slides today I took uh generous help from AI. It's the first time in my life that I made a slide made slide. Okay. Second time I've made the last 10 slides for GANs with AI help because it does a very good job of uh animating. So I tried it again here. Every now and then you're going to see some bizarre text. That text belongs to
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Carnegie Mellon University Deep Learning.